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:
parent
fa6151778f
commit
88d15ce799
1 changed files with 10 additions and 0 deletions
|
@ -20,6 +20,7 @@ final class PhabricatorBadgesRecipientsListView extends AphrontView {
|
||||||
|
|
||||||
$badge = $this->badge;
|
$badge = $this->badge;
|
||||||
$handles = $this->handles;
|
$handles = $this->handles;
|
||||||
|
$awards = mpull($badge->getAwards(), null, 'getRecipientPHID');
|
||||||
|
|
||||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||||
$viewer,
|
$viewer,
|
||||||
|
@ -34,8 +35,17 @@ final class PhabricatorBadgesRecipientsListView extends AphrontView {
|
||||||
$remove_uri = '/badges/recipients/'.
|
$remove_uri = '/badges/recipients/'.
|
||||||
$badge->getID().'/remove/?phid='.$handle->getPHID();
|
$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())
|
$item = id(new PHUIObjectItemView())
|
||||||
->setHeader($handle->getFullName())
|
->setHeader($handle->getFullName())
|
||||||
|
->setSubhead($awarder_info)
|
||||||
->setHref($handle->getURI())
|
->setHref($handle->getURI())
|
||||||
->setImageURI($handle->getImageURI());
|
->setImageURI($handle->getImageURI());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue