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

Migrate DiffusionBlameController to use repo identities

Summary:
Now on the blame page, identities get `avatar.png` and there are little tooltips that show a few characters of the committer identity string.

Also add a default icon for repo identities.

Test Plan: Loaded some blame pages for files touched by users with and without repo identities attached.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D19587
This commit is contained in:
Austin McKinley 2018-08-17 12:24:53 -07:00
parent 021c612cb2
commit 8065433ee8
2 changed files with 3 additions and 4 deletions

View file

@ -118,10 +118,6 @@ final class DiffusionBlameController extends DiffusionController {
$author_phid = $commit->getAuthorDisplayPHID();
}
if (!$author_phid && $revision) {
$author_phid = $revision->getAuthorPHID();
}
if (!$author_phid) {
// This means we couldn't identify an author for the commit or the
// revision. We just render a blank for alignment.
@ -137,6 +133,7 @@ final class DiffusionBlameController extends DiffusionController {
$author_meta = array(
'tip' => $handles[$author_phid]->getName(),
'align' => 'E',
'size' => 'auto',
);
}

View file

@ -30,6 +30,7 @@ final class PhabricatorRepositoryIdentityPHIDType
array $handles,
array $objects) {
$avatar_uri = celerity_get_resource_uri('/rsrc/image/avatar.png');
foreach ($handles as $phid => $handle) {
$identity = $objects[$phid];
@ -40,6 +41,7 @@ final class PhabricatorRepositoryIdentityPHIDType
$handle->setName($name);
$handle->setURI($identity->getURI());
$handle->setIcon('fa-user');
$handle->setImageURI($avatar_uri);
}
}