From e08d70a9a5c82650a220708a839158f89a5f332c Mon Sep 17 00:00:00 2001 From: Chad Little Date: Thu, 3 Mar 2016 00:23:11 +0000 Subject: [PATCH] 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 --- resources/celerity/map.php | 4 +-- .../controller/HeraldRuleViewController.php | 28 +++++++++++++------ src/view/phui/PHUITwoColumnView.php | 10 ++++--- .../rsrc/css/application/herald/herald.css | 10 +++---- 4 files changed, 32 insertions(+), 20 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 4aa7284757..61647309ac 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -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', diff --git a/src/applications/herald/controller/HeraldRuleViewController.php b/src/applications/herald/controller/HeraldRuleViewController.php index f1f6bcff7a..4036be250b 100644 --- a/src/applications/herald/controller/HeraldRuleViewController.php +++ b/src/applications/herald/controller/HeraldRuleViewController.php @@ -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; + } + } diff --git a/src/view/phui/PHUITwoColumnView.php b/src/view/phui/PHUITwoColumnView.php index 666935c669..fb27a1a50d 100644 --- a/src/view/phui/PHUITwoColumnView.php +++ b/src/view/phui/PHUITwoColumnView.php @@ -130,10 +130,12 @@ final class PHUITwoColumnView extends AphrontTagView { if ($sections) { foreach ($sections as $content) { - $view[] = id(new PHUIObjectBoxView()) - ->setHeaderText($content[0]) - ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) - ->appendChild($content[1]); + if ($content[1]) { + $view[] = id(new PHUIObjectBoxView()) + ->setHeaderText($content[0]) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) + ->appendChild($content[1]); + } } } diff --git a/webroot/rsrc/css/application/herald/herald.css b/webroot/rsrc/css/application/herald/herald.css index 8feebd122e..26cb9cfd71 100644 --- a/webroot/rsrc/css/application/herald/herald.css +++ b/webroot/rsrc/css/application/herald/herald.css @@ -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}; }