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

Provide better headers and crumbs for Calendar result views

Summary:
Ref T11326. This isn't perfect, but should be a little easier to use and less weird/confusing.

Generally, provide a "Query > Month > Day" crumb on day views, and a "Wed, July 3" header.

Generally, provide a "Query > Month" crumb on month views, and a "July 2019" header.

Also try to fix a bit of padding/spacing on the day view.

Test Plan: {F1739128}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11326

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

+112 -35
+4 -4
resources/celerity/map.php
··· 115 115 'rsrc/css/layout/phabricator-filetree-view.css' => 'fccf9f82', 116 116 'rsrc/css/layout/phabricator-side-menu-view.css' => 'dd849797', 117 117 'rsrc/css/layout/phabricator-source-code-view.css' => 'cbeef983', 118 - 'rsrc/css/phui/calendar/phui-calendar-day.css' => 'f15bb6d6', 119 - 'rsrc/css/phui/calendar/phui-calendar-list.css' => '5d89cd71', 118 + 'rsrc/css/phui/calendar/phui-calendar-day.css' => '572b1893', 119 + 'rsrc/css/phui/calendar/phui-calendar-list.css' => 'fcc9fb41', 120 120 'rsrc/css/phui/calendar/phui-calendar-month.css' => '8e10e92c', 121 121 'rsrc/css/phui/calendar/phui-calendar.css' => 'daadaf39', 122 122 'rsrc/css/phui/phui-action-list.css' => 'c5eba19d', ··· 828 828 'phui-box-css' => '5c8387cf', 829 829 'phui-button-css' => '4a5fbe3d', 830 830 'phui-calendar-css' => 'daadaf39', 831 - 'phui-calendar-day-css' => 'f15bb6d6', 832 - 'phui-calendar-list-css' => '5d89cd71', 831 + 'phui-calendar-day-css' => '572b1893', 832 + 'phui-calendar-list-css' => 'fcc9fb41', 833 833 'phui-calendar-month-css' => '8e10e92c', 834 834 'phui-chart-css' => '6bf6f78e', 835 835 'phui-crumbs-view-css' => 'b4fa5755',
+45 -4
src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
··· 362 362 $month_view->setBrowseURI( 363 363 $this->getURI('query/'.$query->getQueryKey().'/')); 364 364 365 + $from = $this->getQueryDateFrom($query)->getDateTime(); 366 + 367 + $crumbs = array(); 368 + $crumbs[] = id(new PHUICrumbView()) 369 + ->setName($from->format('F Y')); 370 + 371 + $header = id(new PHUIHeaderView()) 372 + ->setHeader($from->format('F Y')); 373 + 365 374 return id(new PhabricatorApplicationSearchResultView()) 375 + ->setCrumbs($crumbs) 376 + ->setHeader($header) 366 377 ->setContent($month_view) 367 378 ->setCollapsed(true); 368 379 } ··· 380 391 $query->getParameter('display')); 381 392 382 393 $day_view = id(new PHUICalendarDayView( 383 - $this->getQueryDateFrom($query)->getEpoch(), 384 - $this->getQueryDateTo($query)->getEpoch(), 394 + $this->getQueryDateFrom($query), 395 + $this->getQueryDateTo($query), 385 396 $start_year, 386 397 $start_month, 387 398 $start_day)) ··· 417 428 $day_view->addEvent($event_view); 418 429 } 419 430 420 - $day_view->setBrowseURI( 421 - $this->getURI('query/'.$query->getQueryKey().'/')); 431 + $browse_uri = $this->getURI('query/'.$query->getQueryKey().'/'); 432 + $day_view->setBrowseURI($browse_uri); 433 + 434 + $from = $this->getQueryDateFrom($query)->getDateTime(); 435 + $month_uri = $browse_uri.$from->format('Y/m/'); 436 + 437 + $crumbs = array( 438 + id(new PHUICrumbView()) 439 + ->setName($from->format('F Y')) 440 + ->setHref($month_uri), 441 + id(new PHUICrumbView()) 442 + ->setName($from->format('D jS')), 443 + ); 444 + 445 + $header = id(new PHUIHeaderView()) 446 + ->setHeader($from->format('D, F jS')); 422 447 423 448 return id(new PhabricatorApplicationSearchResultView()) 449 + ->setCrumbs($crumbs) 450 + ->setHeader($header) 424 451 ->setContent($day_view) 425 452 ->setCollapsed(true); 426 453 } ··· 466 493 } 467 494 468 495 private function getQueryDateFrom(PhabricatorSavedQuery $saved) { 496 + if ($this->calendarYear && $this->calendarMonth) { 497 + $viewer = $this->requireViewer(); 498 + 499 + $start_year = $this->calendarYear; 500 + $start_month = $this->calendarMonth; 501 + $start_day = $this->calendarDay ? $this->calendarDay : 1; 502 + 503 + return AphrontFormDateControlValue::newFromDictionary( 504 + $viewer, 505 + array( 506 + 'd' => "{$start_year}-{$start_month}-{$start_day}", 507 + )); 508 + } 509 + 469 510 return $this->getQueryDate($saved, 'rangeStart'); 470 511 } 471 512
+20 -3
src/applications/search/controller/PhabricatorApplicationSearchController.php
··· 210 210 } 211 211 212 212 $body[] = $box; 213 - 213 + $more_crumbs = null; 214 214 215 215 if ($run_query) { 216 216 $exec_errors = array(); ··· 272 272 $box->setCollapsed(true); 273 273 } 274 274 275 + $result_header = $list->getHeader(); 276 + if ($result_header) { 277 + $box->setHeader($result_header); 278 + } 279 + 280 + $more_crumbs = $list->getCrumbs(); 281 + 275 282 if ($pager->willShowPagingControls()) { 276 283 $pager_box = id(new PHUIBoxView()) 277 284 ->addPadding(PHUI::PADDING_MEDIUM) ··· 301 308 } 302 309 303 310 $crumbs = $parent 304 - ->buildApplicationCrumbs() 305 - ->addTextCrumb($title); 311 + ->buildApplicationCrumbs(); 312 + 313 + if ($more_crumbs) { 314 + $query_uri = $engine->getQueryResultsPageURI($saved_query->getQueryKey()); 315 + $crumbs->addTextCrumb($title, $query_uri); 316 + 317 + foreach ($more_crumbs as $crumb) { 318 + $crumbs->addCrumb($crumb); 319 + } 320 + } else { 321 + $crumbs->addTextCrumb($title); 322 + } 306 323 307 324 return $this->newPage() 308 325 ->setApplicationMenu($this->buildApplicationMenu())
+24
src/applications/search/view/PhabricatorApplicationSearchResultView.php
··· 14 14 private $actions = array(); 15 15 private $collapsed = null; 16 16 private $noDataString; 17 + private $crumbs = array(); 18 + private $header; 17 19 18 20 public function setObjectList(PHUIObjectItemListView $list) { 19 21 $this->objectList = $list; ··· 81 83 $this->noDataString = $nodata; 82 84 return $this; 83 85 } 86 + 87 + public function setCrumbs(array $crumbs) { 88 + assert_instances_of($crumbs, 'PHUICrumbView'); 89 + 90 + $this->crumbs = $crumbs; 91 + return $this; 92 + } 93 + 94 + public function getCrumbs() { 95 + return $this->crumbs; 96 + } 97 + 98 + public function setHeader(PHUIHeaderView $header) { 99 + $this->header = $header; 100 + return $this; 101 + } 102 + 103 + public function getHeader() { 104 + return $this->header; 105 + } 106 + 107 + 84 108 85 109 }
-21
src/view/form/control/AphrontFormDateControlValue.php
··· 59 59 return $this->viewer; 60 60 } 61 61 62 - public static function newFromParts( 63 - PhabricatorUser $viewer, 64 - $year, 65 - $month, 66 - $day, 67 - $time = null, 68 - $enabled = true) { 69 - 70 - $value = new AphrontFormDateControlValue(); 71 - $value->viewer = $viewer; 72 - list($value->valueDate, $value->valueTime) = 73 - $value->getFormattedDateFromParts( 74 - $year, 75 - $month, 76 - $day, 77 - coalesce($time, '12:00 AM')); 78 - $value->valueEnabled = $enabled; 79 - 80 - return $value; 81 - } 82 - 83 62 public static function newFromRequest(AphrontRequest $request, $key) { 84 63 $value = new AphrontFormDateControlValue(); 85 64 $value->viewer = $request->getViewer();
+1 -2
src/view/phui/calendar/PHUICalendarMonthView.php
··· 445 445 446 446 } 447 447 448 - $header = id(new PHUIHeaderView()) 449 - ->setHeader($date->format('F Y')); 448 + $header = id(new PHUIHeaderView()); 450 449 451 450 if ($button_bar) { 452 451 $header->setButtonBar($button_bar);
-1
webroot/rsrc/css/phui/calendar/phui-calendar-day.css
··· 92 92 background-color: {$bluebackground}; 93 93 color: {$greytext}; 94 94 text-decoration: none; 95 - text-decoration: none; 96 95 } 97 96 98 97 .day-view-all-day {
+18
webroot/rsrc/css/phui/calendar/phui-calendar-list.css
··· 66 66 67 67 .phui-calendar-list-item-empty { 68 68 color: {$lightgreytext}; 69 + padding: 0 12px; 70 + font-style: italic; 71 + } 72 + 73 + .phui-calendar-list-item.all-day { 74 + background: {$bluebackground}; 75 + } 76 + 77 + .calendar-day-view-sidebar .phui-calendar-list { 78 + padding: 12px 0; 79 + } 80 + 81 + .calendar-day-view-sidebar .phui-calendar-list-item { 82 + padding: 0 12px; 83 + } 84 + 85 + .calendar-day-view-sidebar .phui-calendar-list-item a { 86 + position: relative; 69 87 }