mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42: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:
parent
9d19a0a8b1
commit
6e1f5e353a
1 changed files with 15 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue