1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Moderize forms on Settings.

Summary: Adds mobile support, new forms.

Test Plan: Clicked on each page after converting. Tested mobile menu

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5863
This commit is contained in:
Chad Little 2013-05-07 18:08:12 -07:00
parent 1c8d045ea0
commit b39698eabf
14 changed files with 71 additions and 69 deletions

View file

@ -922,7 +922,7 @@ celerity_register_resource_map(array(
), ),
'conpherence-message-pane-css' => 'conpherence-message-pane-css' =>
array( array(
'uri' => '/res/6b49a2d9/rsrc/css/application/conpherence/message-pane.css', 'uri' => '/res/52cf7ca3/rsrc/css/application/conpherence/message-pane.css',
'type' => 'css', 'type' => 'css',
'requires' => 'requires' =>
array( array(

View file

@ -30,6 +30,8 @@ final class PhabricatorSettingsMainController
$nav, $nav,
array( array(
'title' => $panel->getPanelName(), 'title' => $panel->getPanelName(),
'device' => true,
'dust' => true,
)); ));
} }
@ -85,4 +87,9 @@ final class PhabricatorSettingsMainController
return $nav; return $nav;
} }
public function buildApplicationMenu() {
$panels = $this->buildPanels();
return $this->renderSideNav($panels)->getMenu();
}
} }

View file

@ -89,14 +89,13 @@ final class PhabricatorSettingsPanelAccount
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue(pht('Save'))); ->setValue(pht('Save')));
$panel = new AphrontPanelView(); $header = new PhabricatorHeaderView();
$panel->setHeader(pht('Account Settings')); $header->setHeader(pht('Account Settings'));
$panel->appendChild($form);
$panel->setNoBackground();
return array( return array(
$notice, $notice,
$panel, $header,
$form,
); );
} }
} }

View file

@ -78,10 +78,8 @@ final class PhabricatorSettingsPanelConduit
->setHeight(AphrontFormTextAreaControl::HEIGHT_SHORT) ->setHeight(AphrontFormTextAreaControl::HEIGHT_SHORT)
->setValue($user->getConduitCertificate())); ->setValue($user->getConduitCertificate()));
$cert = new AphrontPanelView(); $header1 = new PhabricatorHeaderView();
$cert->setHeader(pht('Arcanist Certificate')); $header1->setHeader(pht('Arcanist Certificate'));
$cert->appendChild($cert_form);
$cert->setNoBackground();
$regen_instruction = pht('You can regenerate this certificate, which '. $regen_instruction = pht('You can regenerate this certificate, which '.
'will invalidate the old certificate and create a new one.'); 'will invalidate the old certificate and create a new one.');
@ -97,15 +95,15 @@ final class PhabricatorSettingsPanelConduit
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue(pht('Regenerate Certificate'))); ->setValue(pht('Regenerate Certificate')));
$regen = new AphrontPanelView(); $header = new PhabricatorHeaderView();
$regen->setHeader(pht('Regenerate Certificate')); $header->setHeader(pht('Regenerate Certificate'));
$regen->appendChild($regen_form);
$regen->setNoBackground();
return array( return array(
$notice, $notice,
$cert, $header1,
$regen, $cert_form,
$header,
$regen_form,
); );
} }
} }

View file

@ -56,10 +56,8 @@ final class PhabricatorSettingsPanelConpherencePreferences
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue(pht('Save Preferences'))); ->setValue(pht('Save Preferences')));
$panel = new AphrontPanelView(); $header = new PhabricatorHeaderView();
$panel->setHeader(pht('Conpherence Preferences')); $header->setHeader(pht('Conpherence Preferences'));
$panel->appendChild($form);
$panel->setNoBackground();
$error_view = null; $error_view = null;
if ($request->getBool('saved')) { if ($request->getBool('saved')) {
@ -71,7 +69,8 @@ final class PhabricatorSettingsPanelConpherencePreferences
return array( return array(
$error_view, $error_view,
$panel, $header,
$form,
); );
} }
} }

View file

@ -58,10 +58,8 @@ final class PhabricatorSettingsPanelDiffPreferences
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue(pht('Save Preferences'))); ->setValue(pht('Save Preferences')));
$panel = new AphrontPanelView(); $header = new PhabricatorHeaderView();
$panel->setHeader(pht('Diff Preferences')); $header->setHeader(pht('Diff Preferences'));
$panel->appendChild($form);
$panel->setNoBackground();
$error_view = null; $error_view = null;
if ($request->getBool('saved')) { if ($request->getBool('saved')) {
@ -73,7 +71,8 @@ final class PhabricatorSettingsPanelDiffPreferences
return array( return array(
$error_view, $error_view,
$panel, $header,
$form,
); );
} }
} }

View file

@ -157,10 +157,8 @@ EXAMPLE;
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue(pht('Save Preferences'))); ->setValue(pht('Save Preferences')));
$panel = new AphrontPanelView(); $header = new PhabricatorHeaderView();
$panel->setHeader(pht('Display Preferences')); $header->setHeader(pht('Display Preferences'));
$panel->appendChild($form);
$panel->setNoBackground();
$error_view = null; $error_view = null;
if ($request->getStr('saved') === 'true') { if ($request->getStr('saved') === 'true') {
@ -172,7 +170,8 @@ EXAMPLE;
return array( return array(
$error_view, $error_view,
$panel, $header,
$form,
); );
} }
} }

View file

