1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-29 08:50:58 +01:00

Update PHUIStatusItemView to FontAwesome

Summary: Changes to using FontAwesome

Test Plan:
Testing UIExamples and each of the pages (except releelph)

{F155942}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9157
This commit is contained in:
Chad Little 2014-05-16 18:59:02 -07:00
parent 43d45c4956
commit 31cd9b2169
12 changed files with 191 additions and 86 deletions

View file

@ -113,7 +113,7 @@ return array(
'rsrc/css/diviner/diviner-shared.css' => '38813222', 'rsrc/css/diviner/diviner-shared.css' => '38813222',
'rsrc/css/font/font-awesome.css' => '73d075c3', 'rsrc/css/font/font-awesome.css' => '73d075c3',
'rsrc/css/font/font-source-sans-pro.css' => '91d53463', 'rsrc/css/font/font-source-sans-pro.css' => '91d53463',
'rsrc/css/font/phui-font-icon-base.css' => '104caddd', 'rsrc/css/font/phui-font-icon-base.css' => '74cfb6a9',
'rsrc/css/layout/phabricator-action-header-view.css' => 'c14dfc57', 'rsrc/css/layout/phabricator-action-header-view.css' => 'c14dfc57',
'rsrc/css/layout/phabricator-action-list-view.css' => 'dcd9875f', 'rsrc/css/layout/phabricator-action-list-view.css' => 'dcd9875f',
'rsrc/css/layout/phabricator-crumbs-view.css' => '6a23399c', 'rsrc/css/layout/phabricator-crumbs-view.css' => '6a23399c',
@ -763,7 +763,7 @@ return array(
'phui-calendar-month-css' => 'a92e47d2', 'phui-calendar-month-css' => 'a92e47d2',
'phui-document-view-css' => '3b078dc0', 'phui-document-view-css' => '3b078dc0',
'phui-feed-story-css' => '3a59c2cf', 'phui-feed-story-css' => '3a59c2cf',
'phui-font-icon-base-css' => '104caddd', 'phui-font-icon-base-css' => '74cfb6a9',
'phui-fontkit-css' => 'de84aa4a', 'phui-fontkit-css' => 'de84aa4a',
'phui-form-css' => 'b78ec020', 'phui-form-css' => 'b78ec020',
'phui-form-view-css' => '867463b4', 'phui-form-view-css' => '867463b4',

View file

@ -43,49 +43,59 @@ final class DifferentialReviewersView extends AphrontView {
switch ($reviewer->getStatus()) { switch ($reviewer->getStatus()) {
case DifferentialReviewerStatus::STATUS_ADDED: case DifferentialReviewerStatus::STATUS_ADDED:
$item->setIcon('open', pht('Review Requested')); $item->setIcon(
PHUIStatusItemView::ICON_OPEN,
'bluegrey',
pht('Review Requested'));
break; break;
case DifferentialReviewerStatus::STATUS_ACCEPTED: case DifferentialReviewerStatus::STATUS_ACCEPTED:
if ($is_current) { if ($is_current) {
$item->setIcon( $item->setIcon(
'accept-green', PHUIStatusItemView::ICON_ACCEPT,
'green',
pht('Accepted')); pht('Accepted'));
} else { } else {
$item->setIcon( $item->setIcon(
'accept-dark', PHUIStatusItemView::ICON_ACCEPT,
'dark',
pht('Accepted Prior Diff')); pht('Accepted Prior Diff'));
} }
break; break;
case DifferentialReviewerStatus::STATUS_ACCEPTED_OLDER: case DifferentialReviewerStatus::STATUS_ACCEPTED_OLDER:
$item->setIcon( $item->setIcon(
'accept-dark', PHUIStatusItemView::ICON_ACCEPT,
'dark',
pht('Accepted Prior Diff')); pht('Accepted Prior Diff'));
break; break;
case DifferentialReviewerStatus::STATUS_REJECTED: case DifferentialReviewerStatus::STATUS_REJECTED:
if ($is_current) { if ($is_current) {
$item->setIcon( $item->setIcon(
'reject-red', PHUIStatusItemView::ICON_REJECT,
'red',
pht('Requested Changes')); pht('Requested Changes'));
} else { } else {
$item->setIcon( $item->setIcon(
'reject-dark', PHUIStatusItemView::ICON_REJECT,
'dark',
pht('Requested Changes to Prior Diff')); pht('Requested Changes to Prior Diff'));
} }
break; break;
case DifferentialReviewerStatus::STATUS_REJECTED_OLDER: case DifferentialReviewerStatus::STATUS_REJECTED_OLDER:
$item->setIcon( $item->setIcon(
'reject-dark', PHUIStatusItemView::ICON_REJECT,
'dark',
pht('Rejected Prior Diff')); pht('Rejected Prior Diff'));
break; break;
case DifferentialReviewerStatus::STATUS_COMMENTED: case DifferentialReviewerStatus::STATUS_COMMENTED:
if ($is_current) { if ($is_current) {
$item->setIcon( $item->setIcon(
'info', PHUIStatusItemView::ICON_INFO,
'bluegrey',
pht('Commented')); pht('Commented'));
} else { } else {
$item->setIcon( $item->setIcon(
@ -95,11 +105,17 @@ final class DifferentialReviewersView extends AphrontView {
break; break;
case DifferentialReviewerStatus::STATUS_BLOCKING: case DifferentialReviewerStatus::STATUS_BLOCKING:
$item->setIcon('minus-red', pht('Blocking Review')); $item->setIcon(
PHUIStatusItemView::ICON_MINUS,
'red',
pht('Blocking Review'));
break; break;
default: default:
$item->setIcon('question', pht('%s?', $reviewer->getStatus())); $item->setIcon(
PHUIStatusItemView::ICON_QUESTION,
'bluegrey',
pht('%s?', $reviewer->getStatus()));
break; break;
} }

View file

@ -1073,32 +1073,57 @@ final class DiffusionCommitController extends DiffusionController {
switch ($request->getAuditStatus()) { switch ($request->getAuditStatus()) {
case PhabricatorAuditStatusConstants::AUDIT_NOT_REQUIRED: case PhabricatorAuditStatusConstants::AUDIT_NOT_REQUIRED:
$item->setIcon('open-blue', pht('Commented')); $item->setIcon(
PHUIStatusItemView::ICON_OPEN,
'blue',
pht('Commented'));
break; break;
case PhabricatorAuditStatusConstants::AUDIT_REQUIRED: case PhabricatorAuditStatusConstants::AUDIT_REQUIRED:
$item->setIcon('warning-blue', pht('Audit Required')); $item->setIcon(
PHUIStatusItemView::ICON_WARNING,
'blue',
pht('Audit Required'));
break; break;
case PhabricatorAuditStatusConstants::CONCERNED: case PhabricatorAuditStatusConstants::CONCERNED:
$item->setIcon('reject-red', pht('Concern Raised')); $item->setIcon(
PHUIStatusItemView::ICON_REJECT,
'red',
pht('Concern Raised'));
break; break;
case PhabricatorAuditStatusConstants::ACCEPTED: case PhabricatorAuditStatusConstants::ACCEPTED:
$item->setIcon('accept-green', pht('Accepted')); $item->setIcon(
PHUIStatusItemView::ICON_ACCEPT,
'green',
pht('Accepted'));
break; break;
case PhabricatorAuditStatusConstants::AUDIT_REQUESTED: case PhabricatorAuditStatusConstants::AUDIT_REQUESTED:
$item->setIcon('warning-dark', pht('Audit Requested')); $item->setIcon(
PHUIStatusItemView::ICON_WARNING,
'dark',
pht('Audit Requested'));
break; break;
case PhabricatorAuditStatusConstants::RESIGNED: case PhabricatorAuditStatusConstants::RESIGNED:
$item->setIcon('open-dark', pht('Resigned')); $item->setIcon(
PHUIStatusItemView::ICON_OPEN,
'dark',
pht('Resigned'));
break; break;
case PhabricatorAuditStatusConstants::CLOSED: case PhabricatorAuditStatusConstants::CLOSED:
$item->setIcon('accept-blue', pht('Closed')); $item->setIcon(
PHUIStatusItemView::ICON_ACCEPT,
'blue',
pht('Closed'));
break; break;
case PhabricatorAuditStatusConstants::CC: case PhabricatorAuditStatusConstants::CC:
$item->setIcon('info-dark', pht('Subscribed')); $item->setIcon(
PHUIStatusItemView::ICON_INFO,
'dark',
pht('Subscribed'));
break; break;
default: default:
$item->setIcon( $item->setIcon(
'question-dark', PHUIStatusItemView::ICON_QUESTION,
'dark',
pht('%s?', $request->getAuditStatus())); pht('%s?', $request->getAuditStatus()));
break; break;
} }

View file

@ -684,12 +684,12 @@ final class DiffusionRepositoryEditMainController
if ($repository->isTracked()) { if ($repository->isTracked()) {
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('accept-green') ->setIcon(PHUIStatusItemView::ICON_ACCEPT, 'green')
->setTarget(pht('Repository Active'))); ->setTarget(pht('Repository Active')));
} else { } else {
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('warning') ->setIcon(PHUIStatusItemView::ICON_WARNING, 'bluegrey')
->setTarget(pht('Repository Inactive')) ->setTarget(pht('Repository Inactive'))
->setNote( ->setNote(
pht('Activate this repository to begin or resume import.'))); pht('Activate this repository to begin or resume import.')));
@ -752,7 +752,7 @@ final class DiffusionRepositoryEditMainController
if (!$where) { if (!$where) {
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('warning-red') ->setIcon(PHUIStatusItemView::ICON_WARNING, 'red')
->setTarget( ->setTarget(
pht('Missing Binary %s', phutil_tag('tt', array(), $binary))) pht('Missing Binary %s', phutil_tag('tt', array(), $binary)))
->setNote(pht( ->setNote(pht(
@ -762,7 +762,7 @@ final class DiffusionRepositoryEditMainController
} else { } else {
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('accept-green') ->setIcon(PHUIStatusItemView::ICON_ACCEPT, 'green')
->setTarget( ->setTarget(
pht('Found Binary %s', phutil_tag('tt', array(), $binary))) pht('Found Binary %s', phutil_tag('tt', array(), $binary)))
->setNote(phutil_tag('tt', array(), $where))); ->setNote(phutil_tag('tt', array(), $where)));
@ -787,7 +787,7 @@ final class DiffusionRepositoryEditMainController
if (!$in_path) { if (!$in_path) {
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('warning-red') ->setIcon(PHUIStatusItemView::ICON_WARNING, 'red')
->setTarget( ->setTarget(
pht('Missing Binary %s', phutil_tag('tt', array(), $binary))) pht('Missing Binary %s', phutil_tag('tt', array(), $binary)))
->setNote(pht( ->setNote(pht(
@ -822,12 +822,12 @@ final class DiffusionRepositoryEditMainController
if ($pull_daemon) { if ($pull_daemon) {
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('accept-green') ->setIcon(PHUIStatusItemView::ICON_ACCEPT, 'green')
->setTarget(pht('Pull Daemon Running'))); ->setTarget(pht('Pull Daemon Running')));
} else { } else {
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('warning-red') ->setIcon(PHUIStatusItemView::ICON_WARNING, 'red')
->setTarget(pht('Pull Daemon Not Running')) ->setTarget(pht('Pull Daemon Not Running'))
->setNote($daemon_instructions)); ->setNote($daemon_instructions));
} }
@ -842,12 +842,12 @@ final class DiffusionRepositoryEditMainController
if ($task_daemon) { if ($task_daemon) {
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('accept-green') ->setIcon(PHUIStatusItemView::ICON_ACCEPT, 'green')
->setTarget(pht('Task Daemon Running'))); ->setTarget(pht('Task Daemon Running')));
} else { } else {
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('warning-red') ->setIcon(PHUIStatusItemView::ICON_WARNING, 'red')
->setTarget(pht('Task Daemon Not Running')) ->setTarget(pht('Task Daemon Not Running'))
->setNote($daemon_instructions)); ->setNote($daemon_instructions));
} }
@ -857,13 +857,13 @@ final class DiffusionRepositoryEditMainController
if (Filesystem::pathExists($local_parent)) { if (Filesystem::pathExists($local_parent)) {
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('accept-green') ->setIcon(PHUIStatusItemView::ICON_ACCEPT, 'green')
->setTarget(pht('Storage Directory OK')) ->setTarget(pht('Storage Directory OK'))
->setNote(phutil_tag('tt', array(), $local_parent))); ->setNote(phutil_tag('tt', array(), $local_parent)));
} else { } else {
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('warning-red') ->setIcon(PHUIStatusItemView::ICON_WARNING, 'red')
->setTarget(pht('No Storage Directory')) ->setTarget(pht('No Storage Directory'))
->setNote( ->setNote(
pht( pht(
@ -880,7 +880,7 @@ final class DiffusionRepositoryEditMainController
case PhabricatorRepositoryStatusMessage::CODE_ERROR: case PhabricatorRepositoryStatusMessage::CODE_ERROR:
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('warning-red') ->setIcon(PHUIStatusItemView::ICON_WARNING, 'red')
->setTarget(pht('Initialization Error')) ->setTarget(pht('Initialization Error'))
->setNote($message->getParameter('message'))); ->setNote($message->getParameter('message')));
return $view; return $view;
@ -888,13 +888,13 @@ final class DiffusionRepositoryEditMainController
if (Filesystem::pathExists($local_path)) { if (Filesystem::pathExists($local_path)) {
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('accept-green') ->setIcon(PHUIStatusItemView::ICON_ACCEPT, 'green')
->setTarget(pht('Working Copy OK')) ->setTarget(pht('Working Copy OK'))
->setNote(phutil_tag('tt', array(), $local_path))); ->setNote(phutil_tag('tt', array(), $local_path)));
} else { } else {
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('warning-red') ->setIcon(PHUIStatusItemView::ICON_WARNING, 'red')
->setTarget(pht('Working Copy Error')) ->setTarget(pht('Working Copy Error'))
->setNote( ->setNote(
pht( pht(
@ -909,14 +909,14 @@ final class DiffusionRepositoryEditMainController
case PhabricatorRepositoryStatusMessage::CODE_WORKING: case PhabricatorRepositoryStatusMessage::CODE_WORKING:
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('time-green') ->setIcon(PHUIStatusItemView::ICON_CLOCK, 'green')
->setTarget(pht('Initializing Working Copy')) ->setTarget(pht('Initializing Working Copy'))
->setNote(pht('Daemons are initializing the working copy.'))); ->setNote(pht('Daemons are initializing the working copy.')));
return $view; return $view;
default: default:
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('warning-red') ->setIcon(PHUIStatusItemView::ICON_WARNING, 'red')
->setTarget(pht('Unknown Init Status')) ->setTarget(pht('Unknown Init Status'))
->setNote($message->getStatusCode())); ->setNote($message->getStatusCode()));
return $view; return $view;
@ -924,7 +924,7 @@ final class DiffusionRepositoryEditMainController
} else { } else {
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('time-orange') ->setIcon(PHUIStatusItemView::ICON_CLOCK, 'orange')
->setTarget(pht('No Working Copy Yet')) ->setTarget(pht('No Working Copy Yet'))
->setNote( ->setNote(
pht('Waiting for daemons to build a working copy.'))); pht('Waiting for daemons to build a working copy.')));
@ -938,14 +938,14 @@ final class DiffusionRepositoryEditMainController
case PhabricatorRepositoryStatusMessage::CODE_ERROR: case PhabricatorRepositoryStatusMessage::CODE_ERROR:
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('warning-red') ->setIcon(PHUIStatusItemView::ICON_WARNING, 'red')
->setTarget(pht('Update Error')) ->setTarget(pht('Update Error'))
->setNote($message->getParameter('message'))); ->setNote($message->getParameter('message')));
return $view; return $view;
case PhabricatorRepositoryStatusMessage::CODE_OKAY: case PhabricatorRepositoryStatusMessage::CODE_OKAY:
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('accept-green') ->setIcon(PHUIStatusItemView::ICON_ACCEPT, 'green')
->setTarget(pht('Updates OK')) ->setTarget(pht('Updates OK'))
->setNote( ->setNote(
pht( pht(
@ -956,7 +956,7 @@ final class DiffusionRepositoryEditMainController
} else { } else {
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('time-orange') ->setIcon(PHUIStatusItemView::ICON_CLOCK, 'orange')
->setTarget(pht('Waiting For Update')) ->setTarget(pht('Waiting For Update'))
->setNote( ->setNote(
pht('Waiting for daemons to read updates.'))); pht('Waiting for daemons to read updates.')));
@ -1005,21 +1005,21 @@ final class DiffusionRepositoryEditMainController
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('time-green') ->setIcon(PHUIStatusItemView::ICON_CLOCK, 'green')
->setTarget(pht('Importing')) ->setTarget(pht('Importing'))
->setNote( ->setNote(
pht('%s Complete', $percentage))); pht('%s Complete', $percentage)));
} else { } else {
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('accept-green') ->setIcon(PHUIStatusItemView::ICON_ACCEPT, 'green')
->setTarget(pht('Fully Imported'))); ->setTarget(pht('Fully Imported')));
} }
if (idx($messages, PhabricatorRepositoryStatusMessage::TYPE_NEEDS_UPDATE)) { if (idx($messages, PhabricatorRepositoryStatusMessage::TYPE_NEEDS_UPDATE)) {
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('up') ->setIcon(PHUIStatusItemView::ICON_UP, 'indigo')
->setTarget(pht('Prioritized')) ->setTarget(pht('Prioritized'))
->setNote(pht('This repository will be updated soon.'))); ->setNote(pht('This repository will be updated soon.')));
} }

View file

@ -252,27 +252,33 @@ final class HarbormasterBuildableViewController
foreach ($targets as $target) { foreach ($targets as $target) {
switch ($target->getTargetStatus()) { switch ($target->getTargetStatus()) {
case HarbormasterBuildTarget::STATUS_PENDING: case HarbormasterBuildTarget::STATUS_PENDING:
$icon = 'time-green'; $icon = PHUIStatusItemView::ICON_CLOCK;
$color = 'green';
$status_name = pht('Pending'); $status_name = pht('Pending');
break; break;
case HarbormasterBuildTarget::STATUS_BUILDING: case HarbormasterBuildTarget::STATUS_BUILDING:
$icon = 'right-green'; $icon = PHUIStatusItemView::ICON_RIGHT;
$color = 'green';
$status_name = pht('Building'); $status_name = pht('Building');
break; break;
case HarbormasterBuildTarget::STATUS_WAITING: case HarbormasterBuildTarget::STATUS_WAITING:
$icon = 'time-orange'; $icon = PHUIStatusItemView::ICON_CLOCK;
$color = 'orange';
$status_name = pht('Waiting'); $status_name = pht('Waiting');
break; break;
case HarbormasterBuildTarget::STATUS_PASSED: case HarbormasterBuildTarget::STATUS_PASSED:
$icon = 'accept-green'; $icon = PHUIStatusItemView::ICON_ACCEPT;
$color = 'green';
$status_name = pht('Passed'); $status_name = pht('Passed');
break; break;
case HarbormasterBuildTarget::STATUS_FAILED: case HarbormasterBuildTarget::STATUS_FAILED:
$icon = 'reject-red'; $icon = PHUIStatusItemView::ICON_REJECT;
$color = 'red';
$status_name = pht('Failed'); $status_name = pht('Failed');
break; break;
default: default:
$icon = 'question'; $icon = PHUIStatusItemView::ICON_QUESTION;
$color = 'bluegrey';
$status_name = pht('Unknown'); $status_name = pht('Unknown');
break; break;
} }
@ -286,7 +292,7 @@ final class HarbormasterBuildableViewController
$target_list->addItem( $target_list->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon($icon, $status_name) ->setIcon($icon, $color, $status_name)
->setTarget(pht('Target %d', $target->getID())) ->setTarget(pht('Target %d', $target->getID()))
->setNote($name)); ->setNote($name));
} }

