diff --git a/src/applications/differential/constants/DifferentialChangeType.php b/src/applications/differential/constants/DifferentialChangeType.php --- a/src/applications/differential/constants/DifferentialChangeType.php +++ b/src/applications/differential/constants/DifferentialChangeType.php @@ -38,6 +38,22 @@ return idx($types, coalesce($type, '?'), '~'); } + public static function getSummaryColorForChangeType($type) { + static $types = array( + self::TYPE_ADD => 'green', + self::TYPE_CHANGE => 'black', + self::TYPE_DELETE => 'red', + self::TYPE_MOVE_AWAY => 'orange', + self::TYPE_COPY_AWAY => 'black', + self::TYPE_MOVE_HERE => 'green', + self::TYPE_COPY_HERE => 'green', + self::TYPE_MULTICOPY => 'orange', + self::TYPE_MESSAGE => 'black', + self::TYPE_CHILD => 'black', + ); + return idx($types, coalesce($type, '?'), 'black'); + } + public static function getShortNameForFileType($type) { static $names = array( self::FILE_TEXT => null, diff --git a/src/applications/differential/view/DifferentialDiffTableOfContentsView.php b/src/applications/differential/view/DifferentialDiffTableOfContentsView.php --- a/src/applications/differential/view/DifferentialDiffTableOfContentsView.php +++ b/src/applications/differential/view/DifferentialDiffTableOfContentsView.php @@ -56,6 +56,7 @@ $this->requireResource('differential-core-view-css'); $this->requireResource('differential-table-of-contents-css'); + $this->requireResource('phui-text-css'); $rows = array(); @@ -130,6 +131,7 @@ $char = DifferentialChangeType::getSummaryCharacterForChangeType($type); $chartitle = DifferentialChangeType::getFullNameForChangeType($type); $desc = DifferentialChangeType::getShortNameForFileType($ftype); + $color = DifferentialChangeType::getSummaryColorForChangeType($type); if ($desc) { $desc = '('.$desc.')'; } @@ -170,6 +172,8 @@ $changeset->getAbsoluteRepositoryPath($this->repository, $this->diff); } + $char = phutil_tag('span', array('class' => 'phui-text-'.$color), $char); + $rows[] = array( $char, $pchar,