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

Remove Calendar from Conpherence

Summary: Ref T8834, cleanly removes "Calendar" widget from Conpherence. RIP. :(

Test Plan: Bounce around Conpherence, no Calendar. grep for "calendar" in apps folder, css, js

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T8834

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

+2 -386
+2 -2
resources/celerity/map.php
··· 51 51 'rsrc/css/application/conpherence/notification.css' => '6cdcc253', 52 52 'rsrc/css/application/conpherence/transaction.css' => '85d0974c', 53 53 'rsrc/css/application/conpherence/update.css' => 'faf6be09', 54 - 'rsrc/css/application/conpherence/widget-pane.css' => '419fd50c', 54 + 'rsrc/css/application/conpherence/widget-pane.css' => 'b0793769', 55 55 'rsrc/css/application/contentsource/content-source-view.css' => '4b8b05d4', 56 56 'rsrc/css/application/countdown/timer.css' => 'e7544472', 57 57 'rsrc/css/application/daemon/bulk-job.css' => 'df9c1d4a', ··· 514 514 'conpherence-thread-manager' => '01774ab2', 515 515 'conpherence-transaction-css' => '85d0974c', 516 516 'conpherence-update-css' => 'faf6be09', 517 - 'conpherence-widget-pane-css' => '419fd50c', 517 + 'conpherence-widget-pane-css' => 'b0793769', 518 518 'differential-changeset-view-css' => 'b6b0d1bb', 519 519 'differential-core-view-css' => '7ac3cabc', 520 520 'differential-inline-comment-editor' => 'd4c87bf4',
-11
src/applications/conpherence/constants/ConpherenceWidgetConfigConstants.php
··· 36 36 'deviceOnly' => false, 37 37 'hasCreate' => false, 38 38 ), 39 - 'widgets-calendar' => array( 40 - 'name' => pht('Calendar'), 41 - 'icon' => 'fa-calendar', 42 - 'deviceOnly' => false, 43 - 'hasCreate' => true, 44 - 'createData' => array( 45 - 'refreshFromResponse' => false, 46 - 'action' => ConpherenceUpdateActions::ADD_STATUS, 47 - 'customHref' => '/calendar/event/create/', 48 - ), 49 - ), 50 39 'widgets-settings' => array( 51 40 'name' => pht('Notifications'), 52 41 'icon' => 'fa-wrench',
-8
src/applications/conpherence/controller/ConpherenceController.php
··· 27 27 ->addSigil('conpherence-widget-adder') 28 28 ->setMetadata(array('widget' => 'widgets-people'))); 29 29 30 - $nav->addMenuItem( 31 - id(new PHUIListItemView()) 32 - ->setName(pht('New Calendar Item')) 33 - ->setType(PHUIListItemView::TYPE_LINK) 34 - ->setHref('/calendar/event/create/') 35 - ->addSigil('conpherence-widget-adder') 36 - ->setMetadata(array('widget' => 'widgets-calendar'))); 37 - 38 30 return $nav; 39 31 } 40 32
-211
src/applications/conpherence/controller/ConpherenceWidgetController.php
··· 44 44 case 'widgets-files': 45 45 $content = $this->renderFileWidgetPaneContent(); 46 46 break; 47 - case 'widgets-calendar': 48 - $widget = $this->renderCalendarWidgetPaneContent(); 49 - $content = phutil_implode_html('', $widget); 50 - break; 51 47 case 'widgets-settings': 52 48 $content = $this->renderSettingsWidgetPaneContent(); 53 49 break; ··· 103 99 'style' => 'display: none;', 104 100 ), 105 101 $this->renderFileWidgetPaneContent()); 106 - $widgets[] = phutil_tag( 107 - 'div', 108 - array( 109 - 'class' => 'widgets-body', 110 - 'id' => 'widgets-calendar', 111 - 'style' => 'display: none;', 112 - ), 113 - $this->renderCalendarWidgetPaneContent()); 114 102 $widgets[] = phutil_tag( 115 103 'div', 116 104 array( ··· 225 213 'sigil' => 'notifications-update', 226 214 ), 227 215 $layout); 228 - } 229 - 230 - private function renderCalendarWidgetPaneContent() { 231 - $user = $this->getRequest()->getUser(); 232 - 233 - $conpherence = $this->getConpherence(); 234 - $participants = $conpherence->getParticipants(); 235 - $widget_data = $conpherence->getWidgetData(); 236 - 237 - // TODO: This panel is built around an outdated notion of events and isn't 238 - // invitee-aware. 239 - 240 - $statuses = $widget_data['events']; 241 - $handles = $conpherence->getHandles(); 242 - $content = array(); 243 - $layout = id(new AphrontMultiColumnView()) 244 - ->setFluidLayout(true); 245 - $timestamps = CalendarTimeUtil::getCalendarWidgetTimestamps($user); 246 - $today = $timestamps['today']; 247 - $epoch_stamps = $timestamps['epoch_stamps']; 248 - $one_day = 24 * 60 * 60; 249 - $is_today = false; 250 - $calendar_columns = 0; 251 - $list_days = 0; 252 - foreach ($epoch_stamps as $day) { 253 - // build a header for the new day 254 - if ($day->format('Ymd') == $today->format('Ymd')) { 255 - $active_class = 'today'; 256 - $is_today = true; 257 - } else { 258 - $active_class = ''; 259 - $is_today = false; 260 - } 261 - 262 - $should_draw_list = $list_days < 7; 263 - $list_days++; 264 - 265 - if ($should_draw_list) { 266 - $content[] = phutil_tag( 267 - 'div', 268 - array( 269 - 'class' => 'day-header '.$active_class, 270 - ), 271 - array( 272 - phutil_tag( 273 - 'div', 274 - array( 275 - 'class' => 'day-name', 276 - ), 277 - $day->format('l')), 278 - phutil_tag( 279 - 'div', 280 - array( 281 - 'class' => 'day-date', 282 - ), 283 - $day->format('m/d/y')), 284 - )); 285 - } 286 - 287 - $week_day_number = $day->format('w'); 288 - 289 - $epoch_start = $day->format('U'); 290 - $next_day = clone $day; 291 - $next_day->modify('+1 day'); 292 - $epoch_end = $next_day->format('U'); 293 - 294 - $first_status_of_the_day = true; 295 - $statuses_of_the_day = array(); 296 - // keep looking through statuses where we last left off 297 - foreach ($statuses as $status) { 298 - if ($status->getDateFrom() >= $epoch_end) { 299 - // This list is sorted, so we can stop looking. 300 - break; 301 - } 302 - 303 - if ($status->getDateFrom() < $epoch_end && 304 - $status->getDateTo() > $epoch_start) { 305 - $statuses_of_the_day[$status->getUserPHID()] = $status; 306 - if ($should_draw_list) { 307 - $top_border = ''; 308 - if (!$first_status_of_the_day) { 309 - $top_border = ' top-border'; 310 - } 311 - $timespan = $status->getDateTo() - $status->getDateFrom(); 312 - if ($timespan > $one_day) { 313 - $time_str = 'm/d'; 314 - } else { 315 - $time_str = 'h:i A'; 316 - } 317 - $epoch_range = 318 - phabricator_format_local_time( 319 - $status->getDateFrom(), 320 - $user, 321 - $time_str). 322 - ' - '. 323 - phabricator_format_local_time( 324 - $status->getDateTo(), 325 - $user, 326 - $time_str); 327 - 328 - if (isset($handles[$status->getUserPHID()])) { 329 - $secondary_info = pht( 330 - '%s, %s', 331 - $handles[$status->getUserPHID()]->getName(), 332 - $epoch_range); 333 - } else { 334 - $secondary_info = $epoch_range; 335 - } 336 - 337 - $content[] = phutil_tag( 338 - 'div', 339 - array( 340 - 'class' => 'user-status '.$top_border, 341 - ), 342 - array( 343 - phutil_tag( 344 - 'div', 345 - array( 346 - 'class' => 'icon', 347 - ), 348 - ''), 349 - phutil_tag( 350 - 'div', 351 - array( 352 - 'class' => 'description', 353 - ), 354 - array( 355 - $status->getName(), 356 - phutil_tag( 357 - 'div', 358 - array( 359 - 'class' => 'participant', 360 - ), 361 - $secondary_info), 362 - )), 363 - )); 364 - } 365 - $first_status_of_the_day = false; 366 - } 367 - } 368 - 369 - // we didn't get a status on this day so add a spacer 370 - if ($first_status_of_the_day && $should_draw_list) { 371 - $content[] = phutil_tag( 372 - 'div', 373 - array('class' => 'no-events pm'), 374 - pht('No Events Scheduled.')); 375 - } 376 - if ($is_today || ($calendar_columns && $calendar_columns < 3)) { 377 - $active_class = ''; 378 - if ($is_today) { 379 - $active_class = '-active'; 380 - } 381 - $inner_layout = array(); 382 - foreach ($participants as $phid => $participant) { 383 - $status = idx($statuses_of_the_day, $phid, false); 384 - if ($status) { 385 - $inner_layout[] = phutil_tag( 386 - 'div', 387 - array(), 388 - ''); 389 - } else { 390 - $inner_layout[] = phutil_tag( 391 - 'div', 392 - array( 393 - 'class' => 'present', 394 - ), 395 - ''); 396 - } 397 - } 398 - $layout->addColumn( 399 - phutil_tag( 400 - 'div', 401 - array( 402 - 'class' => 'day-column'.$active_class, 403 - ), 404 - array( 405 - phutil_tag( 406 - 'div', 407 - array( 408 - 'class' => 'day-name', 409 - ), 410 - $day->format('D')), 411 - phutil_tag( 412 - 'div', 413 - array( 414 - 'class' => 'day-number', 415 - ), 416 - $day->format('j')), 417 - $inner_layout, 418 - ))); 419 - $calendar_columns++; 420 - } 421 - } 422 - 423 - return array( 424 - $layout, 425 - $content, 426 - ); 427 216 } 428 217 429 218 private function getWidgetURI() {
-154
webroot/rsrc/css/application/conpherence/widget-pane.css
··· 158 158 margin: 8px 0px 0px 10%; 159 159 } 160 160 161 - /* calendar widget */ 162 - 163 - .conpherence-widget-pane #widgets-calendar .aphront-multi-column-view { 164 - width: 240px; 165 - } 166 - .device-phone .conpherence-widget-pane #widgets-calendar 167 - .aphront-multi-column-view { 168 - display: none; 169 - } 170 - .device-tablet .conpherence-widget-pane #widgets-calendar 171 - .aphront-multi-column-view { 172 - width: 100%; 173 - } 174 - .conpherence-widget-pane #widgets-calendar .aphront-multi-column-view 175 - .aphront-multi-column-column { 176 - background: white; 177 - border-right: 1px solid {$thinblueborder}; 178 - text-align: center; 179 - } 180 - .device-phone .conpherence-widget-pane #widgets-calendar 181 - .aphront-multi-column-view .aphront-multi-column-column { 182 - border-right: 0; 183 - } 184 - 185 - .device-phone .conpherence-widget-pane #widgets-calendar 186 - .aphront-multi-column-fluid .aphront-multi-column-5-up 187 - .aphront-multi-column-column-outer { 188 - width: 20%; 189 - margin-bottom: 0px; 190 - float: left; 191 - clear: none; 192 - } 193 - 194 - .conpherence-widget-pane .no-events { 195 - color: {$lightgreytext}; 196 - } 197 - 198 - .conpherence-widget-pane #widgets-calendar .aphront-multi-column-view 199 - .aphront-multi-column-column-last { 200 - border-right: 0; 201 - } 202 - .conpherence-widget-pane #widgets-calendar .aphront-multi-column-view 203 - .aphront-multi-column-column .day-column, 204 - .conpherence-widget-pane #widgets-calendar .aphront-multi-column-view 205 - .aphront-multi-column-column .day-column-active { 206 - color: #bfbfbf; 207 - background-color: white; 208 - font-weight: bold; 209 - padding: 0px 0px 10px 0px; 210 - } 211 - .conpherence-widget-pane #widgets-calendar .aphront-multi-column-view 212 - .aphront-multi-column-column .day-column-active { 213 - color: black; 214 - } 215 - .conpherence-widget-pane #widgets-calendar .aphront-multi-column-view 216 - .aphront-multi-column-column .present , 217 - .conpherence-widget-pane #widgets-calendar .aphront-multi-column-view 218 - .aphront-multi-column-column .sporadic , 219 - .conpherence-widget-pane #widgets-calendar .aphront-multi-column-view 220 - .aphront-multi-column-column .away { 221 - height: 10px; 222 - margin: 5px 0px 5px 0px; 223 - width: 100%; 224 - } 225 - .conpherence-widget-pane #widgets-calendar .aphront-multi-column-view 226 - .aphront-multi-column-column .present { 227 - background-color: white; 228 - } 229 - .conpherence-widget-pane #widgets-calendar .aphront-multi-column-view 230 - .aphront-multi-column-column .sporadic { 231 - background-color: rgb(222, 226, 232); 232 - } 233 - .conpherence-widget-pane #widgets-calendar .aphront-multi-column-view 234 - .aphront-multi-column-column .away { 235 - background-color: rgb(102, 204, 255); 236 - } 237 - .conpherence-widget-pane #widgets-calendar .aphront-multi-column-view 238 - .day-name { 239 - padding: 5px 0px 0px 0px; 240 - font-size: {$smallerfontsize}; 241 - } 242 - .conpherence-widget-pane #widgets-calendar .aphront-multi-column-view 243 - .day-number { 244 - font-size: {$biggestfontsize}; 245 - padding: 0 0 5px 0; 246 - } 247 - 248 - .conpherence-widget-pane #widgets-calendar .day-header { 249 - overflow: hidden; 250 - border-top: 1px solid {$thinblueborder}; 251 - padding: 8px 8px 0px 8px; 252 - } 253 - 254 - .conpherence-widget-pane #widgets-calendar .day-header.today .day-name, 255 - .conpherence-widget-pane #widgets-calendar .day-header.today .day-date { 256 - color: {$sky}; 257 - } 258 - 259 - .conpherence-widget-pane #widgets-calendar .day-header .day-name { 260 - float: left; 261 - color: {$bluetext}; 262 - font-weight: bold; 263 - text-transform: uppercase; 264 - font-size: {$smallestfontsize}; 265 - } 266 - 267 - .conpherence-widget-pane #widgets-calendar .day-header .day-date { 268 - float: right; 269 - color: {$lightbluetext}; 270 - font-size: {$smallestfontsize}; 271 - } 272 - 273 - .conpherence-widget-pane #widgets-calendar .top-border { 274 - border-top: 1px solid {$thinblueborder}; 275 - } 276 - 277 - .conpherence-widget-pane #widgets-calendar .user-status { 278 - padding: 10px 0px 10px 0px; 279 - margin: 0px 0px 0px 10px; 280 - } 281 - 282 - .conpherence-widget-pane #widgets-calendar .user-status .icon { 283 - border-radius: 8px; 284 - height: 8px; 285 - width: 8px; 286 - margin-top: 4px; 287 - float: left; 288 - } 289 - 290 - .conpherence-widget-pane #widgets-calendar .sporadic .icon { 291 - background-color: {$orange}; 292 - } 293 - 294 - .conpherence-widget-pane #widgets-calendar .away .icon { 295 - background-color: {$red}; 296 - } 297 - 298 - .conpherence-widget-pane #widgets-calendar .user-status .description { 299 - width: 195px; 300 - text-overflow: ellipsis; 301 - margin: 0 0 0 16px; 302 - } 303 - 304 - .conpherence-widget-pane #widgets-calendar .user-status .participant { 305 - font-size: {$smallestfontsize}; 306 - color: {$lightgreytext}; 307 - padding-top: 2px; 308 - } 309 - 310 - .device .conpherence-widget-pane #widgets-calendar .user-status .description, 311 - .device .conpherence-widget-pane #widgets-calendar .user-status .participant { 312 - /* we keep these short so no need to change the width */ 313 - } 314 - 315 161 .conpherence-widget-pane .widget-icon { 316 162 display: block; 317 163 height: 14px;