View file

@ -314,14 +314,16 @@ final class HarbormasterPlanViewController
$bound = phutil_tag('em', array(), pht('(null)')); $bound = phutil_tag('em', array(), pht('(null)'));
if ($is_input) { if ($is_input) {
// This is an unbound input. For now, all inputs are always required. // This is an unbound input. For now, all inputs are always required.
$icon = 'warning-red'; $icon = PHUIStatusItemView::ICON_WARNING;
$color = 'red';
$icon_label = pht('Required Input'); $icon_label = pht('Required Input');
$has_conflicts = true; $has_conflicts = true;
$error = pht('This input is required, but not configured.'); $error = pht('This input is required, but not configured.');
} else { } else {
// This is an unnamed output. Outputs do not necessarily need to be // This is an unnamed output. Outputs do not necessarily need to be
// named. // named.
$icon = 'open'; $icon = PHUIStatusItemView::ICON_OPEN;
$color = 'bluegrey';
$icon_label = pht('Unused Output'); $icon_label = pht('Unused Output');
} }
} else { } else {
@ -329,10 +331,12 @@ final class HarbormasterPlanViewController
if ($is_input) { if ($is_input) {
if (isset($available_artifacts[$key])) { if (isset($available_artifacts[$key])) {
if ($available_artifacts[$key] == idx($artifact, 'type')) { if ($available_artifacts[$key] == idx($artifact, 'type')) {
$icon = 'accept-green'; $icon = PHUIStatusItemView::ICON_ACCEPT;
$color = 'green';
$icon_label = pht('Valid Input'); $icon_label = pht('Valid Input');
} else { } else {
$icon = 'warning-red'; $icon = PHUIStatusItemView::ICON_WARNING;
$color = 'red';
$icon_label = pht('Bad Input Type'); $icon_label = pht('Bad Input Type');
$has_conflicts = true; $has_conflicts = true;
$error = pht( $error = pht(
@ -342,7 +346,8 @@ final class HarbormasterPlanViewController
idx($artifact, 'type')); idx($artifact, 'type'));
} }
} else { } else {
$icon = 'question-red'; $icon = PHUIStatusItemView::ICON_QUESTION;
$color = 'red';
$icon_label = pht('Unknown Input'); $icon_label = pht('Unknown Input');
$has_conflicts = true; $has_conflicts = true;
$error = pht( $error = pht(
@ -351,7 +356,8 @@ final class HarbormasterPlanViewController
$key); $key);
} }
} else { } else {
$icon = 'down-green'; $icon = PHUIStatusItemView::ICON_DOWN;
$color = 'green';
$icon_label = pht('Valid Output'); $icon_label = pht('Valid Output');
} }
} }
@ -367,7 +373,7 @@ final class HarbormasterPlanViewController
$list->addItem( $list->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon($icon, $icon_label) ->setIcon($icon, $color, $icon_label)
->setTarget($artifact['name']) ->setTarget($artifact['name'])
->setNote($note)); ->setNote($note));
} }

