Add setEpoch for PHUIHeaderView, use in all Documents
Summary: Sets a consistent last update time in the header of PHUIDocuments, Legalpad, Diviner, Phriction. I'm not set on the exact language, just that there is consistency, feel free to suggest changes.
Test Plan:
Test Legalpad, Diviner, Phriction.
{F368270}
Reviewers: btrahan, epriestley
Reviewed By: epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12384
This commit is contained in:
@@ -35,16 +35,14 @@ final class DivinerBookController extends DivinerController {
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($book->getTitle())
|
||||
->setUser($viewer)
|
||||
->setPolicyObject($book);
|
||||
->setPolicyObject($book)
|
||||
->setEpoch($book->getDateModified());
|
||||
|
||||
$document = new PHUIDocumentView();
|
||||
$document->setHeader($header);
|
||||
$document->addClass('diviner-view');
|
||||
|
||||
$document->setFontKit(PHUIDocumentView::FONT_SOURCE_SANS);
|
||||
|
||||
$properties = $this->buildPropertyList($book);
|
||||
|
||||
$atoms = id(new DivinerAtomQuery())
|
||||
->setViewer($viewer)
|
||||
->withBookPHIDs(array($book->getPHID()))
|
||||
@@ -87,7 +85,6 @@ final class DivinerBookController extends DivinerController {
|
||||
$viewer);
|
||||
}
|
||||
|
||||
$document->appendChild($properties);
|
||||
$document->appendChild($preface_view);
|
||||
$document->appendChild($out);
|
||||
|
||||
@@ -101,20 +98,4 @@ final class DivinerBookController extends DivinerController {
|
||||
));
|
||||
}
|
||||
|
||||
private function buildPropertyList(DivinerLiveBook $book) {
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($viewer);
|
||||
|
||||
$policies = PhabricatorPolicyQuery::renderPolicyDescriptions(
|
||||
$viewer,
|
||||
$book);
|
||||
|
||||
$view->addProperty(
|
||||
pht('Updated'),
|
||||
phabricator_datetime($book->getDateModified(), $viewer));
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user