1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Update Settings for WHITE_CONFIG style boxes

Summary: Updates settings panel UI for new white box, cleans up other various UI nitpicks.

Test Plan: Click through each setting that had a local setting page. Edit Engine pages will follow up on another diff.

Reviewers: epriestley

Reviewed By: epriestley

Spies: Korvin

Differential Revision: https://secure.phabricator.com/D18526
This commit is contained in:
Chad Little 2017-09-05 19:30:52 -07:00
parent fc893658b8
commit 6e25d4c67b
15 changed files with 109 additions and 149 deletions

View file

@ -9,7 +9,7 @@ return array(
'names' => array(
'conpherence.pkg.css' => 'e68cf1fa',
'conpherence.pkg.js' => 'b5b51108',
'core.pkg.css' => 'ebbf04f7',
'core.pkg.css' => '03264689',
'core.pkg.js' => '6c085267',
'darkconsole.pkg.js' => '1f9a31bc',
'differential.pkg.css' => '45951e9e',
@ -157,7 +157,7 @@ return array(
'rsrc/css/phui/phui-form-view.css' => 'ae9f8d16',
'rsrc/css/phui/phui-form.css' => '7aaa04e3',
'rsrc/css/phui/phui-head-thing.css' => 'fd311e5f',
'rsrc/css/phui/phui-header-view.css' => '369275d6',
'rsrc/css/phui/phui-header-view.css' => '67fab16d',
'rsrc/css/phui/phui-hovercard.css' => 'f0592bcf',
'rsrc/css/phui/phui-icon-set-selector.css' => '87db8fee',
'rsrc/css/phui/phui-icon.css' => '5c4a5de6',
@ -843,7 +843,7 @@ return array(
'phui-form-css' => '7aaa04e3',
'phui-form-view-css' => 'ae9f8d16',
'phui-head-thing-view-css' => 'fd311e5f',
'phui-header-view-css' => '369275d6',
'phui-header-view-css' => '67fab16d',
'phui-hovercard' => '1bd28176',
'phui-hovercard-view-css' => 'f0592bcf',
'phui-icon-set-selector-css' => '87db8fee',

View file

@ -88,18 +88,19 @@ final class PhabricatorConduitTokensSettingsPanel
));
$generate_button = id(new PHUIButtonView())
->setText(pht('Generate API Token'))
->setText(pht('Generate Token'))
->setHref('/conduit/token/edit/?objectPHID='.$user->getPHID())
->setTag('a')
->setWorkflow(true)
->setIcon('fa-plus');
$terminate_button = id(new PHUIButtonView())
->setText(pht('Terminate All Tokens'))
->setText(pht('Terminate Tokens'))
->setHref('/conduit/token/terminate/?objectPHID='.$user->getPHID())
->setTag('a')
->setWorkflow(true)
->setIcon('fa-exclamation-triangle');
->setIcon('fa-exclamation-triangle')
->setColor(PHUIButtonView::RED);
$header = id(new PHUIHeaderView())
->setHeader(pht('Active API Tokens'))
@ -108,8 +109,8 @@ final class PhabricatorConduitTokensSettingsPanel
$panel = id(new PHUIObjectBoxView())
->setHeader($header)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($table);
->setBackground(PHUIObjectBoxView::WHITE_CONFIG)
->appendChild($table);
return $panel;
}

View file

@ -134,8 +134,8 @@ final class PhabricatorOAuthServerAuthorizationsSettingsPanel
$panel = id(new PHUIObjectBoxView())
->setHeader($header)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($table);
->setBackground(PHUIObjectBoxView::WHITE_CONFIG)
->appendChild($table);
return $panel;
}

View file