View file

@ -77,32 +77,40 @@ final class HarbormasterUIEventListener
switch ($status) { switch ($status) {
case HarbormasterBuild::STATUS_INACTIVE: case HarbormasterBuild::STATUS_INACTIVE:
$icon = 'open-dark'; $icon = PHUIStatusItemView::ICON_OPEN;
$color = 'dark';
break; break;
case HarbormasterBuild::STATUS_PENDING: case HarbormasterBuild::STATUS_PENDING:
$icon = 'open-blue'; $icon = PHUIStatusItemView::ICON_OPEN;
$color = 'blue';
break; break;
case HarbormasterBuild::STATUS_BUILDING: case HarbormasterBuild::STATUS_BUILDING:
$icon = 'right-blue'; $icon = PHUIStatusItemView::ICON_RIGHT;
$color = 'blue';
break; break;
case HarbormasterBuild::STATUS_PASSED: case HarbormasterBuild::STATUS_PASSED:
$icon = 'accept-green'; $icon = PHUIStatusItemView::ICON_ACCEPT;
$color = 'green';
break; break;
case HarbormasterBuild::STATUS_FAILED: case HarbormasterBuild::STATUS_FAILED:
$icon = 'reject-red'; $icon = PHUIStatusItemView::ICON_REJECT;
$color = 'red';
break; break;
case HarbormasterBuild::STATUS_ERROR: case HarbormasterBuild::STATUS_ERROR:
$icon = 'minus-red'; $icon = PHUIStatusItemView::ICON_MINUS;
$color = 'red';
break; break;
case HarbormasterBuild::STATUS_STOPPED: case HarbormasterBuild::STATUS_STOPPED:
$icon = 'minus-dark'; $icon = PHUIStatusItemView::ICON_MINUS;
$color = 'dark';
break; break;
default: default:
$icon = 'question'; $icon = PHUIStatusItemView::ICON_QUESTION;
$color = 'bluegrey';
break; break;
} }
$item->setIcon($icon, $status_name); $item->setIcon($icon, $color, $status_name);
$status_view->addItem($item); $status_view->addItem($item);

