MDL-65318 core_calendar: make event details consistent across pages
[moodle.git] / calendar / templates / event_item.mustache
CommitLineData
146d3713
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{{!
a67bbe50 18 @template core_calendar/event_item
146d3713
SL
19
20 Calendar event item.
21
22 The purpose of this template is to render the event item.
23
24 Classes required for JS:
25 * none
26
27 Data attributes required for JS:
28 * none
29
30 Example context (json):
31 {
a67bbe50
SL
32 "id": 1,
33 "name": "Sample event name",
34 "calendareventtype": "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": "#"
146d3713
SL
48 }
49}}
e00aed51
AN
50<div{{!
51 }} data-type="event"{{!
52 }} data-course-id="{{course.id}}"{{!
53 }} data-event-id="{{id}}"{{!
a67bbe50 54 }} class="event m-t-1"{{!
e00aed51
AN
55 }} data-eventtype-{{calendareventtype}}="1"{{!
56 }} data-event-title="{{name}}"{{!
57 }} data-event-count="{{eventcount}}"{{!
58 }}>
a67bbe50
SL
59 <div class="card rounded">
60 <div class="box card-header clearfix calendar_event_{{calendareventtype}}">
5db1ce53 61 <div class="commands float-sm-right">
146d3713
SL
62 {{#canedit}}
63 {{#candelete}}
e00aed51 64 <a href="{{deleteurl}}" data-action="delete">
146d3713
SL
65 {{#pix}}t/delete, core, {{#str}}delete{{/str}}{{/pix}}
66 </a>
67 {{/candelete}}
baedf066
SL
68 {{^isactionevent}}
69 <a href="{{editurl}}" data-action="edit">
70 {{#pix}}t/edit, core, {{#str}}edit{{/str}}{{/pix}}
71 </a>
72 {{/isactionevent}}
146d3713
SL
73 {{/canedit}}
74 </div>
ef4e04ee
MH
75 {{#icon}}<div class="d-inline-block mt-1 align-top">{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}</div>{{/icon}}
76 <div class="d-inline-block">
b8c05345 77 <h3 class="name d-inline-block">{{{name}}}</h3>
ef4e04ee 78 </div>
146d3713 79 </div>
a67bbe50
SL
80 <div class="description card-body">
81 {{> core_calendar/event_details }}
146d3713 82 </div>
a67bbe50
SL
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}}
146d3713 88 </div>
e00aed51 89</div>