@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.

Add serious business string for no calendar entries

Summary:
Allow boring humans to understand that a user may have events but they might not be visible to the current viewer when looking at a user's Calendar widget on a user profile by providing the string "No visible events." when in serious business mode instead of "Clear sailing ahead."

Also sneak in some PhpDoc while I was poking this anyway.

Test Plan:
* Enable http://phorge.localhost/config/edit/phabricator.serious-business/
* Install Calendar application at http://phorge.localhost/applications/view/PhabricatorCalendarApplication/
* Go to http://phorge.localhost/p/user/ and look at the "Calendar" box on the right.

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D26225

+28 -1
+9
src/applications/people/controller/PhabricatorPeopleProfileViewController.php
··· 85 85 )); 86 86 } 87 87 88 + /** 89 + * @return PHUIObjectBoxView|null 90 + */ 88 91 private function buildPropertyView( 89 92 PhabricatorUser $user) { 90 93 ··· 114 117 return $view; 115 118 } 116 119 120 + /** 121 + * @return PHUIObjectBoxView 122 + */ 117 123 private function buildProjectsView( 118 124 PhabricatorUser $user) { 119 125 ··· 168 174 return $box; 169 175 } 170 176 177 + /** 178 + * @return PHUIObjectBoxView|null 179 + */ 171 180 private function buildCalendarDayView(PhabricatorUser $user) { 172 181 $viewer = $this->getViewer(); 173 182 $class = 'PhabricatorCalendarApplication';
+13 -1
src/view/phui/calendar/PHUICalendarListView.php
··· 49 49 ); 50 50 } 51 51 52 + /** 53 + * @return PhutilSafeHTML|string 54 + */ 52 55 protected function getTagContent() { 53 56 if (!$this->blankState && empty($this->events)) { 54 57 return ''; ··· 156 159 } 157 160 158 161 if (empty($singletons)) { 162 + if (PhabricatorEnv::getEnvConfig('phabricator.serious-business')) { 163 + $no_events_text = pht('No visible events.'); 164 + } else { 165 + $no_events_text = pht('Clear sailing ahead.'); 166 + } 167 + 159 168 $singletons[] = phutil_tag( 160 169 'li', 161 170 array( 162 171 'class' => 'phui-calendar-list-item-empty', 163 172 ), 164 - pht('Clear sailing ahead.')); 173 + $no_events_text); 165 174 } 166 175 167 176 $list = phutil_tag( ··· 174 183 return $list; 175 184 } 176 185 186 + /** 187 + * @return PhutilSafeHTML 188 + */ 177 189 private function getEventTitle($event) { 178 190 $class = 'phui-calendar-item'; 179 191 return phutil_tag(
+6
src/view/phui/calendar/PHUICalendarWeekView.php
··· 37 37 return $this->view; 38 38 } 39 39 40 + /** 41 + * @return array<PHUICalendarWidgetView> 42 + */ 40 43 public function render() { 41 44 $this->events = msort($this->events, 'getEpochStart'); 42 45 $week_of_boxes = $this->getWeekOfBoxes(); ··· 68 71 return $filled_boxes; 69 72 } 70 73 74 + /** 75 + * @return PHUICalendarWidgetView 76 + */ 71 77 private function renderSidebarBox($events, $title) { 72 78 $widget = id(new PHUICalendarWidgetView()) 73 79 ->addClass('calendar-day-view-sidebar');