1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-21 04:50:55 +01:00

Clean up Profile Menu Item page

Summary: Cleans up the UI on the page here, uses two column layout, places actions as actionlist instead of dropdown. Changes edit pages to dialogs.

Test Plan: Add an application, divider, link, and facts to a menu page.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D17030
This commit is contained in:
Chad Little 2016-12-12 08:35:22 -08:00
parent 237f94b830
commit d8b028b51b

View file

@ -155,8 +155,10 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
return $content; return $content;
} }
$crumbs->setBorder(true);
return $controller->newPage() return $controller->newPage()
->setTitle(pht('Profile Stuff')) ->setTitle(pht('Configure Menu'))
->setNavigation($navigation) ->setNavigation($navigation)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild($content); ->appendChild($content);
@ -628,8 +630,12 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
->setUser($viewer); ->setUser($viewer);
$item_types = PhabricatorProfileMenuItem::getAllMenuItems(); $item_types = PhabricatorProfileMenuItem::getAllMenuItems();
$object = $this->getProfileObject();
$action_view->addAction( $action_list = id(new PhabricatorActionListView())
->setViewer($viewer);
$action_list->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setLabel(true) ->setLabel(true)
->setName(pht('Add New Menu Item...'))); ->setName(pht('Add New Menu Item...')));
@ -641,14 +647,15 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
$item_key = $item_type->getMenuItemKey(); $item_key = $item_type->getMenuItemKey();
$action_view->addAction( $action_list->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setIcon($item_type->getMenuItemTypeIcon()) ->setIcon($item_type->getMenuItemTypeIcon())
->setName($item_type->getMenuItemTypeName()) ->setName($item_type->getMenuItemTypeName())
->setHref($this->getItemURI("new/{$item_key}/"))); ->setHref($this->getItemURI("new/{$item_key}/"))
->setWorkflow(true));
} }
$action_view->addAction( $action_list->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setLabel(true) ->setLabel(true)
->setName(pht('Documentation'))); ->setName(pht('Documentation')));
@ -656,29 +663,37 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
$doc_link = PhabricatorEnv::getDoclink('Profile Menu User Guide'); $doc_link = PhabricatorEnv::getDoclink('Profile Menu User Guide');
$doc_name = pht('Profile Menu User Guide'); $doc_name = pht('Profile Menu User Guide');
$action_view->addAction( $action_list->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setIcon('fa-book') ->setIcon('fa-book')
->setHref($doc_link) ->setHref($doc_link)
->setName($doc_name)); ->setName($doc_name));
$action_button = id(new PHUIButtonView())
->setTag('a')
->setText(pht('Configure Menu'))
->setHref('#')
->setIcon('fa-gear')
->setDropdownMenu($action_view);
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader(pht('Profile Menu Items')) ->setHeader(pht('Profile Menu Items'))
->setSubHeader(pht('Drag tabs to reorder menu')) ->setHeaderIcon('fa-list');
->addActionLink($action_button);
$box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setHeader($header) ->setHeaderText(pht('Navigation'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setObjectList($list); ->setObjectList($list);
return $box; $panel = id(new PHUICurtainPanelView())
->appendChild($action_view);
$curtain = id(new PHUICurtainView())
->setViewer($viewer)
->setActionList($action_list);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setCurtain($curtain)
->setMainColumn(
array(
$box,
));
return $view;
} }
private function buildItemNewContent($item_key) { private function buildItemNewContent($item_key) {