Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15465026
D15372.id37065.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D15372.id37065.diff
View Options
diff --git a/src/applications/macro/controller/PhabricatorMacroViewController.php b/src/applications/macro/controller/PhabricatorMacroViewController.php
--- a/src/applications/macro/controller/PhabricatorMacroViewController.php
+++ b/src/applications/macro/controller/PhabricatorMacroViewController.php
@@ -26,13 +26,14 @@
$title_long = pht('Image Macro "%s"', $macro->getName());
$actions = $this->buildActionView($macro);
+ $subheader = $this->buildSubheaderView($macro);
+ $properties = $this->buildPropertyView($macro);
$crumbs = $this->buildApplicationCrumbs();
- $crumbs->addTextCrumb(
- $title_short,
- $this->getApplicationURI('/view/'.$macro->getID().'/'));
+ $crumbs->addTextCrumb($macro->getName());
+ $crumbs->setBorder(true);
- $properties = $this->buildPropertyView($macro, $actions);
+ $file_view = null;
if ($file) {
$file_view = new PHUIPropertyListView();
$file_view->addImageContent(
@@ -42,6 +43,11 @@
'src' => $file->getViewURI(),
'class' => 'phabricator-image-macro-hero',
)));
+ $file_view = id(new PHUIObjectBoxView())
+ ->setHeaderText(pht('MACRO'))
+ ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
+ ->appendChild($file_view);
+
}
$timeline = $this->buildTransactionTimeline(
@@ -75,28 +81,29 @@
->setAction($this->getApplicationURI('/comment/'.$macro->getID().'/'))
->setSubmitButtonName(pht('Add Comment'));
- $object_box = id(new PHUIObjectBoxView())
+ $view = id(new PHUITwoColumnView())
->setHeader($header)
- ->addPropertyList($properties);
-
- if ($file_view) {
- $object_box->addPropertyList($file_view);
- }
-
- return $this->buildApplicationPage(
- array(
- $crumbs,
- $object_box,
+ ->setSubheader($subheader)
+ ->setMainColumn(array(
+ $file_view,
$timeline,
$add_comment_form,
- ),
- array(
- 'title' => $title_short,
- 'pageObjects' => array($macro->getPHID()),
+ ))
+ ->setPropertyList($properties)
+ ->setActionList($actions);
+
+ return $this->newPage()
+ ->setTitle($title_short)
+ ->setCrumbs($crumbs)
+ ->setPageObjectPHIDs(array($macro->getPHID()))
+ ->appendChild(
+ array(
+ $view,
));
}
- private function buildActionView(PhabricatorFileImageMacro $macro) {
+ private function buildActionView(
+ PhabricatorFileImageMacro $macro) {
$can_manage = $this->hasApplicationCapability(
PhabricatorMacroManageCapability::CAPABILITY);
@@ -141,15 +148,38 @@
return $view;
}
+ private function buildSubheaderView(
+ PhabricatorFileImageMacro $macro) {
+ $viewer = $this->getViewer();
+
+ $author = $viewer->renderHandle($macro->getAuthorPHID())->render();
+ $date = phabricator_datetime($macro->getDateCreated(), $viewer);
+ $author = phutil_tag('strong', array(), $author);
+
+ $person = id(new PhabricatorPeopleQuery())
+ ->setViewer($viewer)
+ ->withPHIDs(array($macro->getAuthorPHID()))
+ ->needProfileImage(true)
+ ->executeOne();
+
+ $image_uri = $person->getProfileImageURI();
+ $image_href = '/p/'.$person->getUsername();
+
+ $content = pht('Uploaded by %s on %s.', $author, $date);
+
+ return id(new PHUIHeadThingView())
+ ->setImage($image_uri)
+ ->setImageHref($image_href)
+ ->setContent($content);
+ }
+
private function buildPropertyView(
- PhabricatorFileImageMacro $macro,
- PhabricatorActionListView $actions) {
+ PhabricatorFileImageMacro $macro) {
$viewer = $this->getViewer();
$view = id(new PHUIPropertyListView())
->setUser($this->getRequest()->getUser())
- ->setObject($macro)
- ->setActionList($actions);
+ ->setObject($macro);
switch ($macro->getAudioBehavior()) {
case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_ONCE:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 3, 1:50 PM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7707574
Default Alt Text
D15372.id37065.diff (3 KB)
Attached To
Mode
D15372: Convert Macro to PHUITwoColumnView
Attached
Detach File
Event Timeline
Log In to Comment