Skip to content

Commit

Permalink
Fix an issue where 'Attending' would appear on calendar view unnecess…
Browse files Browse the repository at this point in the history
…arily

Summary:
Ref T10295

* Viewing Upcoming Events in the calendar would display 'Attending: ' even if there were not attendees. This caused confusion, such as 'Is it telling me I am "Attending?"'
* When a calendar event has no attendees, simply do not display the 'Attending: ' label

Test Plan:
* Add a new event with no one attending.
* Add a new event with one or more attendees.
* View the Upcoming Events query of the Calendar app.
* Notice how the one with no attendees does not show 'Attending: ' while the other with attendees will show the already existing 'Attending: jdoe, ssmith' label.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T10295

Differential Revision: https://secure.phabricator.com/D15207
  • Loading branch information
jcowgar authored and epriestley committed Feb 7, 2016
1 parent d9bd062 commit 604b780
Showing 1 changed file with 19 additions and 16 deletions.
Expand Up @@ -266,7 +266,6 @@ protected function renderResultList(
$list = new PHUIObjectItemListView();

foreach ($events as $event) {
$duration = '';
$event_date_info = $this->getEventDateLabel($event);
$creator_handle = $handles[$event->getUserPHID()];
$attendees = array();
Expand All @@ -275,18 +274,6 @@ protected function renderResultList(
$attendees[] = $invitee->getInviteePHID();
}

$attendees = pht(
'Attending: %s',
$viewer->renderHandleList($attendees)
->setAsInline(1)
->render());

if (strlen($event->getDuration()) > 0) {
$duration = pht(
'Duration: %s',
$event->getDuration());
}

if ($event->getIsGhostEvent()) {
$title_text = $event->getMonogram()
.' ('
Expand All @@ -302,9 +289,25 @@ protected function renderResultList(
->setObject($event)
->setHeader($title_text)
->setHref($event->getURI())
->addAttribute($event_date_info)
->addAttribute($attendees)
->addIcon('none', $duration);
->addAttribute($event_date_info);

if ($attendees) {
$attending = pht(
'Attending: %s',
$viewer->renderHandleList($attendees)
->setAsInline(1)
->render());

$item->addAttribute($attending);
}

if (strlen($event->getDuration()) > 0) {
$duration = pht(
'Duration: %s',
$event->getDuration());

$item->addIcon('none', $duration);
}

$list->addItem($item);
}
Expand Down

0 comments on commit 604b780

Please sign in to comment.