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

Hover hint on calendar list items should appear on the most convenient side of the item

Summary: Hover hint on calendar list items should be to the right in day view, left in profile view, on top in month view

Test Plan: Open profile view, calendar items should have a left hover. Open day view, calendar items should have a right hover. Open month view, calendar items should have top hover.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Maniphest Tasks: T9606

Differential Revision: https://secure.phabricator.com/D15964
This commit is contained in:
lkassianik 2016-05-23 10:24:02 -07:00
parent de645301b5
commit 359e8d4aa5
4 changed files with 22 additions and 4 deletions

View file

@ -223,6 +223,7 @@ final class PhabricatorPeopleProfileViewController
$events = msort($events, 'getEpochStart');
$day_view = id(new PHUICalendarWeekView())
->setViewer($viewer)
->setView('week')
->setEvents($events)
->setWeekLength(3)
->render();

View file

@ -85,7 +85,13 @@ final class PHUICalendarListView extends AphrontTagView {
}
$tip = $this->getEventTooltip($event);
$tip_align = ($this->getView() == 'day') ? 'E' : 'N';
if ($this->getView() == 'day') {
$tip_align = 'E';
} else if ($this->getView() == 'month') {
$tip_align = 'N';
} else {
$tip_align = 'W';
}
$content = javelin_tag(
'a',
array(

View file

@ -90,8 +90,9 @@ final class PHUICalendarMonthView extends AphrontView {
$max_daily = 15;
$counter = 0;
$list = new PHUICalendarListView();
$list->setViewer($viewer);
$list = id(new PHUICalendarListView())
->setViewer($viewer)
->setView('month');
foreach ($all_day_events as $item) {
if ($counter <= $max_daily) {
$list->addEvent($item);

View file

@ -4,6 +4,7 @@ final class PHUICalendarWeekView extends AphrontView {
private $events;
private $dateTime;
private $weekLength = 7;
private $view = 'day';
public function setEvents($events) {
$this->events = $events;
@ -27,6 +28,15 @@ final class PHUICalendarWeekView extends AphrontView {
return $this;
}
public function setView($view) {
$this->view = $view;
return $this;
}
private function getView() {
return $this->view;
}
public function render() {
$this->events = msort($this->events, 'getEpochStart');
$week_of_boxes = $this->getWeekOfBoxes();
@ -64,7 +74,7 @@ final class PHUICalendarWeekView extends AphrontView {
$list = id(new PHUICalendarListView())
->setUser($this->getViewer())
->setView('day');
->setView($this->getView());
if (count($events) == 0) {
$list->showBlankState(true);