mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-20 13:52:40 +01:00
Normalize 'Archived' states in object headers
Summary: Quick pass at cleaning up language, icons, colors for 'Archive' and 'Activate' on various objects. Test Plan: Tested archiving and activating each object changed. {F262694} {F262697} Reviewers: btrahan, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Differential Revision: https://secure.phabricator.com/D11256
This commit is contained in:
parent
b2e71bcb70
commit
3e421c7450
9 changed files with 41 additions and 30 deletions
|
@ -72,10 +72,17 @@ final class PhabricatorDashboardPanelViewController
|
|||
private function buildHeaderView(PhabricatorDashboardPanel $panel) {
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
|
||||
return id(new PHUIHeaderView())
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setUser($viewer)
|
||||
->setHeader($panel->getName())
|
||||
->setPolicyObject($panel);
|
||||
|
||||
if (!$panel->getIsArchived()) {
|
||||
$header->setStatus('fa-check', 'bluegrey', pht('Active'));
|
||||
} else {
|
||||
$header->setStatus('fa-ban', 'red', pht('Archived'));
|
||||
}
|
||||
return $header;
|
||||
}
|
||||
|
||||
private function buildActionView(PhabricatorDashboardPanel $panel) {
|
||||
|
@ -101,10 +108,10 @@ final class PhabricatorDashboardPanelViewController
|
|||
|
||||
if (!$panel->getIsArchived()) {
|
||||
$archive_text = pht('Archive Panel');
|
||||
$archive_icon = 'fa-times';
|
||||
$archive_icon = 'fa-ban';
|
||||
} else {
|
||||
$archive_text = pht('Activate Panel');
|
||||
$archive_icon = 'fa-plus';
|
||||
$archive_icon = 'fa-check';
|
||||
}
|
||||
|
||||
$actions->addAction(
|
||||
|
|
|
@ -52,13 +52,13 @@ final class HeraldDisableController extends HeraldController {
|
|||
}
|
||||
|
||||
if ($is_disable) {
|
||||
$title = pht('Really disable this rule?');
|
||||
$title = pht('Really archive this rule?');
|
||||
$body = pht('This rule will no longer activate.');
|
||||
$button = pht('Disable Rule');
|
||||
$button = pht('Archive Rule');
|
||||
} else {
|
||||
$title = pht('Really enable this rule?');
|
||||
$title = pht('Really activate this rule?');
|
||||
$body = pht('This rule will become active again.');
|
||||
$button = pht('Enable Rule');
|
||||
$button = pht('Activate Rule');
|
||||
}
|
||||
|
||||
$dialog = id(new AphrontDialogView())
|
||||
|
|
|
@ -29,8 +29,8 @@ final class HeraldRuleViewController extends HeraldController {
|
|||
if ($rule->getIsDisabled()) {
|
||||
$header->setStatus(
|
||||
'fa-ban',
|
||||
'dark',
|
||||
pht('Disabled'));
|
||||
'red',
|
||||
pht('Archived'));
|
||||
} else {
|
||||
$header->setStatus(
|
||||
'fa-check',
|
||||
|
@ -90,12 +90,12 @@ final class HeraldRuleViewController extends HeraldController {
|
|||
|
||||
if ($rule->getIsDisabled()) {
|
||||
$disable_uri = "disable/{$id}/enable/";
|
||||
$disable_icon = 'fa-check-circle-o';
|
||||
$disable_name = pht('Enable Rule');
|
||||
$disable_icon = 'fa-check';
|
||||
$disable_name = pht('Activate Rule');
|
||||
} else {
|
||||
$disable_uri = "disable/{$id}/disable/";
|
||||
$disable_icon = 'fa-ban';
|
||||
$disable_name = pht('Disable Rule');
|
||||
$disable_name = pht('Archive Rule');
|
||||
}
|
||||
|
||||
$view->addAction(
|
||||
|
|
|
@ -57,9 +57,9 @@ final class HeraldRuleTransaction
|
|||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_DISABLE:
|
||||
if ($new) {
|
||||
return 'fa-pause';
|
||||
return 'fa-ban';
|
||||
} else {
|
||||
return 'fa-play';
|
||||
return 'fa-check';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,12 +60,10 @@ final class PhabricatorMacroViewController
|
|||
->setPolicyObject($macro)
|
||||
->setHeader($title_long);
|
||||
|
||||
if ($macro->getIsDisabled()) {
|
||||
$header->addTag(
|
||||
id(new PHUITagView())
|
||||
->setType(PHUITagView::TYPE_STATE)
|
||||
->setName(pht('Macro Disabled'))
|
||||
->setBackgroundColor(PHUITagView::COLOR_BLACK));
|
||||
if (!$macro->getIsDisabled()) {
|
||||
$header->setStatus('fa-check', 'bluegrey', pht('Active'));
|
||||
} else {
|
||||
$header->setStatus('fa-ban', 'red', pht('Archived'));
|
||||
}
|
||||
|
||||
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
|
||||
|
@ -132,15 +130,15 @@ final class PhabricatorMacroViewController
|
|||
if ($macro->getIsDisabled()) {
|
||||
$view->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Restore Macro'))
|
||||
->setName(pht('Activate Macro'))
|
||||
->setHref($this->getApplicationURI('/disable/'.$macro->getID().'/'))
|
||||
->setWorkflow(true)
|
||||
->setDisabled(!$can_manage)
|
||||
->setIcon('fa-check-circle-o'));
|
||||
->setIcon('fa-check'));
|
||||
} else {
|
||||
$view->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Disable Macro'))
|
||||
->setName(pht('Archive Macro'))
|
||||
->setHref($this->getApplicationURI('/disable/'.$macro->getID().'/'))
|
||||
->setWorkflow(true)
|
||||
->setDisabled(!$can_manage)
|
||||
|
|
|
@ -47,6 +47,12 @@ final class PonderQuestionViewController extends PonderController {
|
|||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($question->getTitle());
|
||||
|
||||
if ($question->getStatus() == PonderQuestionStatus::STATUS_OPEN) {
|
||||
$header->setStatus('fa-square-o', 'bluegrey', pht('Open'));
|
||||
} else {
|
||||
$header->setStatus('fa-check-square-o', 'dark', pht('Closed'));
|
||||
}
|
||||
|
||||
$actions = $this->buildActionListView($question);
|
||||
$properties = $this->buildPropertyListView($question, $actions);
|
||||
|
||||
|
@ -100,11 +106,11 @@ final class PonderQuestionViewController extends PonderController {
|
|||
|
||||
if ($question->getStatus() == PonderQuestionStatus::STATUS_OPEN) {
|
||||
$name = pht('Close Question');
|
||||
$icon = 'fa-times';
|
||||
$icon = 'fa-check-square-o';
|
||||
$href = 'close';
|
||||
} else {
|
||||
$name = pht('Reopen Question');
|
||||
$icon = 'fa-check-circle-o';
|
||||
$icon = 'fa-square-o';
|
||||
$href = 'open';
|
||||
}
|
||||
|
||||
|
|
|
@ -52,9 +52,9 @@ final class PhabricatorProjectArchiveController
|
|||
}
|
||||
|
||||
if ($project->isArchived()) {
|
||||
$title = pht('Really unarchive project?');
|
||||
$title = pht('Really activate project?');
|
||||
$body = pht('This project will become active again.');
|
||||
$button = pht('Unarchive Project');
|
||||
$button = pht('Activate Project');
|
||||
} else {
|
||||
$title = pht('Really archive project?');
|
||||
$body = pht('This project will be moved to the archive.');
|
||||
|
|
|
@ -37,7 +37,7 @@ final class PhabricatorProjectEditMainController
|
|||
if ($project->getStatus() == PhabricatorProjectStatus::STATUS_ACTIVE) {
|
||||
$header->setStatus('fa-check', 'bluegrey', pht('Active'));
|
||||
} else {
|
||||
$header->setStatus('fa-ban', 'dark', pht('Archived'));
|
||||
$header->setStatus('fa-ban', 'red', pht('Archived'));
|
||||
}
|
||||
|
||||
$actions = $this->buildActionListView($project);
|
||||
|
@ -104,7 +104,7 @@ final class PhabricatorProjectEditMainController
|
|||
if ($project->isArchived()) {
|
||||
$view->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Unarchive Project'))
|
||||
->setName(pht('Activate Project'))
|
||||
->setIcon('fa-check')
|
||||
->setHref($this->getApplicationURI("archive/{$id}/"))
|
||||
->setDisabled(!$can_edit)
|
||||
|
|
|
@ -80,7 +80,7 @@ final class PhabricatorProjectProfileController
|
|||
if ($project->getStatus() == PhabricatorProjectStatus::STATUS_ACTIVE) {
|
||||
$header->setStatus('fa-check', 'bluegrey', pht('Active'));
|
||||
} else {
|
||||
$header->setStatus('fa-ban', 'dark', pht('Archived'));
|
||||
$header->setStatus('fa-ban', 'red', pht('Archived'));
|
||||
}
|
||||
|
||||
$actions = $this->buildActionListView($project);
|
||||
|
|
Loading…
Reference in a new issue