MDL-59392 calendar: Switch to templates in the cal block
[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}}
aefb2950 34<div class="calendarwrapper" data-courseid="{{courseid}}" data-current-time="{{time}}">
64ff737a
AN
35 {{> core_calendar/month_header }}
36 {{> core_calendar/month_navigation }}
b31a1695 37 {{> core/overlay_loading}}
aefb2950 38 <table id="month-detailed-{{uniqid}}" class="calendarmonth calendartable card-deck m-b-0">
64ff737a
AN
39 <thead>
40 <tr>
41 {{# daynames }}
42 <th class="header text-xs-center">
43 {{shortname}}
44 </th>
45 {{/ daynames }}
46 </tr>
47 </thead>
48 <tbody>
49 {{#weeks}}
5ca142dc 50 <tr data-region="month-view-week">
64ff737a
AN
51 {{#prepadding}}
52 <td class="dayblank">&nbsp;</td>
53 {{/prepadding}}
54 {{#days}}
f6e8cc83 55 <td class="clickable day text-sm-center text-md-left{{!
64ff737a
AN
56 }}{{#istoday}} today{{/istoday}}{{!
57 }}{{#isweekend}} weekend{{/isweekend}}{{!
58 }}{{#durationevents.0}} duration{{/durationevents.0}}{{!
59 }}{{#durationevents}} duration_{{.}}{{/durationevents}}{{!
5ca142dc
RW
60 }}"
61 data-day-timestamp="{{timestamp}}"
aefb2950 62 data-drop-zone="month-view-day"
f6e8cc83
RW
63 data-region="day"
64 data-new-event-timestamp="{{neweventtimestamp}}">
64ff737a
AN
65 <div class="hidden-sm-down text-xs-center">
66 {{#events.0}}
f6e8cc83 67 <a data-action="view-day-link" href="{{viewdaylink}}" class="day" title="{{viewdaylinktitle}}">{{mday}}</a>
64ff737a
AN
68 {{/events.0}}
69 {{^events.0}}
70 {{mday}}
71 {{/events.0}}
72 {{#events.0}}
5ca142dc
RW
73 <div data-region="day-content">
74 <ul>
75 {{#events}}
64ff737a
AN
76 {{#underway}}
77 <li class="events-underway">[{{name}}]</li>
78 {{/underway}}
79 {{^underway}}
5ca142dc 80 <li class="calendar_event_{{eventtype}}"
f6e8cc83 81 data-region="event-item"
5ca142dc
RW
82 {{#canedit}}
83 draggable="true"
84 data-drag-type="move"
85 {{/canedit}}>
86
64ff737a
AN
87 <a data-action="view-event" data-event-id="{{id}}" href="{{url}}">{{name}}</a>
88 </li>
89 {{/underway}}
5ca142dc
RW
90 {{/events}}
91 </ul>
92 </div>
64ff737a
AN
93 {{/events.0}}
94 </div>
836aa3f6 95 <div class="hidden-md-up hidden-desktop">
64ff737a
AN
96 {{#events.0}}
97 <a href="{{viewdaylink}}" class="day" title="{{viewdaylinktitle}}">{{mday}}</a>
98 {{/events.0}}
99 {{^events.0}}
5ca142dc
RW
100 <div data-region="day-content">
101 {{mday}}
102 </div>
64ff737a
AN
103 {{/events.0}}
104 </div>
105 </td>
106 {{/days}}
107 {{#postpadding}}
108 <td class="dayblank">&nbsp;</td>
109 {{/postpadding}}
110 </tr>
111 {{/weeks}}
112 </tbody>
113 </table>
f6e8cc83 114</div>
5ca142dc 115{{#js}}
aefb2950 116require(['jquery', 'core_calendar/month_view_drag_drop'], function($, DragDrop) {
5ca142dc
RW
117 var root = $('#month-detailed-{{uniqid}}');
118 DragDrop.init(root);
119});
120{{/js}}