View file

@ -117,13 +117,22 @@ final class PhrequentUIEventListener
switch ($state) { switch ($state) {
case 'active': case 'active':
$item->setIcon('time-green', pht('Working Now')); $item->setIcon(
PHUIStatusItemView::ICON_CLOCK,
'green',
pht('Working Now'));
break; break;
case 'suspended': case 'suspended':
$item->setIcon('time-yellow', pht('Interrupted')); $item->setIcon(
PHUIStatusItemView::ICON_CLOCK,
'yellow',
pht('Interrupted'));
break; break;
case 'stopped': case 'stopped':
$item->setIcon('time-orange', pht('Not Working Now')); $item->setIcon(
PHUIStatusItemView::ICON_CLOCK,
'bluegrey',
pht('Not Working Now'));
break; break;
} }

View file

@ -44,15 +44,18 @@ final class ReleephIntentFieldSpecification
foreach ($intents as $phid => $intent) { foreach ($intents as $phid => $intent) {
switch ($intent) { switch ($intent) {
case ReleephRequest::INTENT_WANT: case ReleephRequest::INTENT_WANT:
$icon = 'accept-green'; $icon = PHUIStatusItemView::ICON_ACCEPT;
$color = 'green';
$label = pht('Want'); $label = pht('Want');
break; break;
case ReleephRequest::INTENT_PASS: case ReleephRequest::INTENT_PASS:
$icon = 'reject-red'; $icon = PHUIStatusItemView::ICON_REJECT;
$color = 'red';
$label = pht('Pass'); $label = pht('Pass');
break; break;
default: default:
$icon = 'question'; $icon = PHUIStatusItemView::ICON_QUESTION;
$color = 'bluegrey';
$label = pht('Unknown Intent (%s)', $intent); $label = pht('Unknown Intent (%s)', $intent);
break; break;
} }
@ -64,7 +67,7 @@ final class ReleephIntentFieldSpecification
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon($icon, $label) ->setIcon($icon, $color, $label)
->setTarget($target)); ->setTarget($target));
} }

