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

Invitee list on Calendar event detail view should have pretty icons

Summary: Closes T8020, Invitee list on Calendar event detail view should have pretty icons.

Test Plan: Open event, invite users, event detail should show invitee names with blank circles, after users accept/decline, icons should update to green check/red times icons, respectively.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T8020

Differential Revision: https://secure.phabricator.com/D12720
This commit is contained in:
lkassianik 2015-05-05 12:29:04 -07:00
parent 31a89bb94d
commit 3463a0d497
2 changed files with 42 additions and 5 deletions

View file

@ -35,12 +35,24 @@ final class PhabricatorCalendarEventJoinController
if ($request->isFormPost()) {
$new_status = null;
if ($is_attending) {
$new_status = array($viewer->getPHID() => $declined_status);
} else {
$new_status = array($viewer->getPHID() => $attending_status);
switch ($action) {
case self::ACTION_ACCEPT:
$new_status = $attending_status;
break;
case self::ACTION_JOIN:
if ($is_attending) {
$new_status = $declined_status;
} else {
$new_status = $attending_status;
}
break;
case self::ACTION_DECLINE:
$new_status = $declined_status;
break;
}
$new_status = array($viewer->getPHID() => $new_status);
$xaction = id(new PhabricatorCalendarEventTransaction())
->setTransactionType(
PhabricatorCalendarEventTransaction::TYPE_INVITE)

View file

@ -200,11 +200,36 @@ final class PhabricatorCalendarEventViewController
if ($invitees) {
$invitee_list = new PHUIStatusListView();
$icon_invited = PHUIStatusItemView::ICON_OPEN;
$icon_attending = PHUIStatusItemView::ICON_ACCEPT;
$icon_declined = PHUIStatusItemView::ICON_REJECT;
$status_invited = PhabricatorCalendarEventInvitee::STATUS_INVITED;
$status_attending = PhabricatorCalendarEventInvitee::STATUS_ATTENDING;
$status_declined = PhabricatorCalendarEventInvitee::STATUS_DECLINED;
$icon_map = array(
$status_invited => $icon_invited,
$status_attending => $icon_attending,
$status_declined => $icon_declined,
);
$icon_color_map = array(
$status_invited => null,
$status_attending => 'green',
$status_declined => 'red',
);
foreach ($invitees as $invitee) {
$item = new PHUIStatusItemView();
$invitee_phid = $invitee->getInviteePHID();
$status = $invitee->getStatus();
$target = $viewer->renderHandle($invitee_phid);
$item->setNote($invitee->getStatus())
$icon = $icon_map[$status];
$icon_color = $icon_color_map[$status];
$item->setIcon($icon, $icon_color)
->setTarget($target);
$invitee_list->addItem($item);
}