MDL-65318 core_calendar: make event details consistent across pages
[moodle.git] / calendar / templates / event_details.mustache
CommitLineData
0ea03be7
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{{!
18 @template core_calendar/event_details
19
20 Calendar event details.
21
22 The purpose of this template is to render the event details.
23
24 This template is used in the summary modal, day and upcoming views to output event information consistently
25 across the calendar.
26
27 Classes required for JS:
28 * none
29
30 Data attributes required for JS:
31 * none
32
33 Example context (json):
34 {
35 "formattedtime": "Wednesday, 17 April, 9:27 AM",
36 "calendareventtype": "Group",
37 "description": "An random event description",
38 "location": "Moodle HQ",
39 "isactionevent": "true",
40 "course": {
41 "viewurl": "http://mymoodlesite/course/view.php?id=1",
42 "fullname": "Course name"
43 },
44 "source": "Ical imported",
45 "groupname": "Group 1",
46 "iscategoryevent": "true",
47 "category": {
48 "nestedname": "Category name"
49 },
50 "iscourseevent": "true",
51 "groupname": "Group name",
52 "subscription": "true",
53 "displayeventsource": "true",
54 "subscriptionname": "Subscription name",
55 "subscriptionurl": "http://subscriptionurl"
56 }
57}}
58<div class="row">
59 <div class="col-xs-1">{{#pix}} i/calendareventtime, core, {{#str}} when, core_calendar {{/str}} {{/pix}}</div>
60 <div class="col-xs-11">{{{formattedtime}}}</div>
61</div>
62<div class="row mt-1">
63 <div class="col-xs-1">{{#pix}} i/calendar, core, {{#str}} eventtype, core_calendar {{/str}} {{/pix}}</div>
a67bbe50 64 <div class="col-xs-11">{{calendareventtype}}</div>
0ea03be7
SL
65</div>
66{{#description}}
67 <div class="row mt-1">
68 <div class="col-xs-1">{{#pix}} i/calendareventdescription, core, {{#str}} description {{/str}} {{/pix}}</div>
69 <div class="description-content col-xs-11">{{{.}}}</div>
70 </div>
71{{/description}}
72{{#location}}
73 <div class="row mt-1">
74 <div class="col-xs-1">{{#pix}} i/location, core, {{#str}} location {{/str}} {{/pix}}</div>
75 <div class="location-content col-xs-11">{{{.}}}</div>
76 </div>
77{{/location}}
78{{#isactionevent}}
79 <div class="row mt-1">
80 <div class="col-xs-1">{{#pix}} i/courseevent, core, {{#str}} course {{/str}} {{/pix}}</div>
81 <div class="col-xs-11"><a href="{{course.viewurl}}">{{{course.fullname}}}</a></div>
82 </div>
83{{/isactionevent}}
84{{#iscategoryevent}}
85 <div class="row mt-1">
86 <div class="col-xs-1">{{#pix}} i/categoryevent, core, {{#str}} category {{/str}} {{/pix}}</div>
87 <div class="col-xs-11">{{{category.nestedname}}}</div>
88 </div>
89{{/iscategoryevent}}
90{{#iscourseevent}}
91 <div class="row mt-1">
92 <div class="col-xs-1">{{#pix}} i/courseevent, core, {{#str}} course {{/str}} {{/pix}}</div>
93 <div class="col-xs-11"><a href="{{url}}">{{{course.fullname}}}</a></div>
94 </div>
95{{/iscourseevent}}
96{{#groupname}}
97 <div class="row mt-1">
98 <div class="col-xs-1">{{#pix}} i/courseevent, core, {{#str}} course {{/str}} {{/pix}}</div>
99 <div class="col-xs-11"><a href="{{url}}">{{{course.fullname}}}</a></div>
100 </div>
101 <div class="row mt-1">
102 <div class="col-xs-1">{{#pix}} i/groupevent, core, {{#str}} group {{/str}} {{/pix}}</div>
103 <div class="col-xs-11">{{{groupname}}}</div>
104 </div>
105{{/groupname}}
106{{#subscription}}
107 {{#displayeventsource}}
108 <div class="row mt-1">
109 <div class="col-xs-1">{{#pix}} i/rss, core, {{#str}} eventsource, core_calendar {{/str}} {{/pix}}</div>
110 <div class="col-xs-11">
111 {{#subscriptionurl}}
112 <p><a href="{{subscriptionurl}}">{{#str}}subscriptionsource, core_calendar, {{{subscriptionname}}}{{/str}}</a></p>
113 {{/subscriptionurl}}
114 {{^subscriptionurl}}
115 <p>{{#str}}subscriptionsource, core_calendar, {{{subscriptionname}}}{{/str}}</p>
116 {{/subscriptionurl}}
117 </div>
118 </div>
119 {{/displayeventsource}}
120{{/subscription}}