Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14014715
D12820.id30815.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
D12820.id30815.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -122,7 +122,7 @@
'rsrc/css/layout/phabricator-source-code-view.css' => '2ceee894',
'rsrc/css/phui/calendar/phui-calendar-day.css' => '38891735',
'rsrc/css/phui/calendar/phui-calendar-list.css' => 'c1d0ca59',
- 'rsrc/css/phui/calendar/phui-calendar-month.css' => '4c39f6d9',
+ 'rsrc/css/phui/calendar/phui-calendar-month.css' => '75e6a2ee',
'rsrc/css/phui/calendar/phui-calendar.css' => '8675968e',
'rsrc/css/phui/phui-action-header-view.css' => '89c497e7',
'rsrc/css/phui/phui-action-list.css' => '4f4d09f2',
@@ -779,7 +779,7 @@
'phui-calendar-css' => '8675968e',
'phui-calendar-day-css' => '38891735',
'phui-calendar-list-css' => 'c1d0ca59',
- 'phui-calendar-month-css' => '4c39f6d9',
+ 'phui-calendar-month-css' => '75e6a2ee',
'phui-crumbs-view-css' => '594d719e',
'phui-document-view-css' => '94d5dcd8',
'phui-feed-story-css' => 'c9f3a0b5',
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
@@ -75,6 +75,8 @@
$empty_cell = array(
'list' => null,
'date' => null,
+ 'uri' => null,
+ 'count' => 0,
'class' => null,
);
@@ -137,9 +139,16 @@
$list->addEvent($item);
}
+ $uri = $this->getBrowseURI();
+ $uri = $uri.$day->format('Y').'/'.
+ $day->format('m').'/'.
+ $day->format('d').'/';
+
$markup[] = array(
'list' => $list,
'date' => $day,
+ 'uri' => $uri,
+ 'count' => count($all_day_events) + count($list_events),
'class' => $class,
);
}
@@ -149,33 +158,78 @@
foreach ($rows as $row) {
$cells = array();
+ $event_count_badge = null;
+
while (count($row) < 7) {
$row[] = $empty_cell;
}
foreach ($row as $cell) {
$cell_list = $cell['list'];
$class = $cell['class'];
+ $uri = $cell['uri'];
+ $count = $cell['count'];
+
+ $event_count = null;
+ if ($count > 0) {
+ $event_count = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'phui-calendar-month-count-badge',
+ ),
+ $count);
+ }
+
+ $event_count_badge = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'phui-calendar-month-event-count',
+ ),
+ $event_count);
+
+ $cell_day_secret_link = phutil_tag(
+ 'a',
+ array(
+ 'class' => 'phui-calendar-month-secret-link',
+ 'href' => $uri,
+ ),
+ null);
+
+ $cell_div = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'phui-calendar-month-cell-div',
+ ),
+ array(
+ $cell_day_secret_link,
+ $event_count_badge,
+ $cell_list,
+ ));
+
$cells[] = phutil_tag(
'td',
array(
'class' => 'phui-calendar-month-event-list '.$class,
),
- $cell_list);
+ $cell_div);
}
$table[] = phutil_tag('tr', array(), $cells);
$cells = array();
foreach ($row as $cell) {
$class = $cell['class'];
+ $cell_day_secret_link = null;
if ($cell['date']) {
$cell_day = $cell['date'];
+ $uri = $cell['uri'];
- $uri = $this->getBrowseURI();
- $date = $cell['date'];
- $uri = $uri.$date->format('Y').'/'.
- $date->format('m').'/'.
- $date->format('d').'/';
+ $cell_day_secret_link = phutil_tag(
+ 'a',
+ array(
+ 'class' => 'phui-calendar-month-secret-link',
+ 'href' => $uri,
+ ),
+ null);
$cell_day = phutil_tag(
'a',
@@ -202,15 +256,23 @@
),
null);
- $cells[] = phutil_tag(
- 'td',
+ $cell_div = phutil_tag(
+ 'div',
array(
- 'class' => 'phui-calendar-date-number-container '.$class,
+ 'class' => 'phui-calendar-month-cell-div',
),
array(
+ $cell_day_secret_link,
$cell_day,
$today_slot,
));
+
+ $cells[] = phutil_tag(
+ 'td',
+ array(
+ 'class' => 'phui-calendar-date-number-container '.$class,
+ ),
+ $cell_div);
}
$table[] = phutil_tag('tr', array(), $cells);
}
diff --git a/webroot/rsrc/css/phui/calendar/phui-calendar-month.css b/webroot/rsrc/css/phui/calendar/phui-calendar-month.css
--- a/webroot/rsrc/css/phui/calendar/phui-calendar-month.css
+++ b/webroot/rsrc/css/phui/calendar/phui-calendar-month.css
@@ -22,12 +22,55 @@
width: 14.2857%; /* This is one seventh, approximately. */
}
+.phui-calendar-month-cell-div {
+ position: relative;
+}
+
+.phui-calendar-month-event-list .phui-calendar-month-cell-div {
+ min-height: 125px;
+}
+
+.device .phui-calendar-month-event-list .phui-calendar-month-cell-div {
+ min-height: 60px;
+}
+
+a.phui-calendar-month-secret-link {
+ position: absolute;
+ left: 0;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ outline: 0;
+}
+
table.phui-calendar-view tr td:first-child {
border-left-width: 0px;
}
-table.phui-calendar-view .phui-calendar-event-list {
- min-height: 125px;
+.device table.phui-calendar-view .phui-calendar-event-list {
+ display: none;
+}
+
+.phui-calendar-month-event-count {
+ display: none;
+}
+
+.device .phui-calendar-month-event-count {
+ display: block;
+ text-align: center;
+ padding-top: 12px;
+}
+
+.phui-calendar-month-event-count .phui-calendar-month-count-badge {
+ border: 1px solid {$lightgreyborder};
+ color: {$lightgreytext};
+ width: 20px;
+ height: 20px;
+ border-radius: 50%;
+ text-align: center;
+ vertical-align: middle;
+ padding: 5px 3px 0px 3px;
+ margin: 0 auto;
}
table.phui-calendar-view a.phui-calendar-date-number {
@@ -79,6 +122,8 @@
margin: 0;
padding: 4px 8px;
background-color: {$lightpink};
+ display: block;
+ float: none;
}
li.phui-calendar-list-item.all-day:first-child {
@@ -87,6 +132,9 @@
.phui-calendar-view .phui-calendar-list li {
margin: 0 8px;
+ display: inline-block;
+ float: left;
+ clear: both;
}
.phui-calendar-view .phui-calendar-list li:first-child {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 4, 6:50 AM (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6711960
Default Alt Text
D12820.id30815.diff (6 KB)
Attached To
Mode
D12820: Month view should adjust to display badges with event count instead of event list on mobile and tablets.
Attached
Detach File
Event Timeline
Log In to Comment