mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-18 19:40:55 +01:00
Update Herald for PHUITwoColumnView
Summary: Updates Herald to new two column layout Test Plan: View herald rule tablet, desktop, mobile Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D15373
This commit is contained in:
parent
21f8323612
commit
db4fdf8c2d
1 changed files with 31 additions and 11 deletions
|
@ -33,12 +33,14 @@ final class HeraldRuleViewController extends HeraldController {
|
|||
}
|
||||
|
||||
$actions = $this->buildActionView($rule);
|
||||
$properties = $this->buildPropertyView($rule, $actions);
|
||||
$properties = $this->buildPropertyView($rule);
|
||||
$details = $this->buildDetailsView($rule);
|
||||
|
||||
$id = $rule->getID();
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb("H{$id}");
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$object_box = id(new PHUIObjectBoxView())
|
||||
->setHeader($header)
|
||||
|
@ -51,13 +53,21 @@ final class HeraldRuleViewController extends HeraldController {
|
|||
|
||||
$title = $rule->getName();
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setMainColumn(array(
|
||||
$details,
|
||||
$timeline,
|
||||
))
|
||||
->setPropertyList($properties)
|
||||
->setActionList($actions);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild(
|
||||
array(
|
||||
$object_box,
|
||||
$timeline,
|
||||
$view,
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -105,15 +115,24 @@ final class HeraldRuleViewController extends HeraldController {
|
|||
}
|
||||
|
||||
private function buildPropertyView(
|
||||
HeraldRule $rule,
|
||||
PhabricatorActionListView $actions) {
|
||||
HeraldRule $rule) {
|
||||
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($viewer)
|
||||
->setObject($rule)
|
||||
->setActionList($actions);
|
||||
->setObject($rule);
|
||||
|
||||
$view->invokeWillRenderEvent();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
private function buildDetailsView(
|
||||
HeraldRule $rule) {
|
||||
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($viewer);
|
||||
|
||||
$view->addProperty(
|
||||
pht('Rule Type'),
|
||||
|
@ -139,8 +158,6 @@ final class HeraldRuleViewController extends HeraldController {
|
|||
$viewer->renderHandle($rule->getTriggerObjectPHID()));
|
||||
}
|
||||
|
||||
$view->invokeWillRenderEvent();
|
||||
|
||||
$view->addSectionHeader(
|
||||
pht('Rule Description'),
|
||||
PHUIPropertyListView::ICON_SUMMARY);
|
||||
|
@ -150,7 +167,10 @@ final class HeraldRuleViewController extends HeraldController {
|
|||
$view->addTextContent($rule_text);
|
||||
}
|
||||
|
||||
return $view;
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('DETAILS'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue