mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Clean up authentication list
Summary: Uses more standard boxes for display, and icons! Test Plan: Test with all enabled, all disabled, and a mix. {F285945} {F285946} Reviewers: btrahan, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Differential Revision: https://secure.phabricator.com/D11707
This commit is contained in:
parent
eee8d194eb
commit
272ce408dc
4 changed files with 30 additions and 17 deletions
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
return array(
|
return array(
|
||||||
'names' => array(
|
'names' => array(
|
||||||
'core.pkg.css' => 'f1eab25d',
|
'core.pkg.css' => 'e09f7a8c',
|
||||||
'core.pkg.js' => '65e04767',
|
'core.pkg.js' => '65e04767',
|
||||||
'darkconsole.pkg.js' => '8ab24e01',
|
'darkconsole.pkg.js' => '8ab24e01',
|
||||||
'differential.pkg.css' => '8af45893',
|
'differential.pkg.css' => '8af45893',
|
||||||
|
@ -137,7 +137,7 @@ return array(
|
||||||
'rsrc/css/phui/phui-info-panel.css' => '27ea50a1',
|
'rsrc/css/phui/phui-info-panel.css' => '27ea50a1',
|
||||||
'rsrc/css/phui/phui-list.css' => '53deb25c',
|
'rsrc/css/phui/phui-list.css' => '53deb25c',
|
||||||
'rsrc/css/phui/phui-object-box.css' => 'b8b7fd78',
|
'rsrc/css/phui/phui-object-box.css' => 'b8b7fd78',
|
||||||
'rsrc/css/phui/phui-object-item-list-view.css' => '2670a4a9',
|
'rsrc/css/phui/phui-object-item-list-view.css' => '97d117e1',
|
||||||
'rsrc/css/phui/phui-pinboard-view.css' => '3dd4a269',
|
'rsrc/css/phui/phui-pinboard-view.css' => '3dd4a269',
|
||||||
'rsrc/css/phui/phui-property-list-view.css' => '51480060',
|
'rsrc/css/phui/phui-property-list-view.css' => '51480060',
|
||||||
'rsrc/css/phui/phui-remarkup-preview.css' => '19ad512b',
|
'rsrc/css/phui/phui-remarkup-preview.css' => '19ad512b',
|
||||||
|
@ -785,7 +785,7 @@ return array(
|
||||||
'phui-info-panel-css' => '27ea50a1',
|
'phui-info-panel-css' => '27ea50a1',
|
||||||
'phui-list-view-css' => '53deb25c',
|
'phui-list-view-css' => '53deb25c',
|
||||||
'phui-object-box-css' => 'b8b7fd78',
|
'phui-object-box-css' => 'b8b7fd78',
|
||||||
'phui-object-item-list-view-css' => '2670a4a9',
|
'phui-object-item-list-view-css' => '97d117e1',
|
||||||
'phui-pinboard-view-css' => '3dd4a269',
|
'phui-pinboard-view-css' => '3dd4a269',
|
||||||
'phui-property-list-view-css' => '51480060',
|
'phui-property-list-view-css' => '51480060',
|
||||||
'phui-remarkup-preview-css' => '19ad512b',
|
'phui-remarkup-preview-css' => '19ad512b',
|
||||||
|
|
|
@ -12,6 +12,7 @@ final class PhabricatorAuthListController
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$list = new PHUIObjectItemListView();
|
$list = new PHUIObjectItemListView();
|
||||||
|
|
||||||
foreach ($configs as $config) {
|
foreach ($configs as $config) {
|
||||||
$item = new PHUIObjectItemView();
|
$item = new PHUIObjectItemView();
|
||||||
|
|
||||||
|
@ -28,8 +29,7 @@ final class PhabricatorAuthListController
|
||||||
$name = $config->getProviderType().' ('.$config->getProviderClass().')';
|
$name = $config->getProviderType().' ('.$config->getProviderClass().')';
|
||||||
}
|
}
|
||||||
|
|
||||||
$item
|
$item->setHeader($name);
|
||||||
->setHeader($name);
|
|
||||||
|
|
||||||
if ($provider) {
|
if ($provider) {
|
||||||
$item->setHref($edit_uri);
|
$item->setHref($edit_uri);
|
||||||
|
@ -52,7 +52,7 @@ final class PhabricatorAuthListController
|
||||||
$can_manage = $this->hasApplicationCapability(
|
$can_manage = $this->hasApplicationCapability(
|
||||||
AuthManageProvidersCapability::CAPABILITY);
|
AuthManageProvidersCapability::CAPABILITY);
|
||||||
if ($config->getIsEnabled()) {
|
if ($config->getIsEnabled()) {
|
||||||
$item->setBarColor('green');
|
$item->setState(PHUIObjectItemView::STATE_SUCCESS);
|
||||||
$item->addAction(
|
$item->addAction(
|
||||||
id(new PHUIListItemView())
|
id(new PHUIListItemView())
|
||||||
->setIcon('fa-times')
|
->setIcon('fa-times')
|
||||||
|
@ -60,7 +60,7 @@ final class PhabricatorAuthListController
|
||||||
->setDisabled(!$can_manage)
|
->setDisabled(!$can_manage)
|
||||||
->addSigil('workflow'));
|
->addSigil('workflow'));
|
||||||
} else {
|
} else {
|
||||||
$item->setBarColor('grey');
|
$item->setState(PHUIObjectItemView::STATE_FAIL);
|
||||||
$item->addIcon('fa-times grey', pht('Disabled'));
|
$item->addIcon('fa-times grey', pht('Disabled'));
|
||||||
$item->addAction(
|
$item->addAction(
|
||||||
id(new PHUIListItemView())
|
id(new PHUIListItemView())
|
||||||
|
@ -90,7 +90,6 @@ final class PhabricatorAuthListController
|
||||||
pht('Add Authentication Provider'))));
|
pht('Add Authentication Provider'))));
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
$crumbs->setBorder(true);
|
|
||||||
$crumbs->addTextCrumb(pht('Auth Providers'));
|
$crumbs->addTextCrumb(pht('Auth Providers'));
|
||||||
|
|
||||||
$config_name = 'auth.email-domains';
|
$config_name = 'auth.email-domains';
|
||||||
|
@ -108,7 +107,6 @@ final class PhabricatorAuthListController
|
||||||
$email_domains = PhabricatorEnv::getEnvConfig($config_name);
|
$email_domains = PhabricatorEnv::getEnvConfig($config_name);
|
||||||
if ($email_domains) {
|
if ($email_domains) {
|
||||||
$warning->setSeverity(PHUIErrorView::SEVERITY_NOTICE);
|
$warning->setSeverity(PHUIErrorView::SEVERITY_NOTICE);
|
||||||
$warning->setTitle(pht('Registration is Restricted'));
|
|
||||||
$warning->appendChild(
|
$warning->appendChild(
|
||||||
pht(
|
pht(
|
||||||
'Only users with a verified email address at one of the %s domains '.
|
'Only users with a verified email address at one of the %s domains '.
|
||||||
|
@ -117,7 +115,6 @@ final class PhabricatorAuthListController
|
||||||
phutil_tag('strong', array(), implode(', ', $email_domains))));
|
phutil_tag('strong', array(), implode(', ', $email_domains))));
|
||||||
} else {
|
} else {
|
||||||
$warning->setSeverity(PHUIErrorView::SEVERITY_WARNING);
|
$warning->setSeverity(PHUIErrorView::SEVERITY_WARNING);
|
||||||
$warning->setTitle(pht('Anyone Can Register an Account'));
|
|
||||||
$warning->appendChild(
|
$warning->appendChild(
|
||||||
pht(
|
pht(
|
||||||
'Anyone who can browse to this Phabricator install will be able to '.
|
'Anyone who can browse to this Phabricator install will be able to '.
|
||||||
|
@ -126,10 +123,28 @@ final class PhabricatorAuthListController
|
||||||
$config_link));
|
$config_link));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$image = id(new PHUIIconView())
|
||||||
|
->setIconFont('fa-plus');
|
||||||
|
$button = id(new PHUIButtonView())
|
||||||
|
->setTag('a')
|
||||||
|
->setColor(PHUIButtonView::SIMPLE)
|
||||||
|
->setHref($this->getApplicationURI('config/new/'))
|
||||||
|
->setIcon($image)
|
||||||
|
->setText(pht('Add Provider'));
|
||||||
|
|
||||||
|
$header = id(new PHUIHeaderView())
|
||||||
|
->setHeader(pht('Authentication Providers'))
|
||||||
|
->addActionLink($button);
|
||||||
|
|
||||||
|
$list->setFlush(true);
|
||||||
|
$list = id(new PHUIObjectBoxView())
|
||||||
|
->setHeader($header)
|
||||||
|
->setErrorView($warning)
|
||||||
|
->appendChild($list);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
return $this->buildApplicationPage(
|
||||||
array(
|
array(
|
||||||
$crumbs,
|
$crumbs,
|
||||||
$warning,
|
|
||||||
$list,
|
$list,
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -25,12 +25,6 @@ abstract class PhabricatorAuthProviderConfigController
|
||||||
|
|
||||||
$can_create = $this->hasApplicationCapability(
|
$can_create = $this->hasApplicationCapability(
|
||||||
AuthManageProvidersCapability::CAPABILITY);
|
AuthManageProvidersCapability::CAPABILITY);
|
||||||
$crumbs->addAction(
|
|
||||||
id(new PHUIListItemView())
|
|
||||||
->setName(pht('Add Authentication Provider'))
|
|
||||||
->setHref($this->getApplicationURI('/config/new/'))
|
|
||||||
->setDisabled(!$can_create)
|
|
||||||
->setIcon('fa-plus-square'));
|
|
||||||
|
|
||||||
return $crumbs;
|
return $crumbs;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,10 @@ ul.phui-object-item-list-view {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.phui-object-box .phui-object-list-flush .phui-object-item {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.device-phone .phui-object-box
|
.device-phone .phui-object-box
|
||||||
.phui-object-item-list-view.phui-object-list-flush {
|
.phui-object-item-list-view.phui-object-list-flush {
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
|
|
Loading…
Reference in a new issue