@ -46,10 +46,7 @@ final class PhabricatorActivitySettingsPanel extends PhabricatorSettingsPanel {
->setLogs($logs)
->setHandles($handles);
$panel = id(new PHUIObjectBoxView())
->setHeaderText(pht('Account Activity Logs'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($table);
$panel = $this->newBox(pht('Account Activity Logs'), $table);
$pager_box = id(new PHUIBoxView())
->addMargin(PHUI::MARGIN_LARGE)

View file

@ -138,24 +138,18 @@ final class PhabricatorEmailAddressesSettingsPanel
$editable,
));
$view = new PHUIObjectBoxView();
$header = new PHUIHeaderView();
$header->setHeader(pht('Email Addresses'));
$button = null;
if ($editable) {
$button = new PHUIButtonView();
$button->setText(pht('Add New Address'));
$button->setTag('a');
$button->setHref($uri->alter('new', 'true'));
$button->setIcon('fa-plus');
$button->addSigil('workflow');
$header->addActionLink($button);
$button = id(new PHUIButtonView())
->setTag('a')
->setIcon('fa-plus')
->setText(pht('Add New Address'))
->setHref($uri->alter('new', 'true'))
->addSigil('workflow')
->setColor(PHUIButtonView::GREY);
}
$view->setHeader($header);
$view->setTable($table);
$view->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
return $view;
return $this->newBox(pht('Email Addresses'), $table, array($button));
}
private function returnNewAddressResponse(

View file

@ -136,7 +136,7 @@ final class PhabricatorEmailPreferencesSettingsPanel
->setHeaderText(pht('Email Preferences'))
->setFormSaved($request->getStr('saved'))
->setFormErrors($errors)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setBackground(PHUIObjectBoxView::WHITE_CONFIG)
->setForm($form);
return $form_box;

View file

@ -31,12 +31,10 @@ final class PhabricatorExternalAccountsSettingsPanel
))
->execute();
$linked_head = id(new PHUIHeaderView())
->setHeader(pht('Linked Accounts and Authentication'));
$linked_head = pht('Linked Accounts and Authentication');
$linked = id(new PHUIObjectItemListView())
->setUser($viewer)
->setFlush(true)
->setNoDataString(pht('You have no linked accounts.'));
$login_accounts = 0;
@ -47,7 +45,7 @@ final class PhabricatorExternalAccountsSettingsPanel
}
foreach ($accounts as $account) {
$item = id(new PHUIObjectItemView());
$item = new PHUIObjectItemView();
$provider = idx($providers, $account->getProviderKey());
if ($provider) {
@ -94,12 +92,10 @@ final class PhabricatorExternalAccountsSettingsPanel
$linked->addItem($item);
}
$linkable_head = id(new PHUIHeaderView())
->setHeader(pht('Add External Account'));
$linkable_head = pht('Add External Account');
$linkable = id(new PHUIObjectItemListView())
->setUser($viewer)
->setFlush(true)
->setNoDataString(
pht('Your account is linked with all available providers.'));
@ -118,26 +114,19 @@ final class PhabricatorExternalAccountsSettingsPanel
$link_uri = '/auth/link/'.$provider->getProviderKey().'/';
$item = id(new PHUIObjectItemView());
$item->setHeader($provider->getProviderName());
$item->setHref($link_uri);
$item->addAction(
id(new PHUIListItemView())
->setIcon('fa-link')
->setHref($link_uri));
$item = id(new PHUIObjectItemView())
->setHeader($provider->getProviderName())
->setHref($link_uri)
->addAction(
id(new PHUIListItemView())
->setIcon('fa-link')
->setHref($link_uri));
$linkable->addItem($item);
}
$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);
$linked_box = $this->newBox($linked_head, $linked);
$linkable_box = $this->newBox($linkable_head, $linkable);
return array(
$linked_box,

View file

@ -101,34 +101,27 @@ final class PhabricatorMultiFactorSettingsPanel
true,
));
$panel = new PHUIObjectBoxView();
$header = new PHUIHeaderView();
$help_uri = PhabricatorEnv::getDoclink(
'User Guide: Multi-Factor Authentication');
$help_button = id(new PHUIButtonView())
$buttons = array();
$buttons[] = id(new PHUIButtonView())
->setTag('a')
->setIcon('fa-plus')
->setText(pht('Add Auth Factor'))
->setHref($this->getPanelURI('?new=true'))
->setWorkflow(true)
->setColor(PHUIButtonView::GREY);
$buttons[] = id(new PHUIButtonView())
->setTag('a')
->setIcon('fa-book')
->setText(pht('Help'))
->setHref($help_uri)
->setTag('a')
->setIcon('fa-info-circle');
->setColor(PHUIButtonView::GREY);
$create_button = id(new PHUIButtonView())
->setText(pht('Add Authentication Factor'))
->setHref($this->getPanelURI('?new=true'))
->setTag('a')
->setWorkflow(true)
->setIcon('fa-plus');
$header->setHeader(pht('Authentication Factors'));
$header->addActionLink($help_button);
$header->addActionLink($create_button);
$panel->setHeader($header);
$panel->setTable($table);
$panel->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
return $panel;
return $this->newBox(pht('Authentication Factors'), $table, $buttons);
}
private function processNew(AphrontRequest $request) {

View file

@ -152,24 +152,17 @@ final class PhabricatorNotificationsSettingsPanel
id(new AphrontFormSubmitControl())
->setValue(pht('Save Preference')));
$test_button = id(new PHUIButtonView())
$button = id(new PHUIButtonView())
->setTag('a')
->setIcon('fa-send-o')
->setWorkflow(true)
->setText(pht('Send Test Notification'))
->setHref('/notification/test/')
->setIcon('fa-exclamation-triangle');
->setColor(PHUIButtonView::GREY);
$form_box = id(new PHUIObjectBoxView())
->setHeader(
id(new PHUIHeaderView())
->setHeader(pht('Notifications'))
->addActionLink($test_button))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild(array(
$saved_box,
$status_box,
$form,
));
$form_content = array($saved_box, $status_box, $form);
$form_box = $this->newBox(
pht('Notifications'), $form_content, array($button));
$browser_status_box = id(new PHUIInfoView())
->setID($browser_status_id)

View file

@ -91,7 +91,7 @@ final class PhabricatorPasswordSettingsPanel extends PhabricatorSettingsPanel {
// is changed here the CSRF token check will fail.
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
$envelope = new PhutilOpaqueEnvelope($pass);
$envelope = new PhutilOpaqueEnvelope($pass);
id(new PhabricatorUserEditor())
->setActor($user)
->changePassword($user, $envelope);
@ -172,45 +172,47 @@ final class PhabricatorPasswordSettingsPanel extends PhabricatorSettingsPanel {
->setDisableAutocomplete(true)
->setLabel(pht('New Password'))
->setError($e_new)
->setName('new_pw'));
$form
->setName('new_pw'))
->appendChild(
id(new AphrontFormPasswordControl())
->setDisableAutocomplete(true)
->setLabel(pht('Confirm Password'))
->setCaption($len_caption)
->setError($e_conf)
->setName('conf_pw'));
$form
->setName('conf_pw'))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue(pht('Change Password')));
$form->appendChild(
id(new AphrontFormStaticControl())
->setLabel(pht('Current Algorithm'))
->setValue(PhabricatorPasswordHasher::getCurrentAlgorithmName(
new PhutilOpaqueEnvelope($user->getPasswordHash()))));
$properties = id(new PHUIPropertyListView());
$form->appendChild(
id(new AphrontFormStaticControl())
->setLabel(pht('Best Available Algorithm'))
->setValue(PhabricatorPasswordHasher::getBestAlgorithmName()));
$properties->addProperty(
pht('Current Algorithm'),
PhabricatorPasswordHasher::getCurrentAlgorithmName(
new PhutilOpaqueEnvelope($user->getPasswordHash())));
$form->appendRemarkupInstructions(
pht(
'NOTE: Changing your password will terminate any other outstanding '.
'login sessions.'));
$properties->addProperty(
pht('Best Available Algorithm'),
PhabricatorPasswordHasher::getBestAlgorithmName());
$info_view = id(new PHUIInfoView())
->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
->appendChild(
pht('Changing your password will terminate any other outstanding '.
'login sessions.'));
$algo_box = $this->newBox(pht('Password Algorithms'), $properties);
$form_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Change Password'))
->setFormSaved($request->getStr('saved'))
->setFormErrors($errors)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setBackground(PHUIObjectBoxView::WHITE_CONFIG)
->setForm($form);
return array(
$form_box,
$algo_box,
$info_view,
);
}

