From a3bdce96806d4fe391d1740eac754ec072058da2 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 17 Dec 2015 14:27:02 -0800 Subject: [PATCH] Indent multiple items from the same application in Quick Create menu Summary: Ref T10004. Happy to take another approach here or just not bother, this just struck me as a little ambiguous/confusing. Test Plan: Before, not necessarily clear that the "Create Task" header only applies to the first few items. {F1029126} After, more clear: {F1029127} Reviewers: chad Reviewed By: chad Maniphest Tasks: T10004 Differential Revision: https://secure.phabricator.com/D14815 --- .../editengine/PhabricatorEditEngine.php | 3 ++- src/view/phui/PHUIListItemView.php | 21 ++++++++++++++++++- webroot/rsrc/css/phui/phui-list.css | 5 +++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/applications/transactions/editengine/PhabricatorEditEngine.php b/src/applications/transactions/editengine/PhabricatorEditEngine.php index 6cf9cb3bb8..b628e1723a 100644 --- a/src/applications/transactions/editengine/PhabricatorEditEngine.php +++ b/src/applications/transactions/editengine/PhabricatorEditEngine.php @@ -1741,7 +1741,8 @@ abstract class PhabricatorEditEngine ->setName($group_name); foreach ($configs as $config) { - $items[] = $this->newQuickCreateItem($config); + $items[] = $this->newQuickCreateItem($config) + ->setIndented(true); } } diff --git a/src/view/phui/PHUIListItemView.php b/src/view/phui/PHUIListItemView.php index e2e347306f..e877049840 100644 --- a/src/view/phui/PHUIListItemView.php +++ b/src/view/phui/PHUIListItemView.php @@ -28,6 +28,7 @@ final class PHUIListItemView extends AphrontTagView { private $order; private $aural; private $profileImage; + private $indented; public function setDropdownMenu(PhabricatorActionListView $actions) { Javelin::initBehavior('phui-dropdown-menu'); @@ -91,6 +92,15 @@ final class PHUIListItemView extends AphrontTagView { return $this->icon; } + public function setIndented($indented) { + $this->indented = $indented; + return $this; + } + + public function getIndented() { + return $this->indented; + } + public function setKey($key) { $this->key = (string)$key; return $this; @@ -256,11 +266,20 @@ final class PHUIListItemView extends AphrontTagView { ->setIconFont($this->appIcon); } + $classes = array(); + if ($this->href) { + $classes[] = 'phui-list-item-href'; + } + + if ($this->indented) { + $classes[] = 'phui-list-item-indented'; + } + return javelin_tag( $this->href ? 'a' : 'div', array( 'href' => $this->href, - 'class' => $this->href ? 'phui-list-item-href' : null, + 'class' => implode(' ', $classes), 'meta' => $meta, 'sigil' => $sigil, ), diff --git a/webroot/rsrc/css/phui/phui-list.css b/webroot/rsrc/css/phui/phui-list.css index 01d04f8b37..6b0a068b08 100644 --- a/webroot/rsrc/css/phui/phui-list.css +++ b/webroot/rsrc/css/phui/phui-list.css @@ -70,6 +70,11 @@ padding: 4px 10px; } +.phui-list-sidenav .phui-list-item-has-icon .phui-list-item-indented { + padding-left: 18px; +} + + .device-desktop .phui-list-sidenav .phui-list-item-href:hover { background: {$sky}; color: white;