MDL-58732 block_myoverview: fix course view event groupings
[moodle.git] / theme / bootstrapbase / templates / block_myoverview / course-event-list.mustache
CommitLineData
24b423fd
BR
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 block_myoverview/course-event-list
19
20 This template renders a list of events for the myoverview block
21 sort by courses view.
22
23 Example context (json):
24 {
25 }
26}}
27<div data-region="event-list-container"
28 data-limit="{{$limit}}20{{/limit}}"
29 data-course-id="{{$courseid}}{{/courseid}}"
30 data-last-id="{{$lastid}}{{/lastid}}"
74e5816a 31 data-midnight="{{midnight}}"
24b423fd
BR
32 id="event-list-container-{{$courseid}}{{/courseid}}">
33
34 <div data-region="event-list-content">
35 {{< block_myoverview/event-list-group }}
36 {{$title}}{{#str}} recentlyoverdue, block_myoverview {{/str}}{{/title}}
37 {{$extratitleclasses}}text-danger{{/extratitleclasses}}
38 {{$startday}}-14{{/startday}}
39 {{$endday}}0{{/endday}}
40 {{$eventlistitems}}
41 {{> block_myoverview/course-event-list-items }}
42 {{/eventlistitems}}
43 {{/ block_myoverview/event-list-group }}
44 {{< block_myoverview/event-list-group }}
45 {{$title}}{{#str}} today {{/str}}{{/title}}
46 {{$extratitleclasses}}{{/extratitleclasses}}
47 {{$startday}}0{{/startday}}
48 {{$endday}}1{{/endday}}
49 {{$eventlistitems}}
50 {{> block_myoverview/course-event-list-items }}
51 {{/eventlistitems}}
52 {{/ block_myoverview/event-list-group }}
53 {{< block_myoverview/event-list-group }}
54 {{$title}}{{#str}} next7days, block_myoverview {{/str}}{{/title}}
55 {{$extratitleclasses}}{{/extratitleclasses}}
56 {{$startday}}1{{/startday}}
57 {{$endday}}7{{/endday}}
58 {{$eventlistitems}}
59 {{> block_myoverview/course-event-list-items }}
60 {{/eventlistitems}}
61 {{/ block_myoverview/event-list-group }}
62 {{< block_myoverview/event-list-group }}
63 {{$title}}{{#str}} next30days, block_myoverview {{/str}}{{/title}}
64 {{$extratitleclasses}}{{/extratitleclasses}}
65 {{$startday}}7{{/startday}}
66 {{$endday}}30{{/endday}}
67 {{$eventlistitems}}
68 {{> block_myoverview/course-event-list-items }}
69 {{/eventlistitems}}
70 {{/ block_myoverview/event-list-group }}
71 {{< block_myoverview/event-list-group }}
72 {{$title}}{{#str}} future, block_myoverview {{/str}}{{/title}}
73 {{$extratitleclasses}}{{/extratitleclasses}}
74 {{$startday}}30{{/startday}}
75 {{$endday}}{{/endday}}
76 {{$eventlistitems}}
77 {{> block_myoverview/course-event-list-items }}
78 {{/eventlistitems}}
79 {{/ block_myoverview/event-list-group }}
80
81 <div class="text-xs-center text-center m-b-1">
82 <button type="button" class="btn btn-secondary" data-action="view-more">
83 {{#str}} viewmore {{/str}}
84 <span class="hidden" data-region="loading-icon-container">
85 {{> core/loading }}
86 </span>
87 </button>
88 </div>
89 </div>
2104e7a5 90 <div class="hidden text-xs-center text-center m-y-3" data-region="empty-message">
24b423fd
BR
91 <img class="empty-placeholder-image-sm"
92 src="{{urls.noevents}}"
93 alt="{{#str}} noevents, block_myoverview {{/str}}">
94 <p class="text-muted m-t-1">{{#str}} noevents, block_myoverview {{/str}}</p>
95 <a href="{{viewurl}}" class="btn btn-secondary text-primary">
96 {{#str}} viewcourse, block_myoverview {{/str}}
97 </a>
98 </div>
99</div>
100{{#js}}
101require(['jquery', 'block_myoverview/event_list'], function($, EventList) {
102 var root = $("#event-list-container-{{$courseid}}{{/courseid}}");
103 EventList.registerEventListeners(root);
104});
105{{/js}}