View file

@ -45,14 +45,7 @@ final class PhabricatorSSHKeysSettingsPanel extends PhabricatorSettingsPanel {
$viewer,
$user);
$header->setHeader(pht('SSH Public Keys'));
$header->addActionLink($ssh_actions);
$panel->setHeader($header);
$panel->setTable($table);
$panel->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
return $panel;
return $this->newBox(pht('SSH Public Keys'), $table, array($ssh_actions));
}
}

View file

@ -112,34 +112,27 @@ final class PhabricatorSessionsSettingsPanel extends PhabricatorSettingsPanel {
'action',
));
$terminate_button = id(new PHUIButtonView())
$buttons = array();
$buttons[] = id(new PHUIButtonView())
->setTag('a')
->setIcon('fa-warning')
->setText(pht('Terminate All Sessions'))
->setHref('/auth/session/terminate/all/')
->setTag('a')
->setWorkflow(true)
->setIcon('fa-exclamation-triangle');
$header = id(new PHUIHeaderView())
->setHeader(pht('Active Login Sessions'))
->addActionLink($terminate_button);
->setColor(PHUIButtonView::RED);
$hisec = ($viewer->getSession()->getHighSecurityUntil() - time());
if ($hisec > 0) {
$hisec_button = id(new PHUIButtonView())
$buttons[] = id(new PHUIButtonView())
->setTag('a')
->setIcon('fa-lock')
->setText(pht('Leave High Security'))
->setHref('/auth/session/downgrade/')
->setTag('a')
->setWorkflow(true)
->setIcon('fa-lock');
$header->addActionLink($hisec_button);
->setColor(PHUIButtonView::RED);
}
$panel = id(new PHUIObjectBoxView())
->setHeader($header)
->setTable($table)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
return $panel;
return $this->newBox(pht('Active Login Sessions'), $table, $buttons);
}
}

View file

@ -281,4 +281,21 @@ abstract class PhabricatorSettingsPanel extends Phobject {
$editor->applyTransactions($preferences, $xactions);
}
public function newBox($title, $content, $actions = array()) {
$header = id(new PHUIHeaderView())
->setHeader($title);
foreach ($actions as $action) {
$header->addActionLink($action);
}
$view = id(new PHUIObjectBoxView())
->setHeader($header)
->appendChild($content)
->setBackground(PHUIObjectBoxView::WHITE_CONFIG);
return $view;
}
}

View file

@ -71,23 +71,15 @@ final class PhabricatorTokensSettingsPanel extends PhabricatorSettingsPanel {
'action',
));
$terminate_button = id(new PHUIButtonView())
$button = id(new PHUIButtonView())
->setTag('a')
->setIcon('fa-warning')
->setText(pht('Revoke All'))
->setHref('/auth/token/revoke/all/')
->setTag('a')
->setWorkflow(true)
->setIcon('fa-exclamation-triangle');
->setColor(PHUIButtonView::RED);
$header = id(new PHUIHeaderView())
->setHeader(pht('Temporary Tokens'))
->addActionLink($terminate_button);
$panel = id(new PHUIObjectBoxView())
->setHeader($header)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($table);
return $panel;
return $this->newBox(pht('Temporary Tokens'), $table, array($button));
}
}

View file

@ -341,10 +341,6 @@ body .phui-header-shell.phui-bleed-header
color: {$blacktext};
}
.phui-profile-header .phui-header-col3 {
vertical-align: top;
}
.phui-header-view .phui-tag-indigo a {
color: {$sh-indigotext};
}