1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02: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:
Chad Little 2016-03-03 00:23:11 +00:00 committed by chad
parent e3ed8b5fe1
commit e08d70a9a5
4 changed files with 32 additions and 20 deletions

View file

@ -72,7 +72,7 @@ return array(
'rsrc/css/application/flag/flag.css' => '5337623f',
'rsrc/css/application/harbormaster/harbormaster.css' => '834879db',
'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/report.css' => '9b9580b7',
'rsrc/css/application/maniphest/task-edit.css' => 'fda62a9b',
@ -560,7 +560,7 @@ return array(
'font-lato' => 'c7ccd872',
'global-drag-and-drop-css' => '5c1b47c2',
'harbormaster-css' => '834879db',
'herald-css' => '826075fa',
'herald-css' => '46596280',
'herald-rule-editor' => '746ca158',
'herald-test-css' => 'a52e323e',
'inline-comment-summary-css' => '51efda3a',

View file

@ -18,7 +18,8 @@ final class HeraldRuleViewController extends HeraldController {
$header = id(new PHUIHeaderView())
->setUser($viewer)
->setHeader($rule->getName())
->setPolicyObject($rule);
->setPolicyObject($rule)
->setHeaderIcon('fa-bullhorn');
if ($rule->getIsDisabled()) {
$header->setStatus(
@ -35,6 +36,7 @@ final class HeraldRuleViewController extends HeraldController {
$actions = $this->buildActionView($rule);
$properties = $this->buildPropertyView($rule);
$details = $this->buildPropertySectionView($rule);
$description = $this->buildDescriptionView($rule);
$id = $rule->getID();
@ -57,6 +59,7 @@ final class HeraldRuleViewController extends HeraldController {
->setHeader($header)
->setMainColumn($timeline)
->addPropertySection(pht('DETAILS'), $details)
->addPropertySection(pht('DESCRIPTION'), $description)
->setPropertyList($properties)
->setActionList($actions);
@ -155,17 +158,24 @@ final class HeraldRuleViewController extends HeraldController {
pht('Trigger Object'),
$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;
}
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;
}
}

View file

@ -130,12 +130,14 @@ final class PHUITwoColumnView extends AphrontTagView {
if ($sections) {
foreach ($sections as $content) {
if ($content[1]) {
$view[] = id(new PHUIObjectBoxView())
->setHeaderText($content[0])
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($content[1]);
}
}
}
return phutil_tag(
'div',

View file

@ -42,16 +42,16 @@
}
.herald-list-description {
color: {$darkgreytext};
color: {$bluetext};
font-weight: bold;
padding: 8px 0;
}
.herald-list-icon {
margin-left: 12px;
margin-right: 2px;
margin-right: 8px;
}
.herald-list-item {
padding-bottom: 4px;
color: {$greytext};
padding-bottom: 20px;
color: {$darkbluetext};
}