2017-08-08 08:11:31 +08:00
|
|
|
{{!
|
|
|
|
This file is part of Moodle - http://moodle.org/
|
|
|
|
|
|
|
|
Moodle is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Moodle is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
}}
|
|
|
|
{{!
|
|
|
|
@template calendar/month_detailed
|
|
|
|
|
|
|
|
Calendar month view.
|
|
|
|
|
|
|
|
The purpose of this template is to render the month view.
|
|
|
|
|
|
|
|
Classes required for JS:
|
|
|
|
* none
|
|
|
|
|
|
|
|
Data attributes required for JS:
|
|
|
|
* none
|
|
|
|
|
|
|
|
Example context (json):
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}}
|
2017-09-18 12:47:37 +08:00
|
|
|
<div{{!
|
|
|
|
}} class="calendarwrapper"{{!
|
2017-09-19 11:17:04 +08:00
|
|
|
}}{{#courseid}} data-courseid="{{courseid}}"{{/courseid}}{{!
|
|
|
|
}}{{#categoryid}} data-categoryid="{{categoryid}}"{{/categoryid}}{{!
|
2017-09-18 12:47:37 +08:00
|
|
|
}} data-month="{{date.mon}}"{{!
|
|
|
|
}} data-year="{{date.year}}"{{!
|
|
|
|
}}>
|
2017-09-04 15:57:39 +08:00
|
|
|
{{> core_calendar/header }}
|
2017-07-19 09:34:34 +08:00
|
|
|
{{> core_calendar/month_navigation }}
|
2017-08-22 15:38:06 +08:00
|
|
|
{{> core/overlay_loading}}
|
2017-08-24 08:20:35 +00:00
|
|
|
<table id="month-detailed-{{uniqid}}" class="calendarmonth calendartable card-deck m-b-0">
|
2017-07-19 09:34:34 +08:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
{{# daynames }}
|
|
|
|
<th class="header text-xs-center">
|
|
|
|
{{shortname}}
|
|
|
|
</th>
|
|
|
|
{{/ daynames }}
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{#weeks}}
|
2017-08-17 06:27:27 +00:00
|
|
|
<tr data-region="month-view-week">
|
2017-07-19 09:34:34 +08:00
|
|
|
{{#prepadding}}
|
|
|
|
<td class="dayblank"> </td>
|
|
|
|
{{/prepadding}}
|
|
|
|
{{#days}}
|
2017-08-21 06:27:47 +00:00
|
|
|
<td class="clickable day text-sm-center text-md-left{{!
|
2017-07-19 09:34:34 +08:00
|
|
|
}}{{#istoday}} today{{/istoday}}{{!
|
|
|
|
}}{{#isweekend}} weekend{{/isweekend}}{{!
|
|
|
|
}}{{#durationevents.0}} duration{{/durationevents.0}}{{!
|
|
|
|
}}{{#durationevents}} duration_{{.}}{{/durationevents}}{{!
|
2017-08-17 06:27:27 +00:00
|
|
|
}}"
|
|
|
|
data-day-timestamp="{{timestamp}}"
|
2017-08-24 08:20:35 +00:00
|
|
|
data-drop-zone="month-view-day"
|
2017-08-21 06:27:47 +00:00
|
|
|
data-region="day"
|
|
|
|
data-new-event-timestamp="{{neweventtimestamp}}">
|
2017-07-19 09:34:34 +08:00
|
|
|
<div class="hidden-sm-down text-xs-center">
|
|
|
|
{{#events.0}}
|
2017-08-21 06:27:47 +00:00
|
|
|
<a data-action="view-day-link" href="{{viewdaylink}}" class="day" title="{{viewdaylinktitle}}">{{mday}}</a>
|
2017-07-19 09:34:34 +08:00
|
|
|
{{/events.0}}
|
|
|
|
{{^events.0}}
|
|
|
|
{{mday}}
|
|
|
|
{{/events.0}}
|
|
|
|
{{#events.0}}
|
2017-08-17 06:27:27 +00:00
|
|
|
<div data-region="day-content">
|
|
|
|
<ul>
|
|
|
|
{{#events}}
|
2017-07-19 09:34:34 +08:00
|
|
|
{{#underway}}
|
|
|
|
<li class="events-underway">[{{name}}]</li>
|
|
|
|
{{/underway}}
|
|
|
|
{{^underway}}
|
2017-09-08 13:45:38 +08:00
|
|
|
<li class="calendar_event_{{calendareventtype}}"
|
2017-08-21 06:27:47 +00:00
|
|
|
data-region="event-item"
|
2017-09-08 13:45:38 +08:00
|
|
|
data-eventtype-{{calendareventtype}}="1"
|
2017-08-17 06:27:27 +00:00
|
|
|
{{#canedit}}
|
|
|
|
draggable="true"
|
|
|
|
data-drag-type="move"
|
|
|
|
{{/canedit}}>
|
|
|
|
|
2017-07-19 09:34:34 +08:00
|
|
|
<a data-action="view-event" data-event-id="{{id}}" href="{{url}}">{{name}}</a>
|
|
|
|
</li>
|
|
|
|
{{/underway}}
|
2017-08-17 06:27:27 +00:00
|
|
|
{{/events}}
|
|
|
|
</ul>
|
|
|
|
</div>
|
2017-07-19 09:34:34 +08:00
|
|
|
{{/events.0}}
|
|
|
|
</div>
|
2017-08-08 13:11:42 +08:00
|
|
|
<div class="hidden-md-up hidden-desktop">
|
2017-07-19 09:34:34 +08:00
|
|
|
{{#events.0}}
|
|
|
|
<a href="{{viewdaylink}}" class="day" title="{{viewdaylinktitle}}">{{mday}}</a>
|
|
|
|
{{/events.0}}
|
|
|
|
{{^events.0}}
|
2017-08-17 06:27:27 +00:00
|
|
|
<div data-region="day-content">
|
|
|
|
{{mday}}
|
|
|
|
</div>
|
2017-07-19 09:34:34 +08:00
|
|
|
{{/events.0}}
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
{{/days}}
|
|
|
|
{{#postpadding}}
|
|
|
|
<td class="dayblank"> </td>
|
|
|
|
{{/postpadding}}
|
|
|
|
</tr>
|
|
|
|
{{/weeks}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2017-08-21 06:27:47 +00:00
|
|
|
</div>
|
2017-08-17 06:27:27 +00:00
|
|
|
{{#js}}
|
2017-09-08 13:45:38 +08:00
|
|
|
require([
|
|
|
|
'jquery',
|
|
|
|
'core_calendar/month_view_drag_drop',
|
|
|
|
'core_calendar/selectors',
|
|
|
|
'core_calendar/events',
|
|
|
|
], function(
|
|
|
|
$,
|
|
|
|
DragDrop,
|
|
|
|
CalendarSelectors,
|
|
|
|
CalendarEvents
|
|
|
|
) {
|
2017-08-17 06:27:27 +00:00
|
|
|
var root = $('#month-detailed-{{uniqid}}');
|
|
|
|
DragDrop.init(root);
|
2017-09-08 13:45:38 +08:00
|
|
|
|
|
|
|
$('body').on(CalendarEvents.filterChanged, function(e, data) {
|
|
|
|
M.util.js_pending("month-detailed-{{uniqid}}-filterChanged");
|
|
|
|
// A filter value has been changed.
|
|
|
|
// Find all matching cells in the popover data, and hide them.
|
|
|
|
$("#month-detailed-{{uniqid}}")
|
|
|
|
.find(CalendarSelectors.eventType[data.type])
|
|
|
|
.toggleClass('hidden', !!data.hidden);
|
|
|
|
M.util.js_complete("month-detailed-{{uniqid}}-filterChanged");
|
|
|
|
});
|
2017-08-17 06:27:27 +00:00
|
|
|
});
|
|
|
|
{{/js}}
|