Page MenuHomePhabricator

D18290.id43983.diff
No OneTemporary

D18290.id43983.diff

diff --git a/src/applications/diffusion/view/DiffusionTagListView.php b/src/applications/diffusion/view/DiffusionTagListView.php
--- a/src/applications/diffusion/view/DiffusionTagListView.php
+++ b/src/applications/diffusion/view/DiffusionTagListView.php
@@ -52,24 +52,12 @@
'commit' => $tag->getCommitIdentifier(),
));
- $author = null;
- if ($commit && $commit->getAuthorPHID()) {
- $author = $this->handles[$commit->getAuthorPHID()]->renderLink();
- } else if ($commit && $commit->getCommitData()) {
- $author = self::renderName($commit->getCommitData()->getAuthorName());
+ if ($commit) {
+ $author = $this->renderAuthor($tag, $commit);
} else {
- $author = self::renderName($tag->getAuthor());
+ $author = null;
}
- $committed = phabricator_datetime($commit->getEpoch(), $viewer);
- $author_name = phutil_tag(
- 'strong',
- array(
- 'class' => 'diffusion-history-author-name',
- ),
- $author);
- $authored = pht('%s on %s.', $author_name, $committed);
-
$description = null;
if ($tag->getType() == 'git/tag') {
// In Git, a tag may be a "real" tag, or just a reference to a commit.
@@ -139,16 +127,43 @@
->setHref($tag_href)
->addAttribute(array($commit_tag))
->addAttribute($description)
- ->addAttribute($authored)
->setSideColumn(array(
$build_view,
$button_bar,
));
+ if ($author) {
+ $item->addAttribute($author);
+ }
+
$list->addItem($item);
}
return $list;
}
+ private function renderAuthor(
+ DiffusionRepositoryTag $tag,
+ PhabricatorRepositoryCommit $commit) {
+ $viewer = $this->getViewer();
+
+ if ($commit->getAuthorPHID()) {
+ $author = $this->handles[$commit->getAuthorPHID()]->renderLink();
+ } else if ($commit->getCommitData()) {
+ $author = self::renderName($commit->getCommitData()->getAuthorName());
+ } else {
+ $author = self::renderName($tag->getAuthor());
+ }
+
+ $committed = phabricator_datetime($commit->getEpoch(), $viewer);
+ $author_name = phutil_tag(
+ 'strong',
+ array(
+ 'class' => 'diffusion-history-author-name',
+ ),
+ $author);
+
+ return pht('%s on %s.', $author_name, $committed);
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Oct 16 2024, 10:16 AM (4 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6717097
Default Alt Text
D18290.id43983.diff (2 KB)

Event Timeline