mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02: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())
|
$panel = id(new PHUIObjectBoxView())
|
||||||
->setHeader($header)
|
->setHeader($header)
|
||||||
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->setTable($table);
|
->setTable($table);
|
||||||
|
|
||||||
return $panel;
|
return $panel;
|
||||||
|
|
|
@ -134,6 +134,7 @@ final class PhabricatorOAuthServerAuthorizationsSettingsPanel
|
||||||
|
|
||||||
$panel = id(new PHUIObjectBoxView())
|
$panel = id(new PHUIObjectBoxView())
|
||||||
->setHeader($header)
|
->setHeader($header)
|
||||||
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->setTable($table);
|
->setTable($table);
|
||||||
|
|
||||||
return $panel;
|
return $panel;
|
||||||
|
|
|
@ -112,15 +112,27 @@ final class PhabricatorSettingsMainController
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
$crumbs->addTextCrumb($panel->getPanelName());
|
$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();
|
$title = $panel->getPanelName();
|
||||||
|
|
||||||
$view = id(new PHUITwoColumnView())
|
$view = id(new PHUITwoColumnView())
|
||||||
->setNavigation($nav)
|
->setHeader($header)
|
||||||
->setMainColumn($response);
|
->setFooter($response);
|
||||||
|
|
||||||
return $this->newPage()
|
return $this->newPage()
|
||||||
->setTitle($title)
|
->setTitle($title)
|
||||||
|
->setNavigation($nav)
|
||||||
->setCrumbs($crumbs)
|
->setCrumbs($crumbs)
|
||||||
->appendChild($view);
|
->appendChild($view);
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,12 @@ final class PhabricatorSettingsEditEngine
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getObjectEditTitleText($object) {
|
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) {
|
protected function getObjectEditShortText($object) {
|
||||||
|
|
|
@ -48,6 +48,7 @@ final class PhabricatorActivitySettingsPanel extends PhabricatorSettingsPanel {
|
||||||
|
|
||||||
$panel = id(new PHUIObjectBoxView())
|
$panel = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('Account Activity Logs'))
|
->setHeaderText(pht('Account Activity Logs'))
|
||||||
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->setTable($table);
|
->setTable($table);
|
||||||
|
|
||||||
$pager_box = id(new PHUIBoxView())
|
$pager_box = id(new PHUIBoxView())
|
||||||
|
|
|
@ -157,6 +157,7 @@ final class PhabricatorDesktopNotificationsSettingsPanel
|
||||||
->setHeader(pht('Desktop Notifications'))
|
->setHeader(pht('Desktop Notifications'))
|
||||||
->addActionLink($test_button))
|
->addActionLink($test_button))
|
||||||
->setForm($form)
|
->setForm($form)
|
||||||
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->setInfoView($status_box)
|
->setInfoView($status_box)
|
||||||
->setFormSaved($request->getBool('saved'));
|
->setFormSaved($request->getBool('saved'));
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@ abstract class PhabricatorEditEngineSettingsPanel
|
||||||
$engine = id(new PhabricatorSettingsEditEngine())
|
$engine = id(new PhabricatorSettingsEditEngine())
|
||||||
->setController($this->getController())
|
->setController($this->getController())
|
||||||
->setNavigation($this->getNavigation())
|
->setNavigation($this->getNavigation())
|
||||||
->setHideHeader(true)
|
|
||||||
->setIsSelfEdit($is_self)
|
->setIsSelfEdit($is_self)
|
||||||
->setProfileURI($profile_uri);
|
->setProfileURI($profile_uri);
|
||||||
|
|
||||||
|
|
|
@ -153,6 +153,7 @@ final class PhabricatorEmailAddressesSettingsPanel
|
||||||
}
|
}
|
||||||
$view->setHeader($header);
|
$view->setHeader($header);
|
||||||
$view->setTable($table);
|
$view->setTable($table);
|
||||||
|
$view->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,6 +136,7 @@ final class PhabricatorEmailPreferencesSettingsPanel
|
||||||
->setHeaderText(pht('Email Preferences'))
|
->setHeaderText(pht('Email Preferences'))
|
||||||
->setFormSaved($request->getStr('saved'))
|
->setFormSaved($request->getStr('saved'))
|
||||||
->setFormErrors($errors)
|
->setFormErrors($errors)
|
||||||
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->setForm($form);
|
->setForm($form);
|
||||||
|
|
||||||
return $form_box;
|
return $form_box;
|
||||||
|
|
|
@ -131,10 +131,12 @@ final class PhabricatorExternalAccountsSettingsPanel
|
||||||
|
|
||||||
$linked_box = id(new PHUIObjectBoxView())
|
$linked_box = id(new PHUIObjectBoxView())
|
||||||
->setHeader($linked_head)
|
->setHeader($linked_head)
|
||||||
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->setObjectList($linked);
|
->setObjectList($linked);
|
||||||
|
|
||||||
$linkable_box = id(new PHUIObjectBoxView())
|
$linkable_box = id(new PHUIObjectBoxView())
|
||||||
->setHeader($linkable_head)
|
->setHeader($linkable_head)
|
||||||
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->setObjectList($linkable);
|
->setObjectList($linkable);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
|
|
@ -126,6 +126,7 @@ final class PhabricatorMultiFactorSettingsPanel
|
||||||
|
|
||||||
$panel->setHeader($header);
|
$panel->setHeader($header);
|
||||||
$panel->setTable($table);
|
$panel->setTable($table);
|
||||||
|
$panel->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
|
||||||
|
|
||||||
return $panel;
|
return $panel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,6 +206,7 @@ final class PhabricatorPasswordSettingsPanel extends PhabricatorSettingsPanel {
|
||||||
->setHeaderText(pht('Change Password'))
|
->setHeaderText(pht('Change Password'))
|
||||||
->setFormSaved($request->getStr('saved'))
|
->setFormSaved($request->getStr('saved'))
|
||||||
->setFormErrors($errors)
|
->setFormErrors($errors)
|
||||||
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->setForm($form);
|
->setForm($form);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
|
|
@ -50,6 +50,7 @@ final class PhabricatorSSHKeysSettingsPanel extends PhabricatorSettingsPanel {
|
||||||
|
|
||||||
$panel->setHeader($header);
|
$panel->setHeader($header);
|
||||||
$panel->setTable($table);
|
$panel->setTable($table);
|
||||||
|
$panel->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
|
||||||
|
|
||||||
return $panel;
|
return $panel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,7 +136,8 @@ final class PhabricatorSessionsSettingsPanel extends PhabricatorSettingsPanel {
|
||||||
|
|
||||||
$panel = id(new PHUIObjectBoxView())
|
$panel = id(new PHUIObjectBoxView())
|
||||||
->setHeader($header)
|
->setHeader($header)
|
||||||
->setTable($table);
|
->setTable($table)
|
||||||
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
|
||||||
|
|
||||||
return $panel;
|
return $panel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,6 +84,7 @@ final class PhabricatorTokensSettingsPanel extends PhabricatorSettingsPanel {
|
||||||
|
|
||||||
$panel = id(new PHUIObjectBoxView())
|
$panel = id(new PHUIObjectBoxView())
|
||||||
->setHeader($header)
|
->setHeader($header)
|
||||||
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->setTable($table);
|
->setTable($table);
|
||||||
|
|
||||||
return $panel;
|
return $panel;
|
||||||
|
|
|
@ -29,7 +29,6 @@ abstract class PhabricatorEditEngine
|
||||||
private $page;
|
private $page;
|
||||||
private $pages;
|
private $pages;
|
||||||
private $navigation;
|
private $navigation;
|
||||||
private $hideHeader;
|
|
||||||
|
|
||||||
final public function setViewer(PhabricatorUser $viewer) {
|
final public function setViewer(PhabricatorUser $viewer) {
|
||||||
$this->viewer = $viewer;
|
$this->viewer = $viewer;
|
||||||
|
@ -127,15 +126,6 @@ abstract class PhabricatorEditEngine
|
||||||
return $this->navigation;
|
return $this->navigation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setHideHeader($hide_header) {
|
|
||||||
$this->hideHeader = $hide_header;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getHideHeader() {
|
|
||||||
return $this->hideHeader;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* -( Managing Fields )---------------------------------------------------- */
|
/* -( Managing Fields )---------------------------------------------------- */
|
||||||
|
|
||||||
|
@ -1194,15 +1184,10 @@ abstract class PhabricatorEditEngine
|
||||||
|
|
||||||
$crumbs = $this->buildCrumbs($object, $final = true);
|
$crumbs = $this->buildCrumbs($object, $final = true);
|
||||||
|
|
||||||
if ($this->getHideHeader()) {
|
|
||||||
$header = null;
|
|
||||||
$crumbs->setBorder(false);
|
|
||||||
} else {
|
|
||||||
$header = id(new PHUIHeaderView())
|
$header = id(new PHUIHeaderView())
|
||||||
->setHeader($header_text)
|
->setHeader($header_text)
|
||||||
->setHeaderIcon($header_icon);
|
->setHeaderIcon($header_icon);
|
||||||
$crumbs->setBorder(true);
|
$crumbs->setBorder(true);
|
||||||
}
|
|
||||||
|
|
||||||
if ($action_button) {
|
if ($action_button) {
|
||||||
$header->addActionLink($action_button);
|
$header->addActionLink($action_button);
|
||||||
|
@ -1231,19 +1216,19 @@ abstract class PhabricatorEditEngine
|
||||||
$view->setHeader($header);
|
$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)
|
->setTitle($header_text)
|
||||||
->setCrumbs($crumbs)
|
->setCrumbs($crumbs)
|
||||||
->appendChild($view);
|
->appendChild($view);
|
||||||
|
|
||||||
|
$navigation = $this->getNavigation();
|
||||||
|
if ($navigation) {
|
||||||
|
$page->setNavigation($navigation);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $page;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function newEditResponse(
|
protected function newEditResponse(
|
||||||
|
|
Loading…
Reference in a new issue