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:
Chad Little
2015-01-06 11:13:04 -08:00
parent b2e71bcb70
commit 3e421c7450
9 changed files with 41 additions and 30 deletions

View File

@@ -72,10 +72,17 @@ final class PhabricatorDashboardPanelViewController
private function buildHeaderView(PhabricatorDashboardPanel $panel) { private function buildHeaderView(PhabricatorDashboardPanel $panel) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getRequest()->getUser();
return id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setUser($viewer) ->setUser($viewer)
->setHeader($panel->getName()) ->setHeader($panel->getName())
->setPolicyObject($panel); ->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) { private function buildActionView(PhabricatorDashboardPanel $panel) {
@@ -101,10 +108,10 @@ final class PhabricatorDashboardPanelViewController
if (!$panel->getIsArchived()) { if (!$panel->getIsArchived()) {
$archive_text = pht('Archive Panel'); $archive_text = pht('Archive Panel');
$archive_icon = 'fa-times'; $archive_icon = 'fa-ban';
} else { } else {
$archive_text = pht('Activate Panel'); $archive_text = pht('Activate Panel');
$archive_icon = 'fa-plus'; $archive_icon = 'fa-check';
} }
$actions->addAction( $actions->addAction(

View File

@@ -52,13 +52,13 @@ final class HeraldDisableController extends HeraldController {
} }
if ($is_disable) { if ($is_disable) {
$title = pht('Really disable this rule?'); $title = pht('Really archive this rule?');
$body = pht('This rule will no longer activate.'); $body = pht('This rule will no longer activate.');
$button = pht('Disable Rule'); $button = pht('Archive Rule');
} else { } else {
$title = pht('Really enable this rule?'); $title = pht('Really activate this rule?');
$body = pht('This rule will become active again.'); $body = pht('This rule will become active again.');
$button = pht('Enable Rule'); $button = pht('Activate Rule');
} }
$dialog = id(new AphrontDialogView()) $dialog = id(new AphrontDialogView())

View File

@@ -29,8 +29,8 @@ final class HeraldRuleViewController extends HeraldController {
if ($rule->getIsDisabled()) { if ($rule->getIsDisabled()) {
$header->setStatus( $header->setStatus(
'fa-ban', 'fa-ban',
'dark', 'red',
pht('Disabled')); pht('Archived'));
} else { } else {
$header->setStatus( $header->setStatus(
'fa-check', 'fa-check',
@@ -90,12 +90,12 @@ final class HeraldRuleViewController extends HeraldController {
if ($rule->getIsDisabled()) { if ($rule->getIsDisabled()) {
$disable_uri = "disable/{$id}/enable/"; $disable_uri = "disable/{$id}/enable/";
$disable_icon = 'fa-check-circle-o'; $disable_icon = 'fa-check';
$disable_name = pht('Enable Rule'); $disable_name = pht('Activate Rule');
} else { } else {
$disable_uri = "disable/{$id}/disable/"; $disable_uri = "disable/{$id}/disable/";
$disable_icon = 'fa-ban'; $disable_icon = 'fa-ban';
$disable_name = pht('Disable Rule'); $disable_name = pht('Archive Rule');
} }
$view->addAction( $view->addAction(

View File

@@ -57,9 +57,9 @@ final class HeraldRuleTransaction
switch ($this->getTransactionType()) { switch ($this->getTransactionType()) {
case self::TYPE_DISABLE: case self::TYPE_DISABLE:
if ($new) { if ($new) {
return 'fa-pause'; return 'fa-ban';
} else { } else {
return 'fa-play'; return 'fa-check';
} }
} }

View File

@@ -60,12 +60,10 @@ final class PhabricatorMacroViewController
->setPolicyObject($macro) ->setPolicyObject($macro)
->setHeader($title_long); ->setHeader($title_long);
if ($macro->getIsDisabled()) { if (!$macro->getIsDisabled()) {
$header->addTag( $header->setStatus('fa-check', 'bluegrey', pht('Active'));
id(new PHUITagView()) } else {
->setType(PHUITagView::TYPE_STATE) $header->setStatus('fa-ban', 'red', pht('Archived'));
->setName(pht('Macro Disabled'))
->setBackgroundColor(PHUITagView::COLOR_BLACK));
} }
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
@@ -132,15 +130,15 @@ final class PhabricatorMacroViewController
if ($macro->getIsDisabled()) { if ($macro->getIsDisabled()) {
$view->addAction( $view->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName(pht('Restore Macro')) ->setName(pht('Activate Macro'))
->setHref($this->getApplicationURI('/disable/'.$macro->getID().'/')) ->setHref($this->getApplicationURI('/disable/'.$macro->getID().'/'))
->setWorkflow(true) ->setWorkflow(true)
->setDisabled(!$can_manage) ->setDisabled(!$can_manage)
->setIcon('fa-check-circle-o')); ->setIcon('fa-check'));
} else { } else {
$view->addAction( $view->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName(pht('Disable Macro')) ->setName(pht('Archive Macro'))
->setHref($this->getApplicationURI('/disable/'.$macro->getID().'/')) ->setHref($this->getApplicationURI('/disable/'.$macro->getID().'/'))
->setWorkflow(true) ->setWorkflow(true)
->setDisabled(!$can_manage) ->setDisabled(!$can_manage)

View File

@@ -47,6 +47,12 @@ final class PonderQuestionViewController extends PonderController {
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader($question->getTitle()); ->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); $actions = $this->buildActionListView($question);
$properties = $this->buildPropertyListView($question, $actions); $properties = $this->buildPropertyListView($question, $actions);
@@ -100,11 +106,11 @@ final class PonderQuestionViewController extends PonderController {
if ($question->getStatus() == PonderQuestionStatus::STATUS_OPEN) { if ($question->getStatus() == PonderQuestionStatus::STATUS_OPEN) {
$name = pht('Close Question'); $name = pht('Close Question');
$icon = 'fa-times'; $icon = 'fa-check-square-o';
$href = 'close'; $href = 'close';
} else { } else {
$name = pht('Reopen Question'); $name = pht('Reopen Question');
$icon = 'fa-check-circle-o'; $icon = 'fa-square-o';
$href = 'open'; $href = 'open';
} }

View File

@@ -52,9 +52,9 @@ final class PhabricatorProjectArchiveController
} }
if ($project->isArchived()) { if ($project->isArchived()) {
$title = pht('Really unarchive project?'); $title = pht('Really activate project?');
$body = pht('This project will become active again.'); $body = pht('This project will become active again.');
$button = pht('Unarchive Project'); $button = pht('Activate Project');
} else { } else {
$title = pht('Really archive project?'); $title = pht('Really archive project?');
$body = pht('This project will be moved to the archive.'); $body = pht('This project will be moved to the archive.');

View File

@@ -37,7 +37,7 @@ final class PhabricatorProjectEditMainController
if ($project->getStatus() == PhabricatorProjectStatus::STATUS_ACTIVE) { if ($project->getStatus() == PhabricatorProjectStatus::STATUS_ACTIVE) {
$header->setStatus('fa-check', 'bluegrey', pht('Active')); $header->setStatus('fa-check', 'bluegrey', pht('Active'));
} else { } else {
$header->setStatus('fa-ban', 'dark', pht('Archived')); $header->setStatus('fa-ban', 'red', pht('Archived'));
} }
$actions = $this->buildActionListView($project); $actions = $this->buildActionListView($project);
@@ -104,7 +104,7 @@ final class PhabricatorProjectEditMainController
if ($project->isArchived()) { if ($project->isArchived()) {
$view->addAction( $view->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName(pht('Unarchive Project')) ->setName(pht('Activate Project'))
->setIcon('fa-check') ->setIcon('fa-check')
->setHref($this->getApplicationURI("archive/{$id}/")) ->setHref($this->getApplicationURI("archive/{$id}/"))
->setDisabled(!$can_edit) ->setDisabled(!$can_edit)

View File

@@ -80,7 +80,7 @@ final class PhabricatorProjectProfileController
if ($project->getStatus() == PhabricatorProjectStatus::STATUS_ACTIVE) { if ($project->getStatus() == PhabricatorProjectStatus::STATUS_ACTIVE) {
$header->setStatus('fa-check', 'bluegrey', pht('Active')); $header->setStatus('fa-check', 'bluegrey', pht('Active'));
} else { } else {
$header->setStatus('fa-ban', 'dark', pht('Archived')); $header->setStatus('fa-ban', 'red', pht('Archived'));
} }
$actions = $this->buildActionListView($project); $actions = $this->buildActionListView($project);