mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-28 00:10:57 +01:00
Touch up HeraldView a bit more
Summary: Better colors, move description to own box, cleaner spacing. Test Plan: View a few herald rules Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D15386
This commit is contained in:
parent
e3ed8b5fe1
commit
e08d70a9a5
4 changed files with 32 additions and 20 deletions
|
@ -72,7 +72,7 @@ return array(
|
||||||
'rsrc/css/application/flag/flag.css' => '5337623f',
|
'rsrc/css/application/flag/flag.css' => '5337623f',
|
||||||
'rsrc/css/application/harbormaster/harbormaster.css' => '834879db',
|
'rsrc/css/application/harbormaster/harbormaster.css' => '834879db',
|
||||||
'rsrc/css/application/herald/herald-test.css' => 'a52e323e',
|
'rsrc/css/application/herald/herald-test.css' => 'a52e323e',
|
||||||
'rsrc/css/application/herald/herald.css' => '826075fa',
|
'rsrc/css/application/herald/herald.css' => '46596280',
|
||||||
'rsrc/css/application/maniphest/batch-editor.css' => 'b0f0b6d5',
|
'rsrc/css/application/maniphest/batch-editor.css' => 'b0f0b6d5',
|
||||||
'rsrc/css/application/maniphest/report.css' => '9b9580b7',
|
'rsrc/css/application/maniphest/report.css' => '9b9580b7',
|
||||||
'rsrc/css/application/maniphest/task-edit.css' => 'fda62a9b',
|
'rsrc/css/application/maniphest/task-edit.css' => 'fda62a9b',
|
||||||
|
@ -560,7 +560,7 @@ return array(
|
||||||
'font-lato' => 'c7ccd872',
|
'font-lato' => 'c7ccd872',
|
||||||
'global-drag-and-drop-css' => '5c1b47c2',
|
'global-drag-and-drop-css' => '5c1b47c2',
|
||||||
'harbormaster-css' => '834879db',
|
'harbormaster-css' => '834879db',
|
||||||
'herald-css' => '826075fa',
|
'herald-css' => '46596280',
|
||||||
'herald-rule-editor' => '746ca158',
|
'herald-rule-editor' => '746ca158',
|
||||||
'herald-test-css' => 'a52e323e',
|
'herald-test-css' => 'a52e323e',
|
||||||
'inline-comment-summary-css' => '51efda3a',
|
'inline-comment-summary-css' => '51efda3a',
|
||||||
|
|
|
@ -18,7 +18,8 @@ final class HeraldRuleViewController extends HeraldController {
|
||||||
$header = id(new PHUIHeaderView())
|
$header = id(new PHUIHeaderView())
|
||||||
->setUser($viewer)
|
->setUser($viewer)
|
||||||
->setHeader($rule->getName())
|
->setHeader($rule->getName())
|
||||||
->setPolicyObject($rule);
|
->setPolicyObject($rule)
|
||||||
|
->setHeaderIcon('fa-bullhorn');
|
||||||
|
|
||||||
if ($rule->getIsDisabled()) {
|
if ($rule->getIsDisabled()) {
|
||||||
$header->setStatus(
|
$header->setStatus(
|
||||||
|
@ -35,6 +36,7 @@ final class HeraldRuleViewController extends HeraldController {
|
||||||
$actions = $this->buildActionView($rule);
|
$actions = $this->buildActionView($rule);
|
||||||
$properties = $this->buildPropertyView($rule);
|
$properties = $this->buildPropertyView($rule);
|
||||||
$details = $this->buildPropertySectionView($rule);
|
$details = $this->buildPropertySectionView($rule);
|
||||||
|
$description = $this->buildDescriptionView($rule);
|
||||||
|
|
||||||
$id = $rule->getID();
|
$id = $rule->getID();
|
||||||
|
|
||||||
|
@ -57,6 +59,7 @@ final class HeraldRuleViewController extends HeraldController {
|
||||||
->setHeader($header)
|
->setHeader($header)
|
||||||
->setMainColumn($timeline)
|
->setMainColumn($timeline)
|
||||||
->addPropertySection(pht('DETAILS'), $details)
|
->addPropertySection(pht('DETAILS'), $details)
|
||||||
|
->addPropertySection(pht('DESCRIPTION'), $description)
|
||||||
->setPropertyList($properties)
|
->setPropertyList($properties)
|
||||||
->setActionList($actions);
|
->setActionList($actions);
|
||||||
|
|
||||||
|
@ -155,17 +158,24 @@ final class HeraldRuleViewController extends HeraldController {
|
||||||
pht('Trigger Object'),
|
pht('Trigger Object'),
|
||||||
$viewer->renderHandle($rule->getTriggerObjectPHID()));
|
$viewer->renderHandle($rule->getTriggerObjectPHID()));
|
||||||
}
|
}
|
||||||
|
|
||||||
$view->addSectionHeader(
|
|
||||||
pht('Rule Description'),
|
|
||||||
PHUIPropertyListView::ICON_SUMMARY);
|
|
||||||
|
|
||||||
$handles = $viewer->loadHandles(HeraldAdapter::getHandlePHIDs($rule));
|
|
||||||
$rule_text = $adapter->renderRuleAsText($rule, $handles, $viewer);
|
|
||||||
$view->addTextContent($rule_text);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function buildDescriptionView(HeraldRule $rule) {
|
||||||
|
$viewer = $this->getRequest()->getUser();
|
||||||
|
$view = id(new PHUIPropertyListView())
|
||||||
|
->setUser($viewer);
|
||||||
|
|
||||||
|
$adapter = HeraldAdapter::getAdapterForContentType($rule->getContentType());
|
||||||
|
if ($adapter) {
|
||||||
|
$handles = $viewer->loadHandles(HeraldAdapter::getHandlePHIDs($rule));
|
||||||
|
$rule_text = $adapter->renderRuleAsText($rule, $handles, $viewer);
|
||||||
|
$view->addTextContent($rule_text);
|
||||||
|
return $view;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,12 +130,14 @@ final class PHUITwoColumnView extends AphrontTagView {
|
||||||
|
|
||||||
if ($sections) {
|
if ($sections) {
|
||||||
foreach ($sections as $content) {
|
foreach ($sections as $content) {
|
||||||
|
if ($content[1]) {
|
||||||
$view[] = id(new PHUIObjectBoxView())
|
$view[] = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText($content[0])
|
->setHeaderText($content[0])
|
||||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->appendChild($content[1]);
|
->appendChild($content[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return phutil_tag(
|
return phutil_tag(
|
||||||
'div',
|
'div',
|
||||||
|
|
|
@ -42,16 +42,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.herald-list-description {
|
.herald-list-description {
|
||||||
color: {$darkgreytext};
|
color: {$bluetext};
|
||||||
|
font-weight: bold;
|
||||||
padding: 8px 0;
|
padding: 8px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.herald-list-icon {
|
.herald-list-icon {
|
||||||
margin-left: 12px;
|
margin-right: 8px;
|
||||||
margin-right: 2px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.herald-list-item {
|
.herald-list-item {
|
||||||
padding-bottom: 4px;
|
padding-bottom: 20px;
|
||||||
color: {$greytext};
|
color: {$darkbluetext};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue