1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 12:00:55 +01:00

Events - add a byline to event list

Summary: so you can see who the event is about...! Fixes T5621.

Test Plan: saw the creator of each event on /calendar/event/query/all/

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5621

Differential Revision: https://secure.phabricator.com/D10169
This commit is contained in:
Bob Trahan 2014-08-06 15:04:12 -07:00
parent 4cc006f8af
commit 95ef72e4f9

View file

@ -166,6 +166,16 @@ final class PhabricatorCalendarEventSearchEngine
return parent::buildSavedQueryFromBuiltin($query_key);
}
protected function getRequiredHandlePHIDsForResultList(
array $objects,
PhabricatorSavedQuery $query) {
$phids = array();
foreach ($objects as $event) {
$phids[$event->getUserPHID()] = 1;
}
return array_keys($phids);
}
protected function renderResultList(
array $events,
PhabricatorSavedQuery $query,
@ -192,6 +202,7 @@ final class PhabricatorCalendarEventSearchEngine
}
$from = phabricator_datetime($event->getDateFrom(), $viewer);
$to = phabricator_datetime($event->getDateTo(), $viewer);
$creator_handle = $handles[$event->getUserPHID()];
$color = ($event->getStatus() == PhabricatorCalendarEvent::STATUS_AWAY)
? 'red'
@ -201,6 +212,7 @@ final class PhabricatorCalendarEventSearchEngine
->setHeader($event->getTerseSummary($viewer))
->setHref($href)
->setBarColor($color)
->addByline(pht('Creator: %s', $creator_handle->renderLink()))
->addAttribute(pht('From %s to %s', $from, $to))
->addAttribute(
phutil_utf8_shorten($event->getDescription(), 64));