1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 13:22:42 +01:00

Adding awarder info to recipient list on badge view

Summary: Closes T8940, recipient list in badge view should show awarder and date info. Took a first stab at how we want to make the date look, but not sure. Looks odd as it is.

Test Plan: Open badge that has awards. Each recipient in list should have a subheader such as "Awarded by ... on ..."

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Maniphest Tasks: T8940

Differential Revision: https://secure.phabricator.com/D15590
This commit is contained in:
lkassianik 2016-04-02 19:17:36 -07:00
parent fa6151778f
commit 88d15ce799

View file

@ -20,6 +20,7 @@ final class PhabricatorBadgesRecipientsListView extends AphrontView {
$badge = $this->badge;
$handles = $this->handles;
$awards = mpull($badge->getAwards(), null, 'getRecipientPHID');
$can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
@ -34,8 +35,17 @@ final class PhabricatorBadgesRecipientsListView extends AphrontView {
$remove_uri = '/badges/recipients/'.
$badge->getID().'/remove/?phid='.$handle->getPHID();
$award = $awards[$handle->getPHID()];
$awarder_handle = $viewer->renderHandle($award->getAwarderPHID());
$award_date = phabricator_date($award->getDateCreated(), $viewer);
$awarder_info = pht(
'Awarded by %s on %s',
$awarder_handle->render(),
$award_date);
$item = id(new PHUIObjectItemView())
->setHeader($handle->getFullName())
->setSubhead($awarder_info)
->setHref($handle->getURI())
->setImageURI($handle->getImageURI());