mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-03 02:18:24 +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:
parent
31a89bb94d
commit
3463a0d497
2 changed files with 42 additions and 5 deletions
|
@ -35,12 +35,24 @@ final class PhabricatorCalendarEventJoinController
|
||||||
if ($request->isFormPost()) {
|
if ($request->isFormPost()) {
|
||||||
$new_status = null;
|
$new_status = null;
|
||||||
|
|
||||||
if ($is_attending) {
|
switch ($action) {
|
||||||
$new_status = array($viewer->getPHID() => $declined_status);
|
case self::ACTION_ACCEPT:
|
||||||
} else {
|
$new_status = $attending_status;
|
||||||
$new_status = array($viewer->getPHID() => $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())
|
$xaction = id(new PhabricatorCalendarEventTransaction())
|
||||||
->setTransactionType(
|
->setTransactionType(
|
||||||
PhabricatorCalendarEventTransaction::TYPE_INVITE)
|
PhabricatorCalendarEventTransaction::TYPE_INVITE)
|
||||||
|
|
|
@ -200,11 +200,36 @@ final class PhabricatorCalendarEventViewController
|
||||||
|
|
||||||
if ($invitees) {
|
if ($invitees) {
|
||||||
$invitee_list = new PHUIStatusListView();
|
$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) {
|
foreach ($invitees as $invitee) {
|
||||||
$item = new PHUIStatusItemView();
|
$item = new PHUIStatusItemView();
|
||||||
$invitee_phid = $invitee->getInviteePHID();
|
$invitee_phid = $invitee->getInviteePHID();
|
||||||
|
$status = $invitee->getStatus();
|
||||||
$target = $viewer->renderHandle($invitee_phid);
|
$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);
|
->setTarget($target);
|
||||||
$invitee_list->addItem($item);
|
$invitee_list->addItem($item);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue