Page MenuHomePhabricator

D16337.id.diff
No OneTemporary

D16337.id.diff

diff --git a/src/view/phui/calendar/PHUICalendarListView.php b/src/view/phui/calendar/PHUICalendarListView.php
--- a/src/view/phui/calendar/PHUICalendarListView.php
+++ b/src/view/phui/calendar/PHUICalendarListView.php
@@ -5,6 +5,16 @@
private $events = array();
private $blankState;
private $view;
+ private $moreLink;
+
+ public function setMoreLink($more_link) {
+ $this->moreLink = $more_link;
+ return $this;
+ }
+
+ public function getMoreLink() {
+ return $this->moreLink;
+ }
private function getView() {
return $this->view;
@@ -60,7 +70,7 @@
$icon_icon = $event->getIcon();
$icon_color = $event->getIconColor();
- $dot = id(new PHUIIconView())
+ $icon = id(new PHUIIconView())
->setIcon($icon_icon, $icon_color)
->addClass('phui-calendar-list-item-icon');
@@ -108,7 +118,7 @@
),
),
array(
- $dot,
+ $icon,
$time,
$title,
));
@@ -121,6 +131,29 @@
$content);
}
+ if ($this->moreLink) {
+ $singletons[] = phutil_tag(
+ 'li',
+ array(
+ 'class' => 'phui-calendar-list-item',
+ ),
+ phutil_tag(
+ 'a',
+ array(
+ 'href' => $this->moreLink,
+ 'class' => 'phui-calendar-list-more',
+ ),
+ array(
+ id(new PHUIIconView())->setIcon('fa-ellipsis-h grey'),
+ phutil_tag(
+ 'span',
+ array(
+ 'class' => 'phui-calendar-list-title',
+ ),
+ pht('View More...')),
+ )));
+ }
+
if (empty($singletons)) {
$singletons[] = phutil_tag(
'li',
diff --git a/src/view/phui/calendar/PHUICalendarMonthView.php b/src/view/phui/calendar/PHUICalendarMonthView.php
--- a/src/view/phui/calendar/PHUICalendarMonthView.php
+++ b/src/view/phui/calendar/PHUICalendarMonthView.php
@@ -95,13 +95,13 @@
->setViewer($viewer)
->setView('month');
foreach ($all_day_events as $item) {
- if ($counter <= $max_daily) {
+ if ($counter < $max_daily) {
$list->addEvent($item);
}
$counter++;
}
foreach ($list_events as $item) {
- if ($counter <= $max_daily) {
+ if ($counter < $max_daily) {
$list->addEvent($item);
}
$counter++;
@@ -112,8 +112,11 @@
$day->format('m').'/'.
$day->format('d').'/';
- $day_id = $day->format('Ymd');
+ if ($counter > $max_daily) {
+ $list->setMoreLink($uri);
+ }
+ $day_id = $day->format('Ymd');
$classes = array();
if ($day->format('m') != $this->month) {

File Metadata

Mime Type
text/plain
Expires
Thu, Oct 24, 7:34 AM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6724282
Default Alt Text
D16337.id.diff (2 KB)

Event Timeline