Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15408948
D17480.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D17480.id.diff
View Options
diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
--- a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
+++ b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
@@ -238,11 +238,15 @@
'class' => 'phui-timeline-wedge',
),
'');
+
+ $badge_view = $this->renderBadgeView();
+
$comment_box = id(new PHUIObjectBoxView())
->setFlush(true)
->addClass('phui-comment-form-view')
->addSigil('phui-comment-form')
->appendChild($image)
+ ->appendChild($badge_view)
->appendChild($wedge)
->appendChild($comment);
@@ -512,4 +516,47 @@
return $options;
}
+ private function renderBadgeView() {
+ $user = $this->getUser();
+ $can_use_badges = PhabricatorApplication::isClassInstalledForViewer(
+ 'PhabricatorBadgesApplication',
+ $user);
+ if (!$can_use_badges) {
+ return null;
+ }
+
+ $awards = id(new PhabricatorBadgesAwardQuery())
+ ->setViewer($this->getUser())
+ ->withRecipientPHIDs(array($user->getPHID()))
+ ->setLimit(2)
+ ->execute();
+
+ $badge_view = null;
+ if ($awards) {
+ $badges = mpull($awards, 'getBadge');
+ $badge_list = array();
+ foreach ($badges as $badge) {
+ $badge_view = id(new PHUIBadgeMiniView())
+ ->setIcon($badge->getIcon())
+ ->setQuality($badge->getQuality())
+ ->setHeader($badge->getName())
+ ->setTipDirection('E')
+ ->setHref('/badges/view/'.$badge->getID());
+
+ $badge_list[] = $badge_view;
+ }
+ $flex = new PHUIBadgeBoxView();
+ $flex->addItems($badge_list);
+ $flex->setCollapsed(true);
+ $badge_view = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'phui-timeline-badges',
+ ),
+ $flex);
+ }
+
+ return $badge_view;
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 20, 2:19 AM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7382277
Default Alt Text
D17480.id.diff (1 KB)
Attached To
Mode
D17480: Add badges to TransactionCommentView
Attached
Detach File
Event Timeline
Log In to Comment