1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 21:40:55 +01:00

Audit - tweak colors

Summary: See github issue 413. This diff adds color to the commit view as the user expects *AND* adds green to both audit and commit views. I looked in the history (D6184) and I can't tell how expected green was, but it feels nice to me given differential color coding.

Test Plan: looked at lists of audits and commits with pretty colors.

Reviewers: epriestley, chad

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D7900
This commit is contained in:
Bob Trahan 2014-01-06 16:07:47 -08:00
parent 46139bd1f6
commit db778cb3e3
3 changed files with 27 additions and 1 deletions

View file

@ -31,4 +31,23 @@ final class PhabricatorAuditCommitStatusConstants {
);
}
public static function getStatusColor($code) {
switch ($code) {
case self::CONCERN_RAISED:
$color = 'red';
break;
case self::NEEDS_AUDIT:
case self::PARTIALLY_AUDITED:
$color = 'orange';
break;
case self::FULLY_AUDITED:
$color = 'green';
break;
default:
$color = null;
break;
}
return $color;
}
}

View file

@ -40,6 +40,9 @@ final class PhabricatorAuditStatusConstants {
case self::AUDIT_REQUIRED:
$color = 'orange';
break;
case self::ACCEPTED:
$color = 'green';
break;
default:
$color = null;
break;

View file

@ -88,10 +88,14 @@ final class PhabricatorAuditCommitListView extends AphrontView {
$auditors = phutil_implode_html(', ', $auditors);
}
$committed = phabricator_datetime($commit->getEpoch(), $this->user);
$audit_status = $commit->getAuditStatus();
$commit_status = PhabricatorAuditCommitStatusConstants::getStatusName(
$commit->getAuditStatus());
$audit_status);
$status_color = PhabricatorAuditCommitStatusConstants::getStatusColor(
$audit_status);
$item = id(new PHUIObjectItemView())
->setBarColor($status_color)
->setObjectName($commit_name)
->setHeader($commit_desc)
->setHref($commit_link)