mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 06:42:42 +01:00
Update Settings to use full side-navigation
Summary: Moves Settings to use a normal side navigation vs. a two column side navigation. It also updates Edit Engine to do the same, but I don't think there are other callsites. Added a consistent header for better clarification if you were editng your settings, global settings, or a bot's settings. Test Plan: Test each page on a personal account, create global settings, test each page there, create a bot account, and test each page on the bot account. Anything else? Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D18342
This commit is contained in:
parent
68ab9b2642
commit
83f66ce55e
16 changed files with 47 additions and 33 deletions
|
@ -108,6 +108,7 @@ final class PhabricatorConduitTokensSettingsPanel
|
|||
|
||||
$panel = id(new PHUIObjectBoxView())
|
||||
->setHeader($header)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
|
||||
return $panel;
|
||||
|
|
|
@ -134,6 +134,7 @@ final class PhabricatorOAuthServerAuthorizationsSettingsPanel
|
|||
|
||||
$panel = id(new PHUIObjectBoxView())
|
||||
->setHeader($header)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
|
||||
return $panel;
|
||||
|
|
|
@ -112,15 +112,27 @@ final class PhabricatorSettingsMainController
|
|||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb($panel->getPanelName());
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
if ($this->user) {
|
||||
$header_text = pht('Edit Settings (%s)', $user->getUserName());
|
||||
} else {
|
||||
$header_text = pht('Edit Global Settings');
|
||||
}
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($header_text)
|
||||
->setHeaderIcon('fa-pencil');
|
||||
|
||||
$title = $panel->getPanelName();
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setNavigation($nav)
|
||||
->setMainColumn($response);
|
||||
->setHeader($header)
|
||||
->setFooter($response);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setNavigation($nav)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
|
||||
|
|
|
@ -63,7 +63,12 @@ final class PhabricatorSettingsEditEngine
|
|||
}
|
||||
|
||||
protected function getObjectEditTitleText($object) {
|
||||
return pht('Edit Settings');
|
||||
$user = $object->getUser();
|
||||
if ($user) {
|
||||
return pht('Edit Settings (%s)', $user->getUserName());
|
||||
} else {
|
||||
return pht('Edit Global Settings');
|
||||
}
|
||||
}
|
||||
|
||||
protected function getObjectEditShortText($object) {
|
||||
|
|
|
@ -48,6 +48,7 @@ final class PhabricatorActivitySettingsPanel extends PhabricatorSettingsPanel {
|
|||
|
||||
$panel = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Account Activity Logs'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
|
||||
$pager_box = id(new PHUIBoxView())
|
||||
|
|
|
@ -157,6 +157,7 @@ final class PhabricatorDesktopNotificationsSettingsPanel
|
|||
->setHeader(pht('Desktop Notifications'))
|
||||
->addActionLink($test_button))
|
||||
->setForm($form)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setInfoView($status_box)
|
||||
->setFormSaved($request->getBool('saved'));
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ abstract class PhabricatorEditEngineSettingsPanel
|
|||
$engine = id(new PhabricatorSettingsEditEngine())
|
||||
->setController($this->getController())
|
||||
->setNavigation($this->getNavigation())
|
||||
->setHideHeader(true)
|
||||
->setIsSelfEdit($is_self)
|
||||
->setProfileURI($profile_uri);
|
||||
|
||||
|
|
|
@ -153,6 +153,7 @@ final class PhabricatorEmailAddressesSettingsPanel
|
|||
}
|
||||
$view->setHeader($header);
|
||||
$view->setTable($table);
|
||||
$view->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
|
@ -136,6 +136,7 @@ final class PhabricatorEmailPreferencesSettingsPanel
|
|||
->setHeaderText(pht('Email Preferences'))
|
||||
->setFormSaved($request->getStr('saved'))
|
||||
->setFormErrors($errors)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setForm($form);
|
||||
|
||||
return $form_box;
|
||||
|
|
|
@ -131,10 +131,12 @@ final class PhabricatorExternalAccountsSettingsPanel
|
|||
|
||||
$linked_box = id(new PHUIObjectBoxView())
|
||||
->setHeader($linked_head)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setObjectList($linked);
|
||||
|
||||
$linkable_box = id(new PHUIObjectBoxView())
|
||||
->setHeader($linkable_head)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setObjectList($linkable);
|
||||
|
||||
return array(
|
||||
|
|
|
@ -126,6 +126,7 @@ final class PhabricatorMultiFactorSettingsPanel
|
|||
|
||||
$panel->setHeader($header);
|
||||
$panel->setTable($table);
|
||||
$panel->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
|
||||
|
||||
return $panel;
|
||||
}
|
||||
|
|
|
@ -206,6 +206,7 @@ final class PhabricatorPasswordSettingsPanel extends PhabricatorSettingsPanel {
|
|||
->setHeaderText(pht('Change Password'))
|
||||
->setFormSaved($request->getStr('saved'))
|
||||
->setFormErrors($errors)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setForm($form);
|
||||
|
||||
return array(
|
||||
|
|
|
@ -50,6 +50,7 @@ final class PhabricatorSSHKeysSettingsPanel extends PhabricatorSettingsPanel {
|
|||
|
||||
$panel->setHeader($header);
|
||||
$panel->setTable($table);
|
||||
$panel->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
|
||||
|
||||
return $panel;
|
||||
}
|
||||
|
|
|
@ -136,7 +136,8 @@ final class PhabricatorSessionsSettingsPanel extends PhabricatorSettingsPanel {
|
|||
|
||||
$panel = id(new PHUIObjectBoxView())
|
||||
->setHeader($header)
|
||||
->setTable($table);
|
||||
->setTable($table)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
|
||||
|
||||
return $panel;
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@ final class PhabricatorTokensSettingsPanel extends PhabricatorSettingsPanel {
|
|||
|
||||
$panel = id(new PHUIObjectBoxView())
|
||||
->setHeader($header)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
|
||||
return $panel;
|
||||
|
|
|
@ -29,7 +29,6 @@ abstract class PhabricatorEditEngine
|
|||
private $page;
|
||||
private $pages;
|
||||
private $navigation;
|
||||
private $hideHeader;
|
||||
|
||||
final public function setViewer(PhabricatorUser $viewer) {
|
||||
$this->viewer = $viewer;
|
||||
|
@ -127,15 +126,6 @@ abstract class PhabricatorEditEngine
|
|||
return $this->navigation;
|
||||
}
|
||||
|
||||
public function setHideHeader($hide_header) {
|
||||
$this->hideHeader = $hide_header;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHideHeader() {
|
||||
return $this->hideHeader;
|
||||
}
|
||||
|
||||
|
||||
/* -( Managing Fields )---------------------------------------------------- */
|
||||
|
||||
|
@ -1194,15 +1184,10 @@ abstract class PhabricatorEditEngine
|
|||
|
||||
$crumbs = $this->buildCrumbs($object, $final = true);
|
||||
|
||||
if ($this->getHideHeader()) {
|
||||
$header = null;
|
||||
$crumbs->setBorder(false);
|
||||
} else {
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($header_text)
|
||||
->setHeaderIcon($header_icon);
|
||||
$crumbs->setBorder(true);
|
||||
}
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($header_text)
|
||||
->setHeaderIcon($header_icon);
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
if ($action_button) {
|
||||
$header->addActionLink($action_button);
|
||||
|
@ -1231,19 +1216,19 @@ abstract class PhabricatorEditEngine
|
|||
$view->setHeader($header);
|
||||
}
|
||||
|
||||
$navigation = $this->getNavigation();
|
||||
if ($navigation) {
|
||||
$view
|
||||
->setNavigation($navigation)
|
||||
->setMainColumn($content);
|
||||
} else {
|
||||
$view->setFooter($content);
|
||||
}
|
||||
$view->setFooter($content);
|
||||
|
||||
return $controller->newPage()
|
||||
$page = $controller->newPage()
|
||||
->setTitle($header_text)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
|
||||
$navigation = $this->getNavigation();
|
||||
if ($navigation) {
|
||||
$page->setNavigation($navigation);
|
||||
}
|
||||
|
||||
return $page;
|
||||
}
|
||||
|
||||
protected function newEditResponse(
|
||||
|
|
Loading…
Reference in a new issue