@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Calendar event icons show up on month and day views

Summary: Closes T7936, Calendar event icons show up on month and day views

Test Plan: Calendar month and day views should show event icons

Reviewers: chad, #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7936

Differential Revision: https://secure.phabricator.com/D12943

+83 -67
+4 -4
resources/celerity/map.php
··· 122 122 'rsrc/css/layout/phabricator-side-menu-view.css' => 'c1db9e9c', 123 123 'rsrc/css/layout/phabricator-source-code-view.css' => '2ceee894', 124 124 'rsrc/css/phui/calendar/phui-calendar-day.css' => 'c0cf782a', 125 - 'rsrc/css/phui/calendar/phui-calendar-list.css' => '857a0d83', 126 - 'rsrc/css/phui/calendar/phui-calendar-month.css' => '1d0e1e9b', 125 + 'rsrc/css/phui/calendar/phui-calendar-list.css' => 'c1c7f338', 126 + 'rsrc/css/phui/calendar/phui-calendar-month.css' => '94b1750a', 127 127 'rsrc/css/phui/calendar/phui-calendar.css' => 'ccabe893', 128 128 'rsrc/css/phui/phui-action-header-view.css' => '89c497e7', 129 129 'rsrc/css/phui/phui-action-list.css' => '4f4d09f2', ··· 764 764 'phui-button-css' => 'de610129', 765 765 'phui-calendar-css' => 'ccabe893', 766 766 'phui-calendar-day-css' => 'c0cf782a', 767 - 'phui-calendar-list-css' => '857a0d83', 768 - 'phui-calendar-month-css' => '1d0e1e9b', 767 + 'phui-calendar-list-css' => 'c1c7f338', 768 + 'phui-calendar-month-css' => '94b1750a', 769 769 'phui-crumbs-view-css' => '594d719e', 770 770 'phui-document-view-css' => '94d5dcd8', 771 771 'phui-feed-story-css' => 'c9f3a0b5',
+2
src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
··· 364 364 $event = new AphrontCalendarEventView(); 365 365 $event->setEpochRange($status->getDateFrom(), $status->getDateTo()); 366 366 $event->setIsAllDay($status->getIsAllDay()); 367 + $event->setIcon($status->getIcon()); 367 368 368 369 $name_text = $handles[$status->getUserPHID()]->getName(); 369 370 $status_text = $status->getName(); ··· 411 412 $event->setEventID($status->getID()); 412 413 $event->setEpochRange($status->getDateFrom(), $status->getDateTo()); 413 414 $event->setIsAllDay($status->getIsAllDay()); 415 + $event->setIcon($status->getIcon()); 414 416 $event->setViewerIsInvited($viewer_is_invited); 415 417 416 418 $event->setName($status->getName());
+10
src/applications/calendar/view/AphrontCalendarEventView.php
··· 11 11 private $viewerIsInvited; 12 12 private $uri; 13 13 private $isAllDay; 14 + private $icon; 14 15 15 16 public function setURI($uri) { 16 17 $this->uri = $uri; ··· 85 86 86 87 public function getIsAllDay() { 87 88 return $this->isAllDay; 89 + } 90 + 91 + public function setIcon($icon) { 92 + $this->icon = $icon; 93 + return $this; 94 + } 95 + 96 + public function getIcon() { 97 + return $this->icon; 88 98 } 89 99 90 100
+2 -1
src/view/phui/calendar/PHUICalendarDayView.php
··· 276 276 ->addClass('calendar-day-view-sidebar'); 277 277 278 278 $list = id(new PHUICalendarListView()) 279 - ->setUser($this->user); 279 + ->setUser($this->user) 280 + ->setView('day'); 280 281 281 282 if (count($events) == 0) { 282 283 $list->showBlankState(true);
+40 -31
src/view/phui/calendar/PHUICalendarListView.php
··· 4 4 5 5 private $events = array(); 6 6 private $blankState; 7 + private $view; 8 + 9 + private function getView() { 10 + return $this->view; 11 + } 12 + 13 + public function setView($view) { 14 + $this->view = $view; 15 + return $this; 16 + } 7 17 8 18 public function addEvent(AphrontCalendarEventView $event) { 9 19 $this->events[] = $event; ··· 37 47 38 48 if ($event->getIsAllDay()) { 39 49 $timelabel = pht('All Day'); 40 - $dot = null; 41 50 } else { 42 51 $timelabel = phabricator_time( 43 52 $event->getEpochStart(), 44 53 $this->getUser()); 54 + } 45 55 46 - $dot = phutil_tag( 47 - 'span', 48 - array( 49 - 'class' => 'phui-calendar-list-dot', 50 - ), 51 - ''); 56 + if ($event->getViewerIsInvited()) { 57 + $icon_color = 'green'; 58 + } else { 59 + $icon_color = null; 52 60 } 53 61 62 + $dot = id(new PHUIIconView()) 63 + ->setIconFont($event->getIcon(), $icon_color) 64 + ->addClass('phui-calendar-list-item-icon'); 65 + 54 66 $title = phutil_tag( 55 67 'span', 56 68 array( 57 69 'class' => 'phui-calendar-list-title', 58 70 ), 59 - $this->renderEventLink($event, $allday)); 71 + $this->getEventTitle($event, $allday)); 60 72 $time = phutil_tag( 61 73 'span', 62 74 array( ··· 72 84 $class = $class.' all-day'; 73 85 } 74 86 75 - $content = phutil_tag( 87 + $tip = $this->getEventTooltip($event); 88 + $tip_align = ($this->getView() == 'day') ? 'E' : 'N'; 89 + $content = javelin_tag( 76 90 'a', 77 91 array( 78 92 'href' => '/E'.$event->getEventID(), 93 + 'sigil' => 'has-tooltip', 94 + 'meta' => array( 95 + 'tip' => $tip, 96 + 'size' => 200, 97 + 'align' => $tip_align, 98 + ), 79 99 ), 80 100 array( 81 101 $dot, ··· 110 130 return $list; 111 131 } 112 132 113 - private function renderEventLink($event) { 133 + private function getEventTitle($event) { 134 + $class = 'phui-calendar-item'; 135 + return phutil_tag( 136 + 'span', 137 + array( 138 + 'class' => $class, 139 + ), 140 + $event->getName()); 141 + } 114 142 143 + private function getEventTooltip(AphrontCalendarEventView $event) { 115 144 Javelin::initBehavior('phabricator-tooltips'); 116 145 117 146 $start = id(AphrontFormDateControlValue::newFromEpoch( ··· 145 174 $end->getValueAsFormat('M j, Y, g:i A')); 146 175 } 147 176 } 148 - 149 - $description = $event->getDescription(); 150 - if (strlen($description) == 0) { 151 - $description = pht('(%s)', $event->getName()); 152 - } 153 - 154 - $class = 'phui-calendar-item'; 155 - 156 - $anchor = javelin_tag( 157 - 'span', 158 - array( 159 - 'sigil' => 'has-tooltip', 160 - 'class' => $class, 161 - 'meta' => array( 162 - 'tip' => $tip, 163 - 'size' => 200, 164 - ), 165 - ), 166 - $event->getName()); 167 - 168 - return $anchor; 177 + return $tip; 169 178 } 170 179 171 180 public function getIsViewerInvitedOnList() {
+16 -10
webroot/rsrc/css/phui/calendar/phui-calendar-list.css
··· 29 29 30 30 .phui-calendar-list-item { 31 31 position: relative; 32 + line-height: 18px; 33 + height: 18px; 32 34 } 33 35 34 - .phui-calendar-list-dot { 35 - position: relative; 36 - display: inline-block; 37 - width: 5px; 38 - height: 5px; 39 - margin-right: 6px; 40 - top: -5px; 41 - border-radius: 10px; 42 - border: 1px solid transparent; 36 + .phui-calendar-list-item a { 37 + display: block; 38 + width: auto; 39 + min-height: 18px; 40 + } 41 + 42 + .phui-calendar-list-item-icon { 43 + position: absolute; 44 + left: 0; 45 + top: 3px; 43 46 } 44 47 45 48 .phui-calendar-list-title { 46 49 width: 200px; 47 - display: inline-block; 48 50 overflow: hidden; 49 51 text-overflow: ellipsis; 50 52 white-space: nowrap; 53 + position: absolute; 54 + left: 20px; 55 + top: 0; 51 56 } 52 57 53 58 .phui-calendar-viewer-invited .phui-calendar-list-title { ··· 61 66 right: 0; 62 67 color: {$lightgreytext}; 63 68 text-align: right; 69 + line-height: 20px; 64 70 } 65 71 66 72 .phui-calendar-list-item-empty {
+9 -21
webroot/rsrc/css/phui/calendar/phui-calendar-month.css
··· 180 180 display: block; 181 181 overflow: hidden; 182 182 position: relative; 183 + height: 18px; 183 184 } 184 185 185 186 .phui-calendar-view li.phui-calendar-list-item { ··· 187 188 width: auto; 188 189 } 189 190 190 - .phui-calendar-view .phui-calendar-list-dot { 191 - position: relative; 191 + .phui-calendar-list-item-icon { 192 192 display: block; 193 - float: left; 194 - width: 3px; 195 - height: 3px; 196 - margin-right: 4px; 197 - border-radius: 10px; 198 - top: 5px; 199 - left: 0; 200 - display: none; 193 + left: 0px; 201 194 } 202 195 203 196 .phui-calendar-view li.phui-calendar-list-item .phui-calendar-list-title { 204 197 width: auto; 205 198 position: absolute; 206 - right: 0; 207 - left: 60px; 199 + left: 20px; 200 + right: 60px; 208 201 text-overflow: ellipsis; 209 202 overflow: hidden; 210 203 white-space: nowrap; 211 204 } 212 205 213 - li.all-day { 214 - line-height: 18px; 215 - } 216 - 217 206 .phui-calendar-view li.phui-calendar-list-item .phui-calendar-list-time { 218 - position: relative; 219 - display: inline-block; 220 - float: left; 207 + position: absolute; 208 + top: 0; 209 + right: 0px; 221 210 padding: 0; 222 - line-height: 18px; 223 211 width: 60px; 224 212 color: {$lightgreytext}; 225 - text-align: left; 213 + text-align: right; 226 214 }