1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 23:02:42 +01:00

Add colors to Maniphest transactions

Summary:
Add colors to Maniphest transactions. The precedence of the css
classes is determined by their occurrences in the css file. The class
shows up latter overrides the ones above it.

Test Plan:
set a task to different statuses to verify that the colors
are set.

Reviewed By: epriestley
Reviewers: epriestley
CC: jungejason, epriestley
Differential Revision: 55
This commit is contained in:
jungejason 2011-03-07 15:28:44 -08:00
parent 71605e1c2d
commit 1530092c44
2 changed files with 51 additions and 3 deletions

View file

@ -98,7 +98,7 @@ class ManiphestTransactionDetailView extends AphrontView {
} }
$descs = implode('<br />', $descs); $descs = implode('<br />', $descs);
$more_classes = implode(' ', $classes); $more_classes = implode(' ', $more_classes);
if ($comment_transaction && $comment_transaction->hasComments()) { if ($comment_transaction && $comment_transaction->hasComments()) {
$comments = $comment_transaction->getCache(); $comments = $comment_transaction->getCache();
@ -167,18 +167,22 @@ class ManiphestTransactionDetailView extends AphrontView {
if ($transaction->getAuthorPHID() == $new) { if ($transaction->getAuthorPHID() == $new) {
$verb = 'Claimed'; $verb = 'Claimed';
$desc = 'claimed this task'; $desc = 'claimed this task';
$classes[] = 'claimed';
} else if (!$new) { } else if (!$new) {
$verb = 'Up For Grabs'; $verb = 'Up For Grabs';
$desc = 'placed this task up for grabs'; $desc = 'placed this task up for grabs';
$classes[] = 'upforgrab';
} else if (!$old) { } else if (!$old) {
$verb = 'Assigned'; $verb = 'Assigned';
$desc = 'assigned this task to '.$this->renderHandles(array($new)); $desc = 'assigned this task to '.$this->renderHandles(array($new));
$classes[] = 'assigned';
} else { } else {
$verb = 'Reassigned'; $verb = 'Reassigned';
$desc = 'reassigned this task from '. $desc = 'reassigned this task from '.
$this->renderHandles(array($old)). $this->renderHandles(array($old)).
' to '. ' to '.
$this->renderHandles(array($new)); $this->renderHandles(array($new));
$classes[] = 'reassigned';
} }
break; break;
case ManiphestTransactionType::TYPE_CCS: case ManiphestTransactionType::TYPE_CCS:
@ -232,17 +236,21 @@ class ManiphestTransactionDetailView extends AphrontView {
if ($old) { if ($old) {
$verb = 'Reopened'; $verb = 'Reopened';
$desc = 'reopened this task'; $desc = 'reopened this task';
$classes[] = 'reopened';
} else { } else {
$verb = 'Created'; $verb = 'Created';
$desc = 'created this task'; $desc = 'created this task';
$classes[] = 'created';
} }
} else if ($new == ManiphestTaskStatus::STATUS_CLOSED_SPITE) { } else if ($new == ManiphestTaskStatus::STATUS_CLOSED_SPITE) {
$verb = 'Spited'; $verb = 'Spited';
$desc = 'closed this task out of spite'; $desc = 'closed this task out of spite';
$classes[] = 'spited';
} else { } else {
$verb = 'Closed'; $verb = 'Closed';
$full = idx(ManiphestTaskStatus::getTaskStatusMap(), $new, '???'); $full = idx(ManiphestTaskStatus::getTaskStatusMap(), $new, '???');
$desc = 'closed this task as "'.$full.'"'; $desc = 'closed this task as "'.$full.'"';
$classes[] = 'closed';
} }
break; break;
case ManiphestTransactionType::TYPE_PRIORITY: case ManiphestTransactionType::TYPE_PRIORITY:
@ -261,6 +269,9 @@ class ManiphestTransactionDetailView extends AphrontView {
$desc = 'raised the priority of this task from "'.$old_name.'" to '. $desc = 'raised the priority of this task from "'.$old_name.'" to '.
'"'.$new_name.'"'; '"'.$new_name.'"';
} }
if ($new == ManiphestTaskPriority::PRIORITY_UNBREAK_NOW) {
$classes[] = 'unbreaknow';
}
break; break;
case ManiphestTransactionType::TYPE_ATTACH: case ManiphestTransactionType::TYPE_ATTACH:
$old_raw = nonempty($old, array()); $old_raw = nonempty($old, array());

View file

@ -8,6 +8,42 @@
min-height: 50px; min-height: 50px;
} }
.maniphest-transaction-detail-container .upforgrab {
border-color: #cc9966;
}
.maniphest-transaction-detail-container .reassigned {
border-color: #0099aa;
}
.maniphest-transaction-detail-container .assigned {
border-color: #0099aa;
}
.maniphest-transaction-detail-container .claimed {
border-color: #0099aa;
}
.maniphest-transaction-detail-container .created {
border-color: #660099;
}
.maniphest-transaction-detail-container .closed {
border-color: #006699;
}
.maniphest-transaction-detail-container .spited {
border-color: #006699;
}
.maniphest-transaction-detail-container .reopened {
border-color: #660099;
}
.maniphest-transaction-detail-container .unbreaknow {
border-color: #aa0000;
}
.maniphest-transaction-header { .maniphest-transaction-header {
background: #e6e6e6; background: #e6e6e6;
padding: 4px 1em; padding: 4px 1em;
@ -19,8 +55,9 @@
.maniphest-transaction-detail-view { .maniphest-transaction-detail-view {
margin-left: 54px; margin-left: 54px;
border: 1px solid #bbbbbb; border-color: #bbbbbb;
border-width: 1px 0 0; border-width: 1px 10px;
border-style: solid;
min-height: 40px; min-height: 40px;
} }