@ -203,16 +203,15 @@ final class PhabricatorSettingsPanelEmailPreferences
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue(pht('Save Preferences'))); ->setValue(pht('Save Preferences')));
$panel = new AphrontPanelView(); $header = new PhabricatorHeaderView();
$panel->setHeader(pht('Email Preferences')); $header->setHeader(pht('Email Preferences'));
$panel->appendChild($form);
$panel->setNoBackground();
return id(new AphrontNullView()) return id(new AphrontNullView())
->appendChild( ->appendChild(
array( array(
$notice, $notice,
$panel, $header,
$form,
)); ));
} }

View file

@ -69,19 +69,22 @@ final class PhabricatorSettingsPanelLDAP
$forms['Unlink Account'] = $unlink_form; $forms['Unlink Account'] = $unlink_form;
} }
$panel = new AphrontPanelView(); $header = new PhabricatorHeaderView();
$panel->setHeader(pht('LDAP Account Settings')); $header->setHeader(pht('LDAP Account Settings'));
$panel->setNoBackground();
$formbox = new PHUIBoxView();
foreach ($forms as $name => $form) { foreach ($forms as $name => $form) {
if ($name) { if ($name) {
$panel->appendChild(hsprintf('<br /><h1>%s</h1><br />', $name)); $head = new PhabricatorHeaderView();
$head->setHeader($name);
$formbox->appendChild($head);
} }
$panel->appendChild($form); $formbox->appendChild($form);
} }
return array( return array(
$panel, $header,
$formbox,
); );
} }
} }

View file

@ -128,7 +128,7 @@ final class PhabricatorSettingsPanelOAuth
} }
if (!$provider->isProviderLinkPermanent()) { if (!$provider->isProviderLinkPermanent()) {
$unlink = pht('Unlink %s Account'); $unlink = pht('Unlink %s Account', $provider_name);
$unlink_form = new AphrontFormView(); $unlink_form = new AphrontFormView();
$unlink_form $unlink_form
->setUser($user) ->setUser($user)
@ -208,22 +208,25 @@ final class PhabricatorSettingsPanelOAuth
$forms['Account Token Information'] = $token_form; $forms['Account Token Information'] = $token_form;
} }
$panel = new AphrontPanelView(); $header = new PhabricatorHeaderView();
$panel->setHeader(pht('%s Account Settings', $provider_name)); $header->setHeader(pht('%s Account Settings', $provider_name));
$panel->setNoBackground();
$formbox = new PHUIBoxView();
foreach ($forms as $name => $form) { foreach ($forms as $name => $form) {
if ($name) { if ($name) {
$panel->appendChild(hsprintf('<br /><h1>%s</h1><br />', $name)); $head = new PhabricatorHeaderView();
$head->setHeader($name);
$formbox->appendChild($head);
} }
$panel->appendChild($form); $formbox->appendChild($form);
} }
return id(new AphrontNullView()) return id(new AphrontNullView())
->appendChild( ->appendChild(
array( array(
$notice, $notice,
$panel, $header,
$formbox,
)); ));
} }

View file

@ -159,14 +159,13 @@ final class PhabricatorSettingsPanelPassword
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue(pht('Save'))); ->setValue(pht('Save')));
$panel = new AphrontPanelView(); $header = new PhabricatorHeaderView();
$panel->setHeader(pht('Change Password')); $header->setHeader(pht('Change Password'));
$panel->appendChild($form);
$panel->setNoBackground();
return array( return array(
$notice, $notice,
$panel, $header,
$form,
); );
} }
} }

View file

@ -217,14 +217,13 @@ final class PhabricatorSettingsPanelProfile
->setValue(pht('Save')) ->setValue(pht('Save'))
->addCancelButton('/p/'.$user->getUsername().'/')); ->addCancelButton('/p/'.$user->getUsername().'/'));
$panel = new AphrontPanelView(); $header = new PhabricatorHeaderView();
$panel->setHeader(pht('Edit Profile Details')); $header->setHeader(pht('Edit Profile Details'));
$panel->appendChild($form);
$panel->setNoBackground();
return array( return array(
$error_view, $error_view,
$panel, $header,
$form,
); );
} }

View file

@ -152,16 +152,15 @@ final class PhabricatorSettingsPanelSSHKeys
->addCancelButton($this->getPanelURI()) ->addCancelButton($this->getPanelURI())
->setValue($save)); ->setValue($save));
$panel = new AphrontPanelView(); $header_title = new PhabricatorHeaderView();
$panel->setHeader($header); $header_title->setHeader($header);
$panel->appendChild($form);
$panel->setNoBackground();
return id(new AphrontNullView()) return id(new AphrontNullView())
->appendChild( ->appendChild(
array( array(
$error_view, $error_view,
$panel, $header_title,
$form,
)); ));
} }

View file

@ -50,10 +50,8 @@ final class PhabricatorSettingsPanelSearchPreferences
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue(pht('Save'))); ->setValue(pht('Save')));
$panel = new AphrontPanelView(); $header = new PhabricatorHeaderView();
$panel->setHeader(pht('Search Preferences')); $header->setHeader(pht('Search Preferences'));
$panel->appendChild($form);
$panel->setNoBackground();
$error_view = null; $error_view = null;
if ($request->getStr('saved') === 'true') { if ($request->getStr('saved') === 'true') {
@ -65,7 +63,8 @@ final class PhabricatorSettingsPanelSearchPreferences
return array( return array(
$error_view, $error_view,
$panel, $header,
$form,
); );
} }
} }