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

When a Calendar day has too many events, show a "More..." link

Summary: Fixes T8361.

Test Plan: {F1739073}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T8361

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

+41 -5
+35 -2
src/view/phui/calendar/PHUICalendarListView.php
··· 5 5 private $events = array(); 6 6 private $blankState; 7 7 private $view; 8 + private $moreLink; 9 + 10 + public function setMoreLink($more_link) { 11 + $this->moreLink = $more_link; 12 + return $this; 13 + } 14 + 15 + public function getMoreLink() { 16 + return $this->moreLink; 17 + } 8 18 9 19 private function getView() { 10 20 return $this->view; ··· 60 70 $icon_icon = $event->getIcon(); 61 71 $icon_color = $event->getIconColor(); 62 72 63 - $dot = id(new PHUIIconView()) 73 + $icon = id(new PHUIIconView()) 64 74 ->setIcon($icon_icon, $icon_color) 65 75 ->addClass('phui-calendar-list-item-icon'); 66 76 ··· 108 118 ), 109 119 ), 110 120 array( 111 - $dot, 121 + $icon, 112 122 $time, 113 123 $title, 114 124 )); ··· 119 129 'class' => implode(' ', $event_classes), 120 130 ), 121 131 $content); 132 + } 133 + 134 + if ($this->moreLink) { 135 + $singletons[] = phutil_tag( 136 + 'li', 137 + array( 138 + 'class' => 'phui-calendar-list-item', 139 + ), 140 + phutil_tag( 141 + 'a', 142 + array( 143 + 'href' => $this->moreLink, 144 + 'class' => 'phui-calendar-list-more', 145 + ), 146 + array( 147 + id(new PHUIIconView())->setIcon('fa-ellipsis-h grey'), 148 + phutil_tag( 149 + 'span', 150 + array( 151 + 'class' => 'phui-calendar-list-title', 152 + ), 153 + pht('View More...')), 154 + ))); 122 155 } 123 156 124 157 if (empty($singletons)) {
+6 -3
src/view/phui/calendar/PHUICalendarMonthView.php
··· 95 95 ->setViewer($viewer) 96 96 ->setView('month'); 97 97 foreach ($all_day_events as $item) { 98 - if ($counter <= $max_daily) { 98 + if ($counter < $max_daily) { 99 99 $list->addEvent($item); 100 100 } 101 101 $counter++; 102 102 } 103 103 foreach ($list_events as $item) { 104 - if ($counter <= $max_daily) { 104 + if ($counter < $max_daily) { 105 105 $list->addEvent($item); 106 106 } 107 107 $counter++; ··· 112 112 $day->format('m').'/'. 113 113 $day->format('d').'/'; 114 114 115 - $day_id = $day->format('Ymd'); 115 + if ($counter > $max_daily) { 116 + $list->setMoreLink($uri); 117 + } 116 118 119 + $day_id = $day->format('Ymd'); 117 120 118 121 $classes = array(); 119 122 if ($day->format('m') != $this->month) {