1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 11:30:55 +01:00

Document calendar summary icons

Summary:
Fixes T11809. Ref

  - Explicitly document the summary icon hints -- I don't think these are too hard to figure out (and maybe this stuff should just go in the tooltips) but we can start here.
  - Use color + shape to distinguish between "cancelled" and "declined", not just color (for users with vision accessibility issues).
  - Translate a "minute(s)" string into sensible English.
  - Use RSVP status on the month view green circle thing.

Test Plan:
  - Read docs.
  - Looked at month view.
  - Read reminder mail.
  - Viewed month view mobile view.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11809

Differential Revision: https://secure.phabricator.com/D16872
This commit is contained in:
epriestley 2016-11-15 12:36:28 -08:00
parent e713cc08e6
commit c7f2e4a924
5 changed files with 30 additions and 13 deletions

View file

@ -368,6 +368,8 @@ final class PhabricatorCalendarEventSearchEngine
$epoch_min = $event->getStartDateTimeEpoch(); $epoch_min = $event->getStartDateTimeEpoch();
$epoch_max = $event->getEndDateTimeEpoch(); $epoch_max = $event->getEndDateTimeEpoch();
$is_invited = $event->isRSVPInvited($viewer->getPHID());
$event_view = id(new AphrontCalendarEventView()) $event_view = id(new AphrontCalendarEventView())
->setHostPHID($event->getHostPHID()) ->setHostPHID($event->getHostPHID())
->setEpochRange($epoch_min, $epoch_max) ->setEpochRange($epoch_min, $epoch_max)
@ -376,7 +378,7 @@ final class PhabricatorCalendarEventSearchEngine
->setURI($event->getURI()) ->setURI($event->getURI())
->setIsAllDay($event->getIsAllDay()) ->setIsAllDay($event->getIsAllDay())
->setIcon($event->getDisplayIcon($viewer)) ->setIcon($event->getDisplayIcon($viewer))
->setViewerIsInvited($event->getIsUserInvited($viewer->getPHID())) ->setViewerIsInvited($is_invited)
->setIconColor($event->getDisplayIconColor($viewer)); ->setIconColor($event->getDisplayIconColor($viewer));
$month_view->addEvent($event_view); $month_view->addEvent($event_view);

View file

@ -538,16 +538,6 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
return $is_attending; return $is_attending;
} }
public function getIsUserInvited($phid) {
$uninvited_status = PhabricatorCalendarEventInvitee::STATUS_UNINVITED;
$declined_status = PhabricatorCalendarEventInvitee::STATUS_DECLINED;
$status = $this->getUserInviteStatus($phid);
if ($status == $uninvited_status || $status == $declined_status) {
return false;
}
return true;
}
public function getIsGhostEvent() { public function getIsGhostEvent() {
return $this->isGhostEvent; return $this->isGhostEvent;
} }
@ -655,7 +645,7 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
case PhabricatorCalendarEventInvitee::STATUS_INVITED: case PhabricatorCalendarEventInvitee::STATUS_INVITED:
return 'fa-user-plus'; return 'fa-user-plus';
case PhabricatorCalendarEventInvitee::STATUS_DECLINED: case PhabricatorCalendarEventInvitee::STATUS_DECLINED:
return 'fa-times'; return 'fa-times-circle';
} }
} }
} }

View file

@ -194,11 +194,12 @@ final class PhabricatorPeopleProfileViewController
->withDateRange($range_start, $range_end) ->withDateRange($range_start, $range_end)
->withInvitedPHIDs(array($user->getPHID())) ->withInvitedPHIDs(array($user->getPHID()))
->withIsCancelled(false) ->withIsCancelled(false)
->needRSVPs(array($viewer->getPHID()))
->execute(); ->execute();
$event_views = array(); $event_views = array();
foreach ($events as $event) { foreach ($events as $event) {
$viewer_is_invited = $event->getIsUserInvited($viewer->getPHID()); $viewer_is_invited = $event->isRSVPInvited($viewer->getPHID());
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer, $viewer,

View file

@ -37,6 +37,22 @@ revision or task.
You can click through to a user's profile to see more details about their You can click through to a user's profile to see more details about their
availability. availability.
Status Icons
============
On the month and day views, Calendar shows an icon next to each event to
indicate status. The icons are:
- {icon user-plus, color=green} **Invited, Individual**: You're personally
invited to the event.
- {icon users, color=green} **Invited, Group**: A project you are a member
of is invited to the event.
- {icon check-circle, color=green} **Attending**: You're attending the event.
- {icon times-circle, color=grey} **Declined**: You've declined the event.
- {icon times, color=red} **Cancelled**: The event has been cancelled.
If you don't have any special relationship to the event and the event does not
have any special status, an event-specific icon is shown instead.
Importing Events Importing Events
================ ================

View file

@ -1580,6 +1580,14 @@ final class PhabricatorUSEnglishTranslation
'Restart %s build?', 'Restart %s build?',
'Restart %s builds?', 'Restart %s builds?',
), ),
'%s is starting in %s minute(s), at %s.' => array(
array(
'%s is starting in one minute, at %3$s.',
'%s is starting in %s minutes, at %s.',
),
),
); );
} }