Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
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
    }} class="calendar-event-box calendar_event_{{eventtype}}" {{!
53
    }} data-type="event" {{!
54
    }} data-course-id="{{course.id}}" {{!
55
    }} data-event-id="{{id}}" {{!
56
    }} class="event" {{!
57
    }} data-event-component="{{component}}" {{!
58
    }} data-event-eventtype="{{eventtype}}" {{!
59
    }} data-eventtype-{{normalisedeventtype}}="1" {{!
60
    }} data-event-title="{{name}}" {{!
61
    }} data-event-count="{{eventcount}}" {{!
62
    }}>
63
    <div class="calendar-event-row">
64
        <div class="calendar-event-box-container">
65
            {{#canedit}}
66
            <div class="calendar-event-settings">
67
                <a href="{{editurl}}" class="btn btn-xs btn-secondary px-2 icon-no-margin" data-action="edit">
68
                    <svg class="mr-2 rui-btn--icon" width="20" height="20" fill="none" viewBox="0 0 24 24">
69
                        <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" d="M4.75 19.25L9 18.25L18.2929 8.95711C18.6834 8.56658 18.6834 7.93342 18.2929 7.54289L16.4571 5.70711C16.0666 5.31658 15.4334 5.31658 15.0429 5.70711L5.75 15L4.75 19.25Z"></path>
70
                        <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" d="M19.25 19.25H13.75"></path>
71
                    </svg>
72
                    <span>{{#str}}edit{{/str}}</span>
73
                </a>
74
                {{#candelete}}
75
                    <a href="{{deleteurl}}" class="btn btn-xs btn-danger p-1" data-action="delete" title="{{#str}}delete{{/str}}">
76
                        <svg width="20" height="20" fill="none" viewBox="0 0 24 24">
77
                            <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" d="M6.75 7.75L7.59115 17.4233C7.68102 18.4568 8.54622 19.25 9.58363 19.25H14.4164C15.4538 19.25 16.319 18.4568 16.4088 17.4233L17.25 7.75"></path>
78
                            <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" d="M9.75 7.5V6.75C9.75 5.64543 10.6454 4.75 11.75 4.75H12.25C13.3546 4.75 14.25 5.64543 14.25 6.75V7.5"></path>
79
                            <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" d="M5 7.75H19"></path>
80
                        </svg>
81
                    </a>
82
                {{/candelete}}
83
            </div>
84
            {{/canedit}}
85
 
86
            <div class="calendar-event-content">
87
                <div class="calendar-event-date">
88
                    <div class="mr-1">
89
                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor">
90
                            <g data-name="Layer 2">
91
                                <g data-name="calendar">
92
                                    <rect width="24" height="24" opacity="0" />
93
                                    <path d="M18 4h-1V3a1 1 0 0 0-2 0v1H9V3a1 1 0 0 0-2 0v1H6a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h12a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3zM6 6h1v1a1 1 0 0 0 2 0V6h6v1a1 1 0 0 0 2 0V6h1a1 1 0 0 1 1 1v4H5V7a1 1 0 0 1 1-1zm12 14H6a1 1 0 0 1-1-1v-6h14v6a1 1 0 0 1-1 1z" />
94
                                    <circle cx="8" cy="16" r="1" />
95
                                    <path d="M16 15h-4a1 1 0 0 0 0 2h4a1 1 0 0 0 0-2z" />
96
                                </g>
97
                            </g>
98
                        </svg>
99
                    </div>
100
                    <div class="d-inline-flex align-items-center">{{{formattedtime}}}</div>
101
                </div>
102
 
103
                <h3 class="calendar-event-heading">{{name}}</h3>
104
                <div class="calendar-event-description">
105
                    {{{description}}}
106
                </div>
107
 
108
                <div class="rui-calendar-footer">
109
                    <ul class="rui-calendar-list mb-0 px-0">
110
                        {{#location}}
111
                            <li>
112
                                <div class="rui-calendar-list-content">
113
                                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="16" height="16">
114
                                        <g data-name="Layer 2">
115
                                            <g data-name="globe">
116
                                                <rect width="24" height="24" transform="rotate(180 12 12)" opacity="0" />
117
                                                <path d="M22 12A10 10 0 0 0 12 2a10 10 0 0 0 0 20 10 10 0 0 0 10-10zm-2.07-1H17a12.91 12.91 0 0 0-2.33-6.54A8 8 0 0 1 19.93 11zM9.08 13H15a11.44 11.44 0 0 1-3 6.61A11 11 0 0 1 9.08 13zm0-2A11.4 11.4 0 0 1 12 4.4a11.19 11.19 0 0 1 3 6.6zm.36-6.57A13.18 13.18 0 0 0 7.07 11h-3a8 8 0 0 1 5.37-6.57zM4.07 13h3a12.86 12.86 0 0 0 2.35 6.56A8 8 0 0 1 4.07 13zm10.55 6.55A13.14 13.14 0 0 0 17 13h2.95a8 8 0 0 1-5.33 6.55z" />
118
                                            </g>
119
                                        </g>
120
                                    </svg>
121
                                    <span class="ml-1">{{{.}}}</span>
122
                                </div>
123
                            </li>
124
                        {{/location}}
125
                        {{#iscategoryevent}}
126
                            <li class="modal-cal-cat w-100 mb-1">
127
                                <div class="rui-calendar-list-content">
128
                                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="16" height="16">
129
                                        <g data-name="Layer 2">
130
                                            <g data-name="bookmark">
131
                                                <rect width="24" height="24" opacity="0" />
132
                                                <path d="M6.09 21.06a1 1 0 0 1-1-1L4.94 5.4a2.26 2.26 0 0 1 2.18-2.35L16.71 3a2.27 2.27 0 0 1 2.23 2.31l.14 14.66a1 1 0 0 1-.49.87 1 1 0 0 1-1 0l-5.7-3.16-5.29 3.23a1.2 1.2 0 0 1-.51.15zm5.76-5.55a1.11 1.11 0 0 1 .5.12l4.71 2.61-.12-12.95c0-.2-.13-.34-.21-.33l-9.6.09c-.08 0-.19.13-.19.33l.12 12.9 4.28-2.63a1.06 1.06 0 0 1 .51-.14z" />
133
                                            </g>
134
                                        </g>
135
                                    </svg>
136
                                    <span class="ml-1">{{{category.nestedname}}}</span>
137
                                </div>
138
                            </li>
139
                        {{/iscategoryevent}}
140
                        {{#course.viewurl}}
141
                            <li>
142
                                <a class="rui-calendar-list-content" href="{{course.viewurl}}">
143
                                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="16" height="16">
144
                                        <g data-name="Layer 2">
145
                                            <g data-name="book-open">
146
                                                <rect width="24" height="24" transform="rotate(180 12 12)" opacity="0" />
147
                                                <path d="M20.62 4.22a1 1 0 0 0-.84-.2L12 5.77 4.22 4A1 1 0 0 0 3 5v12.2a1 1 0 0 0 .78 1l8 1.8h.44l8-1.8a1 1 0 0 0 .78-1V5a1 1 0 0 0-.38-.78zM5 6.25l6 1.35v10.15L5 16.4zM19 16.4l-6 1.35V7.6l6-1.35z" />
148
                                            </g>
149
                                        </g>
150
                                    </svg>
151
                                    <span class="ml-1">{{{course.fullname}}}</span>
152
                                </a>
153
                            </li>
154
                        {{/course.viewurl}}
155
                        {{#groupname}}
156
                            <li>
157
                                <div class="rui-calendar-list-content">
158
                                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="16" height="16">
159
                                        <g data-name="Layer 2">
160
                                            <g data-name="people">
161
                                                <rect width="24" height="24" opacity="0" />
162
                                                <path d="M9 11a4 4 0 1 0-4-4 4 4 0 0 0 4 4zm0-6a2 2 0 1 1-2 2 2 2 0 0 1 2-2z" />
163
                                                <path d="M17 13a3 3 0 1 0-3-3 3 3 0 0 0 3 3zm0-4a1 1 0 1 1-1 1 1 1 0 0 1 1-1z" />
164
                                                <path d="M17 14a5 5 0 0 0-3.06 1.05A7 7 0 0 0 2 20a1 1 0 0 0 2 0 5 5 0 0 1 10 0 1 1 0 0 0 2 0 6.9 6.9 0 0 0-.86-3.35A3 3 0 0 1 20 19a1 1 0 0 0 2 0 5 5 0 0 0-5-5z" />
165
                                            </g>
166
                                        </g>
167
                                    </svg>
168
                                    <span class="ml-1">{{{groupname}}}</span>
169
                                </div>
170
                            </li>
171
                        {{/groupname}}
172
                        {{#normalisedeventtypetext}}
173
                            <li>
174
                                <div class="rui-calendar-list-content">
175
                                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="16" height="16">
176
                                        <g data-name="Layer 2">
177
                                            <g data-name="menu">
178
                                                <rect width="24" height="24" transform="rotate(180 12 12)" opacity="0" />
179
                                                <rect x="3" y="11" width="18" height="2" rx=".95" ry=".95" />
180
                                                <rect x="3" y="16" width="18" height="2" rx=".95" ry=".95" />
181
                                                <rect x="3" y="6" width="18" height="2" rx=".95" ry=".95" />
182
                                            </g>
183
                                        </g>
184
                                    </svg>
185
                                    <span class="ml-1">{{normalisedeventtypetext}}</span>
186
                                </div>
187
                            </li>
188
                        {{/normalisedeventtypetext}}
189
                        {{#subscription}}
190
                            {{#displayeventsource}}
191
                                <li>
192
                                    <div class="rui-calendar-list-content">
193
                                        <svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
194
                                            <path d="M5.5 19C5.5 19.2761 5.27614 19.5 5 19.5C4.72386 19.5 4.5 19.2761 4.5 19C4.5 18.7239 4.72386 18.5 5 18.5C5.27614 18.5 5.5 18.7239 5.5 19Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path>
195
                                            <path d="M4.75 12.75H5C8.45178 12.75 11.25 15.5482 11.25 19V19.25" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
196
                                            <path d="M4.75 6.75H5C11.7655 6.75 17.25 12.2345 17.25 19V19.25" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
197
                                        </svg>
198
 
199
                                        {{#subscriptionurl}}
200
                                            <span class="ml-1"><a href="{{subscriptionurl}}">{{#str}}subscriptionsource, core_calendar, {{{subscriptionname}}}{{/str}}</a></span>
201
                                        {{/subscriptionurl}}
202
                                        {{^subscriptionurl}}
203
                                            <span class="ml-1">{{#str}}subscriptionsource, core_calendar, {{{subscriptionname}}}{{/str}}</span>
204
                                        {{/subscriptionurl}}
205
                                    </div>
206
                                </li>
207
                            {{/displayeventsource}}
208
                        {{/subscription}}
209
                    </ul>
210
                </div>
211
 
212
            </div>
213
 
214
        </div>
215
    </div>
216
</div>