2 This file is part of Moodle - http://moodle.org/
4 Moodle is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 Moodle is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with Moodle. If not, see <http://www.gnu.org/licenses/>.
18 @template calendar/month_detailed
22 The purpose of this template is to render the month view.
24 Classes required for JS:
27 Data attributes required for JS:
30 Example context (json):
35 }} class="calendarwrapper"{{!
36 }}{{#courseid}} data-courseid="{{courseid}}"{{/courseid}}{{!
37 }}{{#categoryid}} data-categoryid="{{categoryid}}"{{/categoryid}}{{!
38 }} data-context-id="{{defaulteventcontext}}"{{!
39 }} data-month="{{date.mon}}"{{!
40 }} data-year="{{date.year}}"{{!
41 }} data-view="month"{{!
43 {{> core_calendar/header }}
44 {{> core_calendar/month_navigation }}
45 {{> core/overlay_loading}}
46 <table id="month-detailed-{{uniqid}}" class="calendarmonth calendartable card-deck m-b-0">
50 <th class="header text-xs-center">
58 <tr data-region="month-view-week">
60 <td class="dayblank"> </td>
63 <td class="day text-sm-center text-md-left{{!
64 }}{{#istoday}} today{{/istoday}}{{!
65 }}{{#isweekend}} weekend{{/isweekend}}{{!
66 }}{{#durationevents.0}} duration{{/durationevents.0}}{{!
67 }}{{#durationevents}} duration_{{.}}{{/durationevents}}{{!
68 }}{{#defaulteventcontext}} clickable{{/defaulteventcontext}}{{!
70 data-day-timestamp="{{timestamp}}"
71 data-drop-zone="month-view-day"
73 data-new-event-timestamp="{{neweventtimestamp}}">
74 <div class="hidden-sm-down hidden-phone text-xs-center">
76 <a data-action="view-day-link" href="{{viewdaylink}}" class="day" title="{{viewdaylinktitle}}">{{mday}}</a>
82 <div data-region="day-content">
86 <li class="events-underway">[{{name}}]</li>
89 <li data-region="event-item"
90 data-eventtype-{{calendareventtype}}="1"
95 data-min-day-timestamp="{{.}}"
98 data-min-day-error="{{.}}"
101 data-max-day-timestamp="{{.}}"
104 data-max-day-error="{{.}}"
108 <a data-action="view-event" data-event-id="{{id}}" href="{{url}}" title="{{name}}">
109 <span class="badge badge-circle calendar_event_{{calendareventtype}}">
112 {{> core_calendar/event_icon}}
113 <span class="eventname">{{name}}</span>
122 <div class="hidden-md-up hidden-desktop hidden-tablet">
124 <a data-action="view-day-link" href="{{viewdaylink}}" class="day" title="{{viewdaylinktitle}}">{{mday}}</a>
127 <div data-region="day-content">
135 <td class="dayblank"> </td>
145 'core_calendar/month_view_drag_drop',
146 'core_calendar/selectors',
147 'core_calendar/events',
154 var root = $('#month-detailed-{{uniqid}}');
157 $('body').on(CalendarEvents.filterChanged, function(e, data) {
158 M.util.js_pending("month-detailed-{{uniqid}}-filterChanged");
159 // A filter value has been changed.
160 // Find all matching cells in the popover data, and hide them.
161 var target = $("#month-detailed-{{uniqid}}").find(CalendarSelectors.eventType[data.type]);
163 var transitionPromise = $.Deferred();
165 transitionPromise.then(function() {
166 return target.slideUp('fast').promise();
169 transitionPromise.then(function() {
170 return target.slideDown('fast').promise();
174 transitionPromise.then(function() {
175 M.util.js_complete("month-detailed-{{uniqid}}-filterChanged");
180 transitionPromise.resolve();