1 |
efrain |
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_item
|
|
|
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 |
{
|
|
|
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 |
"iconurl": "#"
|
|
|
46 |
},
|
|
|
47 |
"editurl": "#",
|
|
|
48 |
"url": "#"
|
|
|
49 |
}
|
|
|
50 |
}}
|
|
|
51 |
<div{{!
|
|
|
52 |
}} data-type="event"{{!
|
|
|
53 |
}} data-course-id="{{course.id}}"{{!
|
|
|
54 |
}} data-event-id="{{id}}"{{!
|
|
|
55 |
}} class="event mt-3"{{!
|
|
|
56 |
}} data-event-component="{{component}}"{{!
|
|
|
57 |
}} data-event-eventtype="{{eventtype}}"{{!
|
|
|
58 |
}} data-eventtype-{{normalisedeventtype}}="1"{{!
|
|
|
59 |
}} data-event-title="{{name}}"{{!
|
|
|
60 |
}} data-event-count="{{eventcount}}"{{!
|
|
|
61 |
}}>
|
|
|
62 |
<div class="card rounded">
|
|
|
63 |
<div class="box card-header clearfix calendar_event_{{normalisedeventtype}}">
|
|
|
64 |
<div class="commands float-sm-right">
|
|
|
65 |
{{#canedit}}
|
|
|
66 |
{{#candelete}}
|
|
|
67 |
<a href="{{deleteurl}}" data-action="delete" aria-label="{{#str}}delete{{/str}}" title="{{#str}}delete{{/str}}">
|
|
|
68 |
{{#pix}}t/delete, core{{/pix}}
|
|
|
69 |
</a>
|
|
|
70 |
{{/candelete}}
|
|
|
71 |
{{^isactionevent}}
|
|
|
72 |
<a href="{{editurl}}" data-action="edit" aria-label="{{#str}}edit{{/str}}" title="{{#str}}edit{{/str}}">
|
|
|
73 |
{{#pix}}t/edit, core{{/pix}}
|
|
|
74 |
</a>
|
|
|
75 |
{{/isactionevent}}
|
|
|
76 |
{{/canedit}}
|
|
|
77 |
</div>
|
|
|
78 |
{{#icon}}
|
|
|
79 |
<div class="d-inline-block mt-1 align-top">
|
|
|
80 |
{{#iconurl}}
|
|
|
81 |
<img alt="{{alttext}}" title="{{alttext}}" src="{{{iconurl}}}" class="icon {{iconclass}}">
|
|
|
82 |
{{/iconurl}}
|
|
|
83 |
{{^iconurl}}
|
|
|
84 |
{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}
|
|
|
85 |
{{/iconurl}}
|
|
|
86 |
</div>
|
|
|
87 |
{{/icon}}
|
|
|
88 |
<div class="d-inline-block">
|
|
|
89 |
<h3 class="name d-inline-block">{{{name}}}</h3>
|
|
|
90 |
</div>
|
|
|
91 |
</div>
|
|
|
92 |
<div class="description card-body">
|
|
|
93 |
{{> core_calendar/event_details }}
|
|
|
94 |
</div>
|
|
|
95 |
{{#action.actionable}}
|
|
|
96 |
<div class="card-footer text-right bg-transparent">
|
|
|
97 |
<a href="{{action.url}}" class="card-link">{{{action.name}}}</a>
|
|
|
98 |
</div>
|
|
|
99 |
{{/action.actionable}}
|
|
|
100 |
{{^action.actionable}}
|
|
|
101 |
{{#isactionevent}}
|
|
|
102 |
<div class="card-footer text-right bg-transparent">
|
|
|
103 |
<a href="{{url}}" class="card-link">{{#str}} gotoactivity, core_calendar {{/str}}</a>
|
|
|
104 |
</div>
|
|
|
105 |
{{/isactionevent}}
|
|
|
106 |
{{/action.actionable}}
|
|
|
107 |
</div>
|
|
|
108 |
</div>
|