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

Abbreviate author/committer in Diffusion directory views

Summary:
The tables are currently kind of wide, and the emails for
non-recognized users seem like the least useful parts, so I put them in
tooltips so they're only visible if you want them. On the other hand, it
means you can only view one at a time, and if you're on mobile you can't
see them at all. Overall, not sure whether this is a good idea.

Test Plan:
Load Diffusion pages with some recognized and some
unrecognized users. Hover over the latter and see that emails appear.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3123
This commit is contained in:
Alan Huang 2012-08-01 14:59:32 -07:00
parent 9d19a0a8b1
commit 6e1f5e353a

View file

@ -33,6 +33,19 @@ final class DiffusionBrowseTableView extends DiffusionView {
return $this;
}
private static function renderName($name) {
$email = new PhutilEmailAddress($name);
if ($email->getDisplayName() || $email->getDomainName()) {
return phutil_render_tag(
'span',
array(
'title' => $email->getAddress(),
),
phutil_escape_html($email->getDisplayName()));
}
return phutil_escape_html($name);
}
public static function renderLastModifiedColumns(
PhabricatorRepository $repository,
array $handles,
@ -58,7 +71,7 @@ final class DiffusionBrowseTableView extends DiffusionView {
if ($author_phid && isset($handles[$author_phid])) {
$author = $handles[$author_phid]->renderLink();
} else {
$author = phutil_escape_html($data->getAuthorName());
$author = self::renderName($data->getAuthorName());
}
$committer = $data->getCommitDetail('committer');
@ -67,7 +80,7 @@ final class DiffusionBrowseTableView extends DiffusionView {
if ($committer_phid && isset($handles[$committer_phid])) {
$committer = $handles[$committer_phid]->renderLink();
} else {
$committer = phutil_escape_html($data->getCommitDetail('committer'));
$committer = self::renderName($data->getCommitDetail('committer'));
}
} else {
$committer = $author;