MDL-52258 calendar: show event duration on block

Highlight the days on the calendar for the entire duration
of the event, not just the start day. The days are highlighted
with the same colour as the starting day and will also show
the event popup on hover.
This commit is contained in:
Ryan Wyllie
2015-12-10 11:17:25 +01:00
committed by Juan Segarra Montesinos
parent 0dfcc2541a
commit 4f2ff25ed1
3 changed files with 33 additions and 4 deletions
+11 -2
View File
@@ -338,7 +338,16 @@ function calendar_get_mini($courses, $groups, $users, $calmonth = false, $calyea
$class = 'day';
}
if (isset($eventsbyday[$day])) {
$eventids = array();
if (!empty($eventsbyday[$day])) {
$eventids = $eventsbyday[$day];
}
if (!empty($durationbyday[$day])) {
$eventids = array_unique(array_merge($eventids, $durationbyday[$day]));
}
if (!empty($eventids)) {
// There is at least one event on this day.
$class .= ' hasevent';
@@ -346,7 +355,7 @@ function calendar_get_mini($courses, $groups, $users, $calmonth = false, $calyea
$dayhref = calendar_get_link_href(new moodle_url(CALENDAR_URL . 'view.php', $hrefparams), 0, 0, 0, $daytime);
$popupcontent = '';
foreach($eventsbyday[$day] as $eventid) {
foreach($eventids as $eventid) {
if (!isset($events[$eventid])) {
continue;
}
@@ -20,6 +20,22 @@
background-color: @calendarEventUserColor;
}
.duration_global {
background-color: @calendarEventGlobalColor;
}
.duration_course {
background-color: @calendarEventCourseColor;
}
.duration_group {
background-color: @calendarEventGroupColor;
}
.duration_user {
background-color: @calendarEventUserColor;
}
// Calendar restyling.
.path-calendar {
.calendartable {
@@ -314,6 +330,10 @@
td {
&.weekend {
.muted;
a {
.muted;
}
}
a {
width: 100%;
File diff suppressed because one or more lines are too long