Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | 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_badges/issued_badge
19
 
20
    Display an issued badge.
21
 
22
    Context variables required for this template:
23
    * coursefullname - Course name (only available if it's a course badge).
24
    * sitefullname - Site name (only available if it's a site badge).
25
    * badgeimage - Badge image.
26
    * expireddate - Date (in the past) when the badge expired. If expiredate is defined, this field will be empty [optional].
27
    * expireddateformatted - Formatted expired date [optional].
28
    * expiredate - Date (in the future) when the badge will expire. If expireddate is defined, this field will be empty [optional].
29
    * badgename - Badge name.
30
    * badgedescription - Badge description.
31
    * badgeissuedon - Date where the badge was issued on by the user [optional].
32
    * recipientname - User awarded with the badge [optional].
33
    * recipientnotification.message - Message to be displayed if there is some issue with the recipient [optional].
34
    * criteria - HTML code with the criteria to display.
35
    * issuedby - Badge issuer.
36
    * issuedbyemailobfuscated - Badge issuer email link obfuscated.
37
    * hasotherfields - Wheter the badge has other fields or not.
38
    * language - Badge language [optional].
39
    * version - Badge version [optional].
40
    * imagecaption - Badge image caption [optional].
41
    * endorsement - Badge endorsement data, with id, badgeid, issuername... [optional].
42
    * hasrelatedbadges - Whether the badge has related badges or not.
43
    * relatedbadges - Array of related badges (if hasrelatedbadges is set to true).
44
    * hasalignments - Whether the badge has alignments or not.
45
    * alignments - Array of alignments (if hasalignments is set to true).
46
    * hostedurl - The URL where the badge is hosted [optional].
47
 
48
    Example context (json):
49
    {
50
        "coursefullname": "Learn Moodle 3.11 Basics",
51
        "badgeimage": "https://moodlesite/pluginfile/badges/123.jpg",
52
        "expiredate": 1656972000,
53
        "badgename": "Lean Moodle 3.11 Basics helper",
54
        "badgedescription":"This badge is awarded to people who have provided outstanding support to other participants in the MOOC",
55
        "badgeissuedon": 1625491897,
56
        "recipientname": "Judit Cortes",
57
        "recipientnotification": {
58
            "message": "This user cannot be verified as a recipient of this badge."
59
        },
60
        "criteria": "Complete <strong>ALL</strong> of the listed requirements.<ul><li>This badge has to be awarded by a user with the following role:<ul><li>Teacher</li></ul></li><li>The following activity has to be completed:<ul><li><strong>View video</strong></li></ul></li><li>The following badge has to be earned:<ul><li><strong>Lean Moodle 3.11 Basics participant</strong></li></ul></li></ul>",
61
        "issuedby": "Moodle HQ",
62
        "issuedbyemailobfuscated": "<a href=\"mailto:xxxxx\">Moodle HQ</a>",
63
        "hasotherfields": true,
64
        "language": "English",
65
        "version": "1.0beta",
66
        "imagecaption": "This is a nice picture from my cat",
67
        "endorsement": {
68
            "id": "2",
69
            "badgeid": "13",
70
            "issuername": "Endorsement",
71
            "issuerurl": "http://endorsement.cat",
72
            "issueremail": "<a href=\"mailto:xxxx\">endorsement@moodle.invalid</a>",
73
            "claimid": "http://claim.cat",
74
            "claimcomment": "This is an endorsement comment.",
75
            "dateissued": "1625491680"
76
        },
77
        "hasrelatedbadges": true,
78
        "relatedbadges": [
79
            {
80
                "id": "12",
81
                "name": "Lean Moodle 3.11 Basics participant",
82
                "version": "",
83
                "language": "en",
84
                "type": "2",
85
                "url": "http://xxxxx/badges/overview.php?id=12"
86
            }
87
        ],
88
        "hasalignments": true,
89
        "alignments": [
90
            {
91
                "id": "3",
92
                "badgeid": "13",
93
                "targetname": "Skill 1",
94
                "targeturl": "http://skill1.cat",
95
                "targetdescription": "This is the description for \"Skill 1\"",
96
                "targetframework": "Framework name",
97
                "targetcode": "S001"
98
            },
99
            {
100
                "id": "2",
101
                "badgeid": "13",
102
                "targetname": "Alignment1",
103
                "targeturl": "http://alignment1.cat",
104
                "targetdescription": "This is the description for alignament1",
105
                "targetframework": "Framework name",
106
                "targetcode": "A1001"
107
            }
108
        ],
109
        "hostedurl": "http://externalbackpack/badge?id=ABC"
110
    }
111
}}
112
 
