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