mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-27 17:22:42 +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:
parent
2c2eeed65d
commit
58b622852f
1 changed files with 27 additions and 3 deletions
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue