1 |
efrain |
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 core_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 |
}}
|
|
|
34 |
<div{{!
|
|
|
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="{{view}}"{{!
|
|
|
42 |
}}>
|
|
|
43 |
{{> core_calendar/month_navigation }}
|
|
|
44 |
{{> core/overlay_loading}}
|
|
|
45 |
<table id="month-detailed-{{uniqid}}-{{calendarinstanceid}}" class="calendarmonth calendartable mb-0">
|
|
|
46 |
<thead>
|
|
|
47 |
<tr>
|
|
|
48 |
{{# daynames }}
|
|
|
49 |
<th class="header text-xs-center">
|
|
|
50 |
<span class="sr-only">{{fullname}}</span>
|
|
|
51 |
<span aria-hidden="true">{{shortname}}</span>
|
|
|
52 |
</th>
|
|
|
53 |
{{/ daynames }}
|
|
|
54 |
</tr>
|
|
|
55 |
</thead>
|
|
|
56 |
<tbody>
|
|
|
57 |
{{#weeks}}
|
|
|
58 |
<tr data-region="month-view-week">
|
|
|
59 |
{{#prepadding}}
|
|
|
60 |
<td class="dayblank"> </td>
|
|
|
61 |
{{/prepadding}}
|
|
|
62 |
{{#days}}
|
|
|
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}}{{!
|
|
|
69 |
}}{{#hasevents}} hasevent{{/hasevents}}{{!
|
|
|
70 |
}}"
|
|
|
71 |
data-day="{{mday}}"
|
|
|
72 |
data-day-timestamp="{{timestamp}}"
|
|
|
73 |
data-drop-zone="month-view-day"
|
|
|
74 |
data-region="day"
|
|
|
75 |
data-new-event-timestamp="{{neweventtimestamp}}"{{#istoday}} title="{{#str}} today, core_calendar {{/str}}"{{/istoday}}
|
|
|
76 |
{{#hasevents}} data-title="{{viewdaylinktitle}}"{{/hasevents}}>
|
|
|
77 |
<div class="d-none d-md-block hidden-phone text-xs-center">
|
|
|
78 |
<span class="sr-only">{{daytitle}}</span>
|
|
|
79 |
{{#hasevents}}
|
|
|
80 |
<a data-action="view-day-link" href="#" class="aalink day" aria-label="{{viewdaylinktitle}}"
|
|
|
81 |
data-year="{{date.year}}" data-month="{{date.mon}}" data-day="{{mday}}"
|
|
|
82 |
data-courseid="{{courseid}}" data-categoryid="{{categoryid}}"
|
|
|
83 |
data-timestamp="{{timestamp}}"><span class="day-number-circle"><span class="day-number">{{mday}}</span></span></a>
|
|
|
84 |
{{/hasevents}}
|
|
|
85 |
{{^hasevents}}
|
|
|
86 |
<span aria-hidden="true"><span class="day-number-circle"><span class="day-number">{{mday}}</span></span></span>
|
|
|
87 |
{{/hasevents}}
|
|
|
88 |
{{#hasevents}}
|
|
|
89 |
<div data-region="day-content">
|
|
|
90 |
<ul>
|
|
|
91 |
{{#events}}
|
|
|
92 |
{{#underway}}
|
|
|
93 |
<li class="events-underway">[{{{name}}}]</li>
|
|
|
94 |
{{/underway}}
|
|
|
95 |
{{^underway}}
|
|
|
96 |
<li data-region="event-item"
|
|
|
97 |
data-event-component="{{component}}"
|
|
|
98 |
data-event-eventtype="{{eventtype}}"
|
|
|
99 |
data-event-folded="false"
|
|
|
100 |
data-eventtype-{{normalisedeventtype}}="1"
|
|
|
101 |
{{#draggable}}
|
|
|
102 |
draggable="true"
|
|
|
103 |
data-drag-type="move"
|
|
|
104 |
{{#mindaytimestamp}}
|
|
|
105 |
data-min-day-timestamp="{{.}}"
|
|
|
106 |
{{/mindaytimestamp}}
|
|
|
107 |
{{#mindayerror}}
|
|
|
108 |
data-min-day-error="{{.}}"
|
|
|
109 |
{{/mindayerror}}
|
|
|
110 |
{{#maxdaytimestamp}}
|
|
|
111 |
data-max-day-timestamp="{{.}}"
|
|
|
112 |
{{/maxdaytimestamp}}
|
|
|
113 |
{{#maxdayerror}}
|
|
|
114 |
data-max-day-error="{{.}}"
|
|
|
115 |
{{/maxdayerror}}
|
|
|
116 |
{{/draggable}}>
|
|
|
117 |
|
|
|
118 |
<a data-action="view-event" data-event-id="{{id}}" href="{{url}}" title="{{name}}">
|
|
|
119 |
<span class="calendar-circle calendar_event_{{normalisedeventtype}}">
|
|
|
120 |
|
|
|
121 |
</span>
|
|
|
122 |
<span class="eventname">{{{name}}}</span>
|
|
|
123 |
</a>
|
|
|
124 |
</li>
|
|
|
125 |
{{/underway}}
|
|
|
126 |
{{/events}}
|
|
|
127 |
<li data-action="view-more-events" style="display: none">
|
|
|
128 |
<strong>
|
|
|
129 |
<a data-action="view-day-link" href="#" class="aalink day" aria-label="{{viewdaylinktitle}}"
|
|
|
130 |
data-year="{{date.year}}" data-month="{{date.mon}}" data-day="{{mday}}"
|
|
|
131 |
data-courseid="{{courseid}}" data-categoryid="{{categoryid}}"
|
|
|
132 |
data-timestamp="{{timestamp}}">
|
|
|
133 |
{{#str}} moreevents, calendar, {{hasmoreevents}} {{/str}}
|
|
|
134 |
</a>
|
|
|
135 |
</strong>
|
|
|
136 |
</li>
|
|
|
137 |
</ul>
|
|
|
138 |
<div class="hidden">
|
|
|
139 |
{{#events}}
|
|
|
140 |
<div data-popover-eventtype-{{normalisedeventtype}}="1">
|
|
|
141 |
{{> core_calendar/event_icon}}
|
|
|
142 |
{{{name}}}
|
|
|
143 |
</div>
|
|
|
144 |
{{/events}}
|
|
|
145 |
</div>
|
|
|
146 |
</div>
|
|
|
147 |
{{/hasevents}}
|
|
|
148 |
</div>
|
|
|
149 |
<div class="d-md-none hidden-desktop hidden-tablet">
|
|
|
150 |
<span class="sr-only">{{daytitle}}</span>
|
|
|
151 |
{{#hasevents}}
|
|
|
152 |
<a data-action="view-day-link" href="#" class="day aalink" aria-label="{{viewdaylinktitle}}"
|
|
|
153 |
data-year="{{date.year}}" data-month="{{date.mon}}" data-day="{{mday}}"
|
|
|
154 |
data-courseid="{{courseid}}" data-categoryid="{{categoryid}}"
|
|
|
155 |
data-timestamp="{{timestamp}}"><span class="day-number-circle"><span class="day-number">{{mday}}</span></span></a>
|
|
|
156 |
{{/hasevents}}
|
|
|
157 |
{{^hasevents}}
|
|
|
158 |
<span aria-hidden="true"><span class="day-number-circle"><span class="day-number">{{mday}}</span></span></span>
|
|
|
159 |
{{/hasevents}}
|
|
|
160 |
</div>
|
|
|
161 |
</td>
|
|
|
162 |
{{/days}}
|
|
|
163 |
{{#postpadding}}
|
|
|
164 |
<td class="dayblank"> </td>
|
|
|
165 |
{{/postpadding}}
|
|
|
166 |
</tr>
|
|
|
167 |
{{/weeks}}
|
|
|
168 |
</tbody>
|
|
|
169 |
</table>
|
|
|
170 |
</div>
|
|
|
171 |
{{#js}}
|
|
|
172 |
require([
|
|
|
173 |
'jquery',
|
|
|
174 |
'core_calendar/month_view_drag_drop'
|
|
|
175 |
], function(
|
|
|
176 |
$,
|
|
|
177 |
DragDrop
|
|
|
178 |
) {
|
|
|
179 |
var root = $('#month-detailed-{{uniqid}}-{{calendarinstanceid}}');
|
|
|
180 |
DragDrop.init(root);
|
|
|
181 |
});
|
|
|
182 |
{{/js}}
|