113
<div id="badge" class="container-fluid">
114
<div class="row">
115
    <div id="badge-image-col" class="col col-auto">
116
        <img src="{{badgeimage}}" alt="{{imagecaption}}" width="300" class="mx-auto d-block"/>
117
        {{#expireddateformatted}}
118
            <span class="expireimage">
119
                {{# pix }} i/expired, core, {{# str }} expireddate, badges, {{expireddateformatted}} {{/ str }}{{/ pix }}
120
            </span>
121
        {{/expireddateformatted}}
122
        {{#downloadurl}}
123
            <form action="{{downloadurl}}" method="post" id="downloadbadgeform">
124
                <button type="submit" class="btn btn-secondary m-1 w-100">{{#str}}download{{/str}}</button>
125
            </form>
126
        {{/downloadurl}}
127
        {{#addtobackpackurl}}
128
            <form action="{{addtobackpackurl}}" method="post" id="addtobackpackform">
129
                <button type="submit" class="btn btn-secondary m-1 w-100">{{#str}}addtobackpack, badges{{/str}}</button>
130
            </form>
131
        {{/addtobackpackurl}}
132
    </div>
133
 
134
    <div id="badge-details-col" class="col">
135
        <h2>{{badgename}}</h2>
136
 
137
        {{#recipientname}}
138
        <div id="badge-awardedto" class="pt-1 pb-2">
139
            {{#recipientnotification}}
140
                {{> core/notification_warning}}
141
            {{/recipientnotification}}
142
            {{#str}}awardedto, core_badges, {{recipientname}}{{/str}}
143
        </div>
144
        {{/recipientname}}
145
 
146
        <div id="badge-issued-expire" class="pt-1 pb-2">
147
            <div class="pb-3">
148
            <small>
149
            {{#badgeissuedon}}
150
                {{#str}}
151
                    issuedon,
152
                    core_badges,
153
                    {{#userdate}}{{badgeissuedon}}, {{#str}} strftimedatetime, langconfig {{/str}}{{/userdate}}
154
                {{/str}}
155
                <br/>
156
            {{/badgeissuedon}}
157
            {{#expiredate}}
158
                {{#str}}
159
                    expiresin,
160
                    core_badges,
161
                    {{#userdate}}{{expiredate}}, {{#str}} strftimedatetime, langconfig {{/str}}{{/userdate}}
162
                {{/str}}
163
                <br/>
164
            {{/expiredate}}
165
            {{#expireddate}}
166
                {{#str}}
167
                    expiredin,
168
                    core_badges,
169
                    {{#userdate}}{{expireddate}}, {{#str}} strftimedatetime, langconfig {{/str}}{{/userdate}}
170
                {{/str}}
171
            {{/expireddate}}
172
            </small>
173
            </div>
174
 
175
            {{#issuedby}}
176
            <div class="pb-2">
177
                {{#str}}
178
                    issuedby,
179
                    core_badges,
180
                    {{#issuedbyemailobfuscated}}
181
                        {{{issuedbyemailobfuscated}}}
182
                    {{/issuedbyemailobfuscated}}
183
                    {{^issuedbyemailobfuscated}}
184
                        {{issuedby}}
185
                    {{/issuedbyemailobfuscated}}
186
                {{/str}}
187
            </div>
188
            {{/issuedby}}
189
 
190
            {{#hostedurl}}
191
            <div class="pb-2">
192
                <a href="{{.}}" target="_blank" aria-label="{{#str}}hostedurldescription, core_badges{{/str}}">
193
                    {{#str}}hostedurl, core_badges{{/str}}
194
                </a>
195
            </div>
196
            {{/hostedurl}}
197
 
198
            {{#coursefullname}}
199
            <div class="pb-2">
200
                {{#str}}
201
                    course,
202
                    core_badges,
203
                    {{coursefullname}}
204
                {{/str}}
205
            </div>
206
            {{/coursefullname}}
207
        </div>
208
        {{#badgetag}}
209
            <p class="pb-2">
210
                {{> core_tag/taglist}}
211
            </p>
212
        {{/badgetag}}
213
 
214
        <p class="pb-4">{{{badgedescription}}}</p>
215
 
216
        <div id="badge-criteria">
217
            <h3>{{#str}}bcriteria, core_badges{{/str}}</h3>
218
            {{{criteria}}}
219
        </div>
220
 
221
        {{#hasotherfields}}
222
        <div id="badge-other-fields">
1441 ariadna 223
            <a data-bs-toggle="collapse" href="#collapseOtherDetails" role="button" aria-expanded="false" aria-controls="collapseOtherDetails">
1 efrain 224
                {{#str}}moredetails, core_badges{{/str}}
225
            </a>
226
            <div class="collapse" id="collapseOtherDetails">
1441 ariadna 227
                <div class="container ms-0">
1 efrain 228
                    {{#version}}
229
                        <dl>
230
                            <dt>
231
                                {{#str}}version, core_badges{{/str}}
232
                            </dt>
233
                            <dd>
234
                                {{version}}
235
                            </dd>
236
                        </dl>
237
                    {{/version}}
238
 
239
                    {{#language}}
240
                        <dl>
241
                            <dt>
242
                                {{#str}}language, core_badges{{/str}}
243
                            </dt>
244
                            <dd>
245
                                {{language}}
246
                            </dd>
247
                        </dl>
248
                    {{/language}}
249
 
250
                    {{#imagecaption}}
251
                        <dl>
252
                            <dt>
253
                                {{#str}}imagecaption, core_badges{{/str}}
254
                            </dt>
255
                            <dd>
256
                                {{imagecaption}}
257
                            </dd>
258
                        </dl>
259
                    {{/imagecaption}}
260
                </div>
261
 
262
            {{#endorsement}}
263
                <h4>{{#str}}endorsement, core_badges{{/str}}</h4>
1441 ariadna 264
                <div class="container ms-0">
1 efrain 265
                    <dl>
266
                        <dt>
267
                            {{#str}}issuername, core_badges{{/str}}
268
                        </dt>
269
                        <dd>
270
                            {{issuername}}
271
                        </dd>
272
                    </dl>
273
 
274
                    <dl>
275
                        <dt>
276
                            {{#str}}issueremail, core_badges{{/str}}
277
                        </dt>
278
                        <dd>
279
                            {{{issueremail}}}
280
                        </dd>
281
                    </dl>
282
 
283
                    <dl>
284
                        <dt>
285
                            {{#str}}issuerurl, core_badges{{/str}}
286
                        </dt>
287
                        <dd>
288
                            <a href="{{issuerurl}}" target="_blank">{{issuerurl}}</a>
289
                        </dd>
290
                    </dl>
291
 
292
                    <dl>
293
                        <dt>
294
                            {{#str}}dateawarded, core_badges{{/str}}
295
                        </dt>
296
                        <dd>
297
                            {{#userdate}}{{dateissued}}, {{#str}} strftimedatetime, langconfig {{/str}}{{/userdate}}
298
                        </dd>
299
                    </dl>
300
 
301
                    <dl>
302
                        <dt>
303
                            {{#str}}claimid, core_badges{{/str}}
304
                        </dt>
305
                        <dd>
306
                            <a href="{{claimid}}" target="_blank">{{claimid}}</a>
307
                        </dd>
308
                    </dl>
309
 
310
                    <dl>
311
                        <dt>
312
                            {{#str}}claimcomment, core_badges{{/str}}
313
                        </dt>
314
                        <dd>
315
                            {{claimcomment}}
316
                        </dd>
317
                    </dl>
318
                </div>
319
            {{/endorsement}}
320
 
321
            {{#hasrelatedbadges}}
322
                <h4>{{#str}}relatedbages, core_badges{{/str}}</h4>
323
                <ul>
324
            {{/hasrelatedbadges}}
325
            {{#relatedbadges}}
326
                <li>
327
                {{#url}}<a href="{{url}}" target="_blank">{{/url}}
328
                    {{name}}
329
                {{#url}}</a>{{/url}}
330
                </li>
331
            {{/relatedbadges}}
332
            {{#hasrelatedbadges}}
333
                </ul>
334
            {{/hasrelatedbadges}}
335
 
336
            {{#hasalignments}}
337
                <h4>{{#str}}alignment, core_badges{{/str}}</h4>
338
                <ul>
339
            {{/hasalignments}}
340
            {{#alignments}}
341
                <li>
342
                    <a href="{{targeturl}}" target="_blank">{{targetname}}</a>
343
                </li>
344
            {{/alignments}}
345
            {{#hasalignments}}
346
                </ul>
347
            {{/hasalignments}}
348
            </div>
349
        </div>
350
        {{/hasotherfields}}
351
    </div>
352
</div>
353
</div>