Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14377699
D18526.id44493.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
17 KB
Referenced Files
None
Subscribers
None
D18526.id44493.diff
View Options
diff --git a/src/applications/conduit/settings/PhabricatorConduitTokensSettingsPanel.php b/src/applications/conduit/settings/PhabricatorConduitTokensSettingsPanel.php
--- a/src/applications/conduit/settings/PhabricatorConduitTokensSettingsPanel.php
+++ b/src/applications/conduit/settings/PhabricatorConduitTokensSettingsPanel.php
@@ -88,18 +88,19 @@
));
$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 @@
$panel = id(new PHUIObjectBoxView())
->setHeader($header)
- ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
- ->setTable($table);
+ ->setBackground(PHUIObjectBoxView::WHITE_CONFIG)
+ ->appendChild($table);
return $panel;
}
diff --git a/src/applications/oauthserver/panel/PhabricatorOAuthServerAuthorizationsSettingsPanel.php b/src/applications/oauthserver/panel/PhabricatorOAuthServerAuthorizationsSettingsPanel.php
--- a/src/applications/oauthserver/panel/PhabricatorOAuthServerAuthorizationsSettingsPanel.php
+++ b/src/applications/oauthserver/panel/PhabricatorOAuthServerAuthorizationsSettingsPanel.php
@@ -134,8 +134,8 @@
$panel = id(new PHUIObjectBoxView())
->setHeader($header)
- ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
- ->setTable($table);
+ ->setBackground(PHUIObjectBoxView::WHITE_CONFIG)
+ ->appendChild($table);
return $panel;
}
diff --git a/src/applications/settings/panel/PhabricatorActivitySettingsPanel.php b/src/applications/settings/panel/PhabricatorActivitySettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorActivitySettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorActivitySettingsPanel.php
@@ -46,10 +46,7 @@
->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)
diff --git a/src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php b/src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php
@@ -138,24 +138,18 @@
$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(
diff --git a/src/applications/settings/panel/PhabricatorEmailPreferencesSettingsPanel.php b/src/applications/settings/panel/PhabricatorEmailPreferencesSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorEmailPreferencesSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorEmailPreferencesSettingsPanel.php
@@ -136,7 +136,7 @@
->setHeaderText(pht('Email Preferences'))
->setFormSaved($request->getStr('saved'))
->setFormErrors($errors)
- ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
+ ->setBackground(PHUIObjectBoxView::WHITE_CONFIG)
->setForm($form);
return $form_box;
diff --git a/src/applications/settings/panel/PhabricatorExternalAccountsSettingsPanel.php b/src/applications/settings/panel/PhabricatorExternalAccountsSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorExternalAccountsSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorExternalAccountsSettingsPanel.php
@@ -31,12 +31,10 @@
))
->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 @@
}
foreach ($accounts as $account) {
- $item = id(new PHUIObjectItemView());
+ $item = new PHUIObjectItemView();
$provider = idx($providers, $account->getProviderKey());
if ($provider) {
@@ -94,12 +92,10 @@
$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 @@
$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,
diff --git a/src/applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php b/src/applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php
@@ -101,34 +101,27 @@
true,
));
- $panel = new PHUIObjectBoxView();
- $header = new PHUIHeaderView();
-
$help_uri = PhabricatorEnv::getDoclink(
'User Guide: Multi-Factor Authentication');
- $help_button = id(new PHUIButtonView())
- ->setText(pht('Help'))
- ->setHref($help_uri)
- ->setTag('a')
- ->setIcon('fa-info-circle');
+ $buttons = array();
- $create_button = id(new PHUIButtonView())
- ->setText(pht('Add Authentication Factor'))
- ->setHref($this->getPanelURI('?new=true'))
+ $buttons[] = id(new PHUIButtonView())
->setTag('a')
+ ->setIcon('fa-plus')
+ ->setText(pht('Add Auth Factor'))
+ ->setHref($this->getPanelURI('?new=true'))
->setWorkflow(true)
- ->setIcon('fa-plus');
-
- $header->setHeader(pht('Authentication Factors'));
- $header->addActionLink($help_button);
- $header->addActionLink($create_button);
+ ->setColor(PHUIButtonView::GREY);
- $panel->setHeader($header);
- $panel->setTable($table);
- $panel->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
+ $buttons[] = id(new PHUIButtonView())
+ ->setTag('a')
+ ->setIcon('fa-book')
+ ->setText(pht('Help'))
+ ->setHref($help_uri)
+ ->setColor(PHUIButtonView::GREY);
- return $panel;
+ return $this->newBox(pht('Authentication Factors'), $table, $buttons);
}
private function processNew(AphrontRequest $request) {
diff --git a/src/applications/settings/panel/PhabricatorNotificationsSettingsPanel.php b/src/applications/settings/panel/PhabricatorNotificationsSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorNotificationsSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorNotificationsSettingsPanel.php
@@ -152,24 +152,17 @@
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');
-
- $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,
- ));
+ ->setColor(PHUIButtonView::GREY);
+
+ $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)
diff --git a/src/applications/settings/panel/PhabricatorPasswordSettingsPanel.php b/src/applications/settings/panel/PhabricatorPasswordSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorPasswordSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorPasswordSettingsPanel.php
@@ -91,7 +91,7 @@
// 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 @@
->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,
);
}
diff --git a/src/applications/settings/panel/PhabricatorSSHKeysSettingsPanel.php b/src/applications/settings/panel/PhabricatorSSHKeysSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorSSHKeysSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorSSHKeysSettingsPanel.php
@@ -45,14 +45,7 @@
$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));
}
}
diff --git a/src/applications/settings/panel/PhabricatorSessionsSettingsPanel.php b/src/applications/settings/panel/PhabricatorSessionsSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorSessionsSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorSessionsSettingsPanel.php
@@ -112,34 +112,27 @@
'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);
}
}
diff --git a/src/applications/settings/panel/PhabricatorSettingsPanel.php b/src/applications/settings/panel/PhabricatorSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorSettingsPanel.php
@@ -281,4 +281,21 @@
$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;
+ }
+
}
diff --git a/src/applications/settings/panel/PhabricatorTokensSettingsPanel.php b/src/applications/settings/panel/PhabricatorTokensSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorTokensSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorTokensSettingsPanel.php
@@ -71,23 +71,15 @@
'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');
-
- $header = id(new PHUIHeaderView())
- ->setHeader(pht('Temporary Tokens'))
- ->addActionLink($terminate_button);
-
- $panel = id(new PHUIObjectBoxView())
- ->setHeader($header)
- ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
- ->setTable($table);
+ ->setColor(PHUIButtonView::RED);
- return $panel;
+ return $this->newBox(pht('Temporary Tokens'), $table, array($button));
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 22, 1:40 AM (9 h, 42 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6916921
Default Alt Text
D18526.id44493.diff (17 KB)
Attached To
Mode
D18526: Update Settings for WHITE_CONFIG style boxes
Attached
Detach File
Event Timeline
Log In to Comment