mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 04:20: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:
parent
4cc006f8af
commit
95ef72e4f9
1 changed files with 12 additions and 0 deletions
|
@ -166,6 +166,16 @@ final class PhabricatorCalendarEventSearchEngine
|
||||||
return parent::buildSavedQueryFromBuiltin($query_key);
|
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(
|
protected function renderResultList(
|
||||||
array $events,
|
array $events,
|
||||||
PhabricatorSavedQuery $query,
|
PhabricatorSavedQuery $query,
|
||||||
|
@ -192,6 +202,7 @@ final class PhabricatorCalendarEventSearchEngine
|
||||||
}
|
}
|
||||||
$from = phabricator_datetime($event->getDateFrom(), $viewer);
|
$from = phabricator_datetime($event->getDateFrom(), $viewer);
|
||||||
$to = phabricator_datetime($event->getDateTo(), $viewer);
|
$to = phabricator_datetime($event->getDateTo(), $viewer);
|
||||||
|
$creator_handle = $handles[$event->getUserPHID()];
|
||||||
|
|
||||||
$color = ($event->getStatus() == PhabricatorCalendarEvent::STATUS_AWAY)
|
$color = ($event->getStatus() == PhabricatorCalendarEvent::STATUS_AWAY)
|
||||||
? 'red'
|
? 'red'
|
||||||
|
@ -201,6 +212,7 @@ final class PhabricatorCalendarEventSearchEngine
|
||||||
->setHeader($event->getTerseSummary($viewer))
|
->setHeader($event->getTerseSummary($viewer))
|
||||||
->setHref($href)
|
->setHref($href)
|
||||||
->setBarColor($color)
|
->setBarColor($color)
|
||||||
|
->addByline(pht('Creator: %s', $creator_handle->renderLink()))
|
||||||
->addAttribute(pht('From %s to %s', $from, $to))
|
->addAttribute(pht('From %s to %s', $from, $to))
|
||||||
->addAttribute(
|
->addAttribute(
|
||||||
phutil_utf8_shorten($event->getDescription(), 64));
|
phutil_utf8_shorten($event->getDescription(), 64));
|
||||||
|
|
Loading…
Reference in a new issue