Page MenuHomePhabricator

D15543.id37473.diff
No OneTemporary

D15543.id37473.diff

diff --git a/src/view/phui/PHUITimelineEventView.php b/src/view/phui/PHUITimelineEventView.php
--- a/src/view/phui/PHUITimelineEventView.php
+++ b/src/view/phui/PHUITimelineEventView.php
@@ -28,6 +28,7 @@
private $hideCommentOptions = false;
private $authorPHID;
private $badges = array();
+ private $showBadges = false;
public function setAuthorPHID($author_phid) {
$this->authorPHID = $author_phid;
@@ -358,6 +359,7 @@
if ($event->hasChildren()) {
$group_children[] = $event->renderChildren();
+ $this->showBadges = true;
}
}
@@ -382,7 +384,7 @@
'href' => $this->userHandle->getURI(),
),
'');
- if ($this->badges) {
+ if ($this->badges && $this->showBadges) {
$flex = new PHUIBadgeBoxView();
$flex->addItems($this->badges);
$flex->setCollapsed(true);
diff --git a/src/view/phui/PHUITimelineView.php b/src/view/phui/PHUITimelineView.php
--- a/src/view/phui/PHUITimelineView.php
+++ b/src/view/phui/PHUITimelineView.php
@@ -224,12 +224,6 @@
$user_phids = array();
foreach ($events as $key => $event) {
- if (!$event->hasChildren()) {
- // This is a minor event, so we don't have space to show badges.
- unset($events[$key]);
- continue;
- }
-
$author_phid = $event->getAuthorPHID();
if (!$author_phid) {
unset($events[$key]);
@@ -259,7 +253,9 @@
$awards = mgroup($awards, 'getRecipientPHID');
foreach ($events as $event) {
+
$author_awards = idx($awards, $event->getAuthorPHID(), array());
+
$badges = array();
foreach ($author_awards as $award) {
$badge = $award->getBadge();

File Metadata

Mime Type
text/plain
Expires
Mon, Mar 24, 11:18 PM (3 d, 21 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7700072
Default Alt Text
D15543.id37473.diff (1 KB)

Event Timeline