MDL-60058 assign: allow update of assign calendar action events
[moodle.git] / calendar / templates / month_detailed.mustache
CommitLineData
a4af4c96
SL
1{{!
2 This file is part of Moodle - http://moodle.org/
3
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.
8
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.
13
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/>.
16}}
17{{!
18 @template calendar/month_detailed
19
20 Calendar month view.
21
22 The purpose of this template is to render the month view.
23
24 Classes required for JS:
25 * none
26
27 Data attributes required for JS:
28 * none
29
30 Example context (json):
31 {
32 }
33}}
3fb45f57
AN
34<div{{!
35 }} class="calendarwrapper"{{!
d0e56d84
AN
36 }}{{#courseid}} data-courseid="{{courseid}}"{{/courseid}}{{!
37 }}{{#categoryid}} data-categoryid="{{categoryid}}"{{/categoryid}}{{!
e00aed51 38 }} data-context-id="{{defaulteventcontext}}"{{!
3fb45f57
AN
39 }} data-month="{{date.mon}}"{{!
40 }} data-year="{{date.year}}"{{!
3ea4f446 41 }} data-view="month"{{!
3fb45f57 42 }}>
ac671b37 43 {{> core_calendar/header }}
64ff737a 44 {{> core_calendar/month_navigation }}
b31a1695 45 {{> core/overlay_loading}}
aefb2950 46 <table id="month-detailed-{{uniqid}}" class="calendarmonth calendartable card-deck m-b-0">
64ff737a
AN
47 <thead>
48 <tr>
49 {{# daynames }}
50 <th class="header text-xs-center">
51 {{shortname}}
52 </th>
53 {{/ daynames }}
54 </tr>
55 </thead>
56 <tbody>
57 {{#weeks}}
5ca142dc 58 <tr data-region="month-view-week">
64ff737a
AN
59 {{#prepadding}}
60 <td class="dayblank">&nbsp;</td>
61 {{/prepadding}}
62 {{#days}}
f6e8cc83 63 <td class="clickable day text-sm-center text-md-left{{!
64ff737a
AN
64 }}{{#istoday}} today{{/istoday}}{{!
65 }}{{#isweekend}} weekend{{/isweekend}}{{!
66 }}{{#durationevents.0}} duration{{/durationevents.0}}{{!
67 }}{{#durationevents}} duration_{{.}}{{/durationevents}}{{!
5ca142dc
RW
68 }}"
69 data-day-timestamp="{{timestamp}}"
aefb2950 70 data-drop-zone="month-view-day"
f6e8cc83
RW
71 data-region="day"
72 data-new-event-timestamp="{{neweventtimestamp}}">
64ff737a
AN
73 <div class="hidden-sm-down text-xs-center">
74 {{#events.0}}
f6e8cc83 75 <a data-action="view-day-link" href="{{viewdaylink}}" class="day" title="{{viewdaylinktitle}}">{{mday}}</a>
64ff737a
AN
76 {{/events.0}}
77 {{^events.0}}
78 {{mday}}
79 {{/events.0}}
80 {{#events.0}}
5ca142dc
RW
81 <div data-region="day-content">
82 <ul>
83 {{#events}}
64ff737a
AN
84 {{#underway}}
85 <li class="events-underway">[{{name}}]</li>
86 {{/underway}}
87 {{^underway}}
fc60d319 88 <li class="calendar_event_{{calendareventtype}}"
f6e8cc83 89 data-region="event-item"
fc60d319 90 data-eventtype-{{calendareventtype}}="1"
5ca142dc
RW
91 {{#canedit}}
92 draggable="true"
93 data-drag-type="move"
94 {{/canedit}}>
95
64ff737a
AN
96 <a data-action="view-event" data-event-id="{{id}}" href="{{url}}">{{name}}</a>
97 </li>
98 {{/underway}}
5ca142dc
RW
99 {{/events}}
100 </ul>
101 </div>
64ff737a
AN
102 {{/events.0}}
103 </div>
836aa3f6 104 <div class="hidden-md-up hidden-desktop">
64ff737a
AN
105 {{#events.0}}
106 <a href="{{viewdaylink}}" class="day" title="{{viewdaylinktitle}}">{{mday}}</a>
107 {{/events.0}}
108 {{^events.0}}
5ca142dc
RW
109 <div data-region="day-content">
110 {{mday}}
111 </div>
64ff737a
AN
112 {{/events.0}}
113 </div>
114 </td>
115 {{/days}}
116 {{#postpadding}}
117 <td class="dayblank">&nbsp;</td>
118 {{/postpadding}}
119 </tr>
120 {{/weeks}}
121 </tbody>
122 </table>
f6e8cc83 123</div>
5ca142dc 124{{#js}}
fc60d319
AN
125require([
126 'jquery',
127 'core_calendar/month_view_drag_drop',
128 'core_calendar/selectors',
129 'core_calendar/events',
130], function(
131 $,
132 DragDrop,
133 CalendarSelectors,
134 CalendarEvents
135) {
5ca142dc
RW
136 var root = $('#month-detailed-{{uniqid}}');
137 DragDrop.init(root);
fc60d319
AN
138
139 $('body').on(CalendarEvents.filterChanged, function(e, data) {
140 M.util.js_pending("month-detailed-{{uniqid}}-filterChanged");
141 // A filter value has been changed.
142 // Find all matching cells in the popover data, and hide them.
143 $("#month-detailed-{{uniqid}}")
144 .find(CalendarSelectors.eventType[data.type])
145 .toggleClass('hidden', !!data.hidden);
146 M.util.js_complete("month-detailed-{{uniqid}}-filterChanged");
147 });
5ca142dc
RW
148});
149{{/js}}