Merge branch 'MDL-65318-master' of git://github.com/lameze/moodle
[moodle.git] / calendar / templates / event_item.mustache
1 {{!
2     This file is part of Moodle - http://moodle.org/
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.
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.
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/event_item
20     Calendar event item.
22     The purpose of this template is to render the event item.
24     Classes required for JS:
25     * none
27     Data attributes required for JS:
28     * none
30     Example context (json):
31     {
32         "id": 1,
33         "name": "Sample event name",
34         "normalisedeventtype": "course",
35         "course": {
36             "id": 1
37         },
38         "canedit": true,
39         "candelete": true,
40         "isactionevent": true,
41         "icon": {
42             "key": "i/courseevent",
43             "component": "core",
44             "alttext": "Some course event"
45         },
46         "editurl": "#",
47         "url": "#"
48     }
49 }}
50 <div{{!
51     }} data-type="event"{{!
52     }} data-course-id="{{course.id}}"{{!
53     }} data-event-id="{{id}}"{{!
54     }} class="event m-t-1"{{!
55     }} data-eventtype-{{normalisedeventtype}}="1"{{!
56     }} data-event-title="{{name}}"{{!
57     }} data-event-count="{{eventcount}}"{{!
58     }}>
59     <div class="card rounded">
60         <div class="box card-header clearfix calendar_event_{{normalisedeventtype}}">
61             <div class="commands float-sm-right">
62                 {{#canedit}}
63                     {{#candelete}}
64                         <a href="{{deleteurl}}" data-action="delete">
65                             {{#pix}}t/delete, core, {{#str}}delete{{/str}}{{/pix}}
66                         </a>
67                     {{/candelete}}
68                     {{^isactionevent}}
69                         <a href="{{editurl}}" data-action="edit">
70                             {{#pix}}t/edit, core, {{#str}}edit{{/str}}{{/pix}}
71                         </a>
72                     {{/isactionevent}}
73                 {{/canedit}}
74             </div>
75             {{#icon}}<div class="d-inline-block mt-1 align-top">{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}</div>{{/icon}}
76             <div class="d-inline-block">
77                 <h3 class="name d-inline-block">{{{name}}}</h3>
78             </div>
79         </div>
80         <div class="description card-body">
81             {{> core_calendar/event_details }}
82         </div>
83         {{#isactionevent}}
84             <div class="card-footer text-right bg-transparent">
85                 <a href="{{url}}" class="card-link">{{#str}} gotoactivity, core_calendar {{/str}}</a>
86             </div>
87         {{/isactionevent}}
88     </div>
89 </div>