From f3fa164882eab06ef10cfdfcacb82248962d9f80 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 3 Aug 2018 12:15:29 -0700 Subject: [PATCH] Add a "Last Edited" property to Wiki pages Summary: Ref T13164. See PHI797. The last edit is available in the page header, but it's not precise (just says "180 days ago") and a little weird (it's unusual for us to put that kind of information in the header). Add a precise timestamp to the footer for now. I'd imagine re-examining this the next time Phriction gets some UI work and maybe trying to integrate timeline/transactions more cleanly (see also T1894). Test Plan: Looked at a wiki page, then edited it. Saw precise "Last Edit" timestamp adjacent to "Last Author". Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13164 Differential Revision: https://secure.phabricator.com/D19560 --- .../phriction/controller/PhrictionDocumentController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/applications/phriction/controller/PhrictionDocumentController.php b/src/applications/phriction/controller/PhrictionDocumentController.php index 8377cf7d29..c8ffb86ce8 100644 --- a/src/applications/phriction/controller/PhrictionDocumentController.php +++ b/src/applications/phriction/controller/PhrictionDocumentController.php @@ -254,7 +254,8 @@ final class PhrictionDocumentController PhrictionContent $content, $slug) { - $viewer = $this->getRequest()->getUser(); + $viewer = $this->getViewer(); + $view = id(new PHUIPropertyListView()) ->setUser($viewer) ->setObject($document); @@ -263,6 +264,10 @@ final class PhrictionDocumentController pht('Last Author'), $viewer->renderHandle($content->getAuthorPHID())); + $view->addProperty( + pht('Last Edited'), + phabricator_datetime($content->getDateCreated(), $viewer)); + return $view; }