View file

@ -19,26 +19,26 @@ final class PhabricatorUIStatusExample extends PhabricatorUIExample {
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('accept-green', pht('Yum')) ->setIcon(PHUIStatusItemView::ICON_ACCEPT, 'green', pht('Yum'))
->setTarget(pht('Apple')) ->setTarget(pht('Apple'))
->setNote(pht('You can eat them.'))); ->setNote(pht('You can eat them.')));
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('add-blue', pht('Has Peel')) ->setIcon(PHUIStatusItemView::ICON_ADD, 'blue', pht('Has Peel'))
->setTarget(pht('Banana')) ->setTarget(pht('Banana'))
->setNote(pht('Comes in bunches.')) ->setNote(pht('Comes in bunches.'))
->setHighlighted(true)); ->setHighlighted(true));
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('warning-dark', pht('Caution')) ->setIcon(PHUIStatusItemView::ICON_WARNING, 'dark', pht('Caution'))
->setTarget(pht('Pomegranite')) ->setTarget(pht('Pomegranite'))
->setNote(pht('Lots of seeds. Watch out.'))); ->setNote(pht('Lots of seeds. Watch out.')));
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon('reject-red', pht('Bleh!')) ->setIcon(PHUIStatusItemView::ICON_REJECT, 'red', pht('Bleh!'))
->setTarget(pht('Zucchini')) ->setTarget(pht('Zucchini'))
->setNote(pht('Slimy and gross. Yuck!'))); ->setNote(pht('Slimy and gross. Yuck!')));
@ -54,15 +54,28 @@ final class PhabricatorUIStatusExample extends PhabricatorUIExample {
$view = new PHUIStatusListView(); $view = new PHUIStatusListView();
$manifest = PHUIIconView::getSheetManifest(PHUIIconView::SPRITE_STATUS); $manifest = array(
PHUIStatusItemView::ICON_ACCEPT => 'PHUIStatusItemView::ICON_ACCEPT',
PHUIStatusItemView::ICON_REJECT => 'PHUIStatusItemView::ICON_REJECT',
PHUIStatusItemView::ICON_LEFT => 'PHUIStatusItemView::ICON_LEFT',
PHUIStatusItemView::ICON_RIGHT => 'PHUIStatusItemView::ICON_RIGHT',
PHUIStatusItemView::ICON_UP => 'PHUIStatusItemView::ICON_UP',
PHUIStatusItemView::ICON_DOWN => 'PHUIStatusItemView::ICON_DOWN',
PHUIStatusItemView::ICON_QUESTION => 'PHUIStatusItemView::ICON_QUESTION',
PHUIStatusItemView::ICON_WARNING => 'PHUIStatusItemView::ICON_WARNING',
PHUIStatusItemView::ICON_INFO => 'PHUIStatusItemView::ICON_INFO',
PHUIStatusItemView::ICON_ADD => 'PHUIStatusItemView::ICON_ADD',
PHUIStatusItemView::ICON_MINUS => 'PHUIStatusItemView::ICON_MINUS',
PHUIStatusItemView::ICON_OPEN => 'PHUIStatusItemView::ICON_OPEN',
PHUIStatusItemView::ICON_CLOCK => 'PHUIStatusItemView::ICON_CLOCK',
);
foreach ($manifest as $sprite) { foreach ($manifest as $icon => $label) {
$name = substr($sprite['name'], strlen('status-'));
$view->addItem( $view->addItem(
id(new PHUIStatusItemView()) id(new PHUIStatusItemView())
->setIcon($name) ->setIcon($icon, 'indigo')
->setTarget($name)); ->setTarget($label));
} }
$out[] = id(new PHUIHeaderView()) $out[] = id(new PHUIHeaderView())

View file

@ -4,13 +4,30 @@ final class PHUIStatusItemView extends AphrontTagView {
private $icon; private $icon;
private $iconLabel; private $iconLabel;
private $iconColor;
private $target; private $target;
private $note; private $note;
private $highlighted; private $highlighted;
public function setIcon($icon, $label = null) { const ICON_ACCEPT = 'fa-check-circle';
const ICON_REJECT = 'fa-times-circle';
const ICON_LEFT = 'fa-chevron-circle-left';
const ICON_RIGHT = 'fa-chevron-circle-right';
const ICON_UP = 'fa-chevron-circle-up';
const ICON_DOWN = 'fa-chevron-circle-down';
const ICON_QUESTION = 'fa-question-circle';
const ICON_WARNING = 'fa-exclamation-circle';
const ICON_INFO = 'fa-info-circle';
const ICON_ADD = 'fa-plus-circle';
const ICON_MINUS = 'fa-minus-circle';
const ICON_OPEN = 'fa-circle-o';
const ICON_CLOCK = 'fa-clock-o';
/* render_textarea */
public function setIcon($icon, $color = null, $label = null) {
$this->icon = $icon; $this->icon = $icon;
$this->iconLabel = $label; $this->iconLabel = $label;
$this->iconColor = $color;
return $this; return $this;
} }
@ -53,8 +70,7 @@ final class PHUIStatusItemView extends AphrontTagView {
$icon = null; $icon = null;
if ($this->icon) { if ($this->icon) {
$icon = id(new PHUIIconView()) $icon = id(new PHUIIconView())
->setSpriteSheet(PHUIIconView::SPRITE_STATUS) ->setIconFont($this->icon.' '.$this->iconColor);
->setSpriteIcon($this->icon);
if ($this->iconLabel) { if ($this->iconLabel) {
Javelin::initBehavior('phabricator-tooltips'); Javelin::initBehavior('phabricator-tooltips');

View file

@ -104,6 +104,9 @@
} }
} }
.phui-icon-view.dark {
color: {$darkgreytext};
}
.phui-icon-view.bluegrey { .phui-icon-view.bluegrey {
color: #7787a6; color: #7787a6;
} }