mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-18 02:31:10 +01:00
Show event icons in header instead of property list
Summary: Ref T11326. Currently, events show the icon as a property, like this: > Icon: Default This is boring and terrible. Show the icon in the header instead: {F1723530} Also minor cleanup on active/cancel states. Test Plan: Viewed an event, saw icon. Reviewers: chad Reviewed By: chad Maniphest Tasks: T11326 Differential Revision: https://secure.phabricator.com/D16297
This commit is contained in:
parent
7c9a74ce04
commit
04a69fa313
1 changed files with 11 additions and 12 deletions
|
@ -68,10 +68,15 @@ final class PhabricatorCalendarEventViewController
|
||||||
$viewer = $this->getViewer();
|
$viewer = $this->getViewer();
|
||||||
$id = $event->getID();
|
$id = $event->getID();
|
||||||
|
|
||||||
$is_cancelled = $event->getIsCancelled();
|
if ($event->isCancelledEvent()) {
|
||||||
$icon = $is_cancelled ? ('fa-ban') : ('fa-check');
|
$icon = 'fa-ban';
|
||||||
$color = $is_cancelled ? ('red') : ('bluegrey');
|
$color = 'red';
|
||||||
$status = $is_cancelled ? pht('Cancelled') : pht('Active');
|
$status = pht('Cancelled');
|
||||||
|
} else {
|
||||||
|
$icon = 'fa-check';
|
||||||
|
$color = 'bluegrey';
|
||||||
|
$status = pht('Active');
|
||||||
|
}
|
||||||
|
|
||||||
$invite_status = $event->getUserInviteStatus($viewer->getPHID());
|
$invite_status = $event->getUserInviteStatus($viewer->getPHID());
|
||||||
$status_invited = PhabricatorCalendarEventInvitee::STATUS_INVITED;
|
$status_invited = PhabricatorCalendarEventInvitee::STATUS_INVITED;
|
||||||
|
@ -82,7 +87,7 @@ final class PhabricatorCalendarEventViewController
|
||||||
->setHeader($event->getName())
|
->setHeader($event->getName())
|
||||||
->setStatus($icon, $color, $status)
|
->setStatus($icon, $color, $status)
|
||||||
->setPolicyObject($event)
|
->setPolicyObject($event)
|
||||||
->setHeaderIcon('fa-calendar');
|
->setHeaderIcon($event->getIcon());
|
||||||
|
|
||||||
if ($is_invite_pending) {
|
if ($is_invite_pending) {
|
||||||
$decline_button = id(new PHUIButtonView())
|
$decline_button = id(new PHUIButtonView())
|
||||||
|
@ -108,7 +113,6 @@ final class PhabricatorCalendarEventViewController
|
||||||
private function buildCurtain(PhabricatorCalendarEvent $event) {
|
private function buildCurtain(PhabricatorCalendarEvent $event) {
|
||||||
$viewer = $this->getRequest()->getUser();
|
$viewer = $this->getRequest()->getUser();
|
||||||
$id = $event->getID();
|
$id = $event->getID();
|
||||||
$is_cancelled = $event->isCancelledEvent();
|
|
||||||
$is_attending = $event->getIsUserAttending($viewer->getPHID());
|
$is_attending = $event->getIsUserAttending($viewer->getPHID());
|
||||||
|
|
||||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||||
|
@ -169,7 +173,7 @@ final class PhabricatorCalendarEventViewController
|
||||||
$reinstate_label = pht('Reinstate Event');
|
$reinstate_label = pht('Reinstate Event');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($is_cancelled) {
|
if ($event->isCancelledEvent()) {
|
||||||
$curtain->addAction(
|
$curtain->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setName($reinstate_label)
|
->setName($reinstate_label)
|
||||||
|
@ -302,11 +306,6 @@ final class PhabricatorCalendarEventViewController
|
||||||
|
|
||||||
$properties->invokeWillRenderEvent();
|
$properties->invokeWillRenderEvent();
|
||||||
|
|
||||||
$properties->addProperty(
|
|
||||||
pht('Icon'),
|
|
||||||
id(new PhabricatorCalendarIconSet())
|
|
||||||
->getIconLabel($event->getIcon()));
|
|
||||||
|
|
||||||
return $properties;
|
return $properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue