1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-24 07:42:40 +01:00

Fix Up Paste transactions

Summary: We're using the wrong constants here, bad copy and paste job. Also add colors, icons.

Test Plan: Archive a Paste, check transactions.

Reviewers: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D13817
This commit is contained in:
Chad Little 2015-08-06 18:44:54 -07:00
parent 2c2eeed65d
commit 58b622852f

View file

@ -55,6 +55,15 @@ final class PhabricatorPasteTransaction
case self::TYPE_LANGUAGE: case self::TYPE_LANGUAGE:
return 'fa-pencil'; return 'fa-pencil';
break; break;
case self::TYPE_STATUS:
$new = $this->getNewValue();
switch ($new) {
case PhabricatorPaste::STATUS_ACTIVE:
return 'fa-check';
case PhabricatorPaste::STATUS_ARCHIVED:
return 'fa-ban';
}
break;
} }
return parent::getIcon(); return parent::getIcon();
} }
@ -91,9 +100,16 @@ final class PhabricatorPasteTransaction
$this->renderHandleLink($author_phid)); $this->renderHandleLink($author_phid));
break; break;
case self::TYPE_STATUS: case self::TYPE_STATUS:
return pht( switch ($new) {
"%s updated the paste's status.", case PhabricatorPaste::STATUS_ACTIVE:
$this->renderHandleLink($author_phid)); return pht(
'%s activated this paste.',
$this->renderHandleLink($author_phid));
case PhabricatorPaste::STATUS_ARCHIVED:
return pht(
'%s archived this paste.',
$this->renderHandleLink($author_phid));
}
break; break;
} }
@ -161,6 +177,14 @@ final class PhabricatorPasteTransaction
switch ($this->getTransactionType()) { switch ($this->getTransactionType()) {
case self::TYPE_CONTENT: case self::TYPE_CONTENT:
return PhabricatorTransactions::COLOR_GREEN; return PhabricatorTransactions::COLOR_GREEN;
case self::TYPE_STATUS:
switch ($new) {
case PhabricatorPaste::STATUS_ACTIVE:
return 'green';
case PhabricatorPaste::STATUS_ARCHIVED:
return 'indigo';
}
break;
} }
return parent::getColor(); return parent::getColor();