1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +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:
Chad Little 2017-08-04 10:16:18 -07:00
parent 68ab9b2642
commit 83f66ce55e
16 changed files with 47 additions and 33 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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) {

View file

@ -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())

View file

@ -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'));

View file

@ -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);

View file

@ -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;
} }

View file

@ -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;

View file

@ -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(

View file

@ -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;
} }

View file

@ -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(

View file

@ -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;
} }

View file

@ -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;
} }

View file

@ -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;

View file

@ -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 = id(new PHUIHeaderView())
$header = null; ->setHeader($header_text)
$crumbs->setBorder(false); ->setHeaderIcon($header_icon);
} else { $crumbs->setBorder(true);
$header = id(new PHUIHeaderView())
->setHeader($header_text)
->setHeaderIcon($header_icon);
$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(); $view->setFooter($content);
if ($navigation) {
$view
->setNavigation($navigation)
->setMainColumn($content);
} else {
$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(