1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Add user icons / colors for subscriber transactions

Summary: Adds additional icon states for subscriber transactions. Also updated "eraser" to "trash" (man that icon is bad).

Test Plan: add a subscriber, remove a subscriber.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D13800
This commit is contained in:
Chad Little 2015-08-05 12:40:47 -07:00
parent b34dc6164a
commit 2383e741aa

View file

@ -362,11 +362,23 @@ abstract class PhabricatorApplicationTransaction
case PhabricatorTransactions::TYPE_COMMENT:
$comment = $this->getComment();
if ($comment && $comment->getIsRemoved()) {
return 'fa-eraser';
return 'fa-trash';
}
return 'fa-comment';
case PhabricatorTransactions::TYPE_SUBSCRIBERS:
return 'fa-envelope';
$old = $this->getOldValue();
$new = $this->getNewValue();
$add = array_diff($new, $old);
$rem = array_diff($old, $new);
if ($add && $rem) {
return 'fa-user';
} else if ($add) {
return 'fa-user-plus';
} else if ($rem) {
return 'fa-user-times';
} else {
return 'fa-user';
}
case PhabricatorTransactions::TYPE_VIEW_POLICY:
case PhabricatorTransactions::TYPE_EDIT_POLICY:
case PhabricatorTransactions::TYPE_JOIN_POLICY:
@ -416,6 +428,21 @@ abstract class PhabricatorApplicationTransaction
return 'red';
}
break;
case PhabricatorTransactions::TYPE_SUBSCRIBERS:
$old = $this->getOldValue();
$new = $this->getNewValue();
$add = array_diff($new, $old);
$rem = array_diff($old, $new);
if ($add && $rem) {
return 'green';
} else if ($add) {
return 'green';
} else if ($rem) {
return 'black';
} else {
return null;
}
break;
}
return null;
}