Proyectos de Subversion Moodle

Rev

Rev 459 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
452 ariadna 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 mod_forum/forum_discussion_post
19
 
20
    Template to render a single post from a discussion.
21
 
22
    Classes required for JS:
23
    * none
24
 
25
    Data attributes required for JS:
26
    * none
27
 
28
    Example context (json):
29
    {
30
    }
31
}}
32
<article
33
    id="p{{id}}"
34
    class="forum-post-container my-2"
35
    data-post-id="{{id}}"
36
    data-region="post"
37
    data-target="{{id}}-target"
38
    tabindex="0"
39
    aria-labelledby="post-header-{{id}}-{{uniqid}}"
40
    aria-describedby="post-content-{{id}}"
41
>
42
    {{! The firstpost and starter classes below aren't used for anything other than to identify the first post in behat. }}
43
    <div
44
        class="position-relative mb-2 forum-post focus-target {{#unread}}unread{{/unread}} {{#firstpost}}firstpost starter{{/firstpost}}"
45
        aria-label='{{#str}} postbyuser, mod_forum, {"post": "{{subject}}", "user": "{{author.fullname}}"} {{/str}}'
46
        data-post-id="{{id}}" data-content="forum-post"
47
    >
48
        {{#isfirstunread}}<a id="unread" aria-hidden="true"></a>{{/isfirstunread}}
49
 
50
                    {{^isdeleted}}
51
                        {{#author}}
52
 
53
                        {{#groups}}
54
                                    {{#urls.group}}
55
                                    <div class="mb-2 ml-auto d-flex justify-content-end align-items-end">
56
                                        {{#urls.image}}
57
                                            <a href="{{urls.group}}" class="badge badge-link badge-light" role="button" aria-label="{{#str}} memberofgroup, group, {{name}}{{/str}}" title="{{#str}} memberofgroup, group, {{name}}{{/str}}">
58
                                                <img
59
                                                    class="rounded icon mr-1"
60
                                                    src="{{{.}}}"
61
                                                    alt="{{#str}} pictureof, core, {{name}} {{/str}}"
62
                                                    aria-hidden="true"
63
                                                    title="{{#str}} pictureof, core, {{name}} {{/str}}"
64
                                                >
65
                                                <span class="group-name">{{name}}</span>
66
                                            </a>
67
                                        {{/urls.image}}
68
                                    {{/urls.group}}
69
                                    {{^urls.group}}
70
 
71
                                        {{#urls.image}}
72
                                        <div class="badge badge-info">
73
                                            <img class="rounded icon mr-3"
74
                                                src="{{{.}}}"
75
                                                alt="{{#str}} pictureof, core, {{name}} {{/str}}"
76
                                                title="{{#str}} pictureof, core, {{name}} {{/str}}"
77
                                            >
78
                                            <span>{{#str}} pictureof, core, {{name}} {{/str}}</span>
79
                                        </div>
80
                                        {{/urls.image}}
81
 
82
                                    {{/urls.group}}
83
                                    </div>
84
                                {{/groups}}
85
 
86
                        {{/author}}
87
                    {{/isdeleted}}
88
 
89
        <div class="d-flex flex-column w-100"  data-region-content="forum-post-core">
454 ariadna 90
            <header id="post-header-{{id}}-{{uniqid}}" class="forum-post-header d-flex align-items-center">
452 ariadna 91
                {{^isdeleted}}
92
                    {{#author}}
459 ariadna 93
                        <div class="mr-2" style="width: 40px;">
452 ariadna 94
                            {{#urls.profileimage}}
95
                                <img
96
                                    class="rounded w-100"
97
                                    src="{{{.}}}"
98
                                    alt="{{#str}} pictureof, core, {{author.fullname}} {{/str}}"
99
                                    aria-hidden="true"
100
                                    title="{{#str}} pictureof, core, {{author.fullname}} {{/str}}"
101
                                >
102
                            {{/urls.profileimage}}
103
                        </div>
104
                    {{/author}}
105
                {{/isdeleted}}
454 ariadna 106
 
459 ariadna 107
                <div class="d-flex align-items-baseline" style="gap: 6px;">
452 ariadna 108
                    {{#parentauthorname}}
109
                        <span class="sr-only">{{#str}} inreplyto, mod_forum, {{.}} {{/str}}</span>
110
                    {{/parentauthorname}}
111
                    {{$subjectheading}}
112
                    {{#subject}}
113
                        <div {{!
114
                            }}class="{{#unread}}forum-post-unread font-weight-bold{{/unread}} forum-post-core-subject" {{!
115
                            }}data-region-content="forum-post-core-subject" {{!
116
                            }}data-reply-subject="{{replysubject}}" {{!
117
                            }}>
118
 
459 ariadna 119
                                {{$subject}}<h4 class="m-0 text-truncate font-weight-bold text-secondary" title="{{{subject}}}">{{{subject}}}</h5>{{/subject}}
452 ariadna 120
 
121
                            </div>
122
                    {{/subject}}
123
                    {{/subjectheading}}
124
                    {{^isdeleted}}
125
                        <div class="forum-post-details" tabindex="-1">
126
                            {{#html.authorsubheading}}{{{.}}}{{/html.authorsubheading}}
127
                            {{^html.authorsubheading}}
128
                                {{< core/time_element }}
129
                                    {{$elementid}}created-{{id}}-{{uniqid}}{{/elementid}}
130
                                    {{$timestampval}}{{timecreated}}{{/timestampval}}
131
                                    {{$userdateformatval}}{{#str}} strftimedaydatetime, core_langconfig {{/str}}{{/userdateformatval}}
132
                                {{/core/time_element}}
133
                            {{/html.authorsubheading}}
134
                        </div>
135
                    {{/isdeleted}}
136
                    {{#isprivatereply}}
137
                        <div class="privatereplyinfo badge badge-dark mt-1">
138
                        {{#str}}postisprivatereply, forum{{/str}}
139
                        </div>
140
                    {{/isprivatereply}}
141
                    {{#hasreplycount}}
142
                        <span class="sr-only">{{#str}} numberofreplies, mod_forum, {{replycount}} {{/str}}</span>
143
                    {{/hasreplycount}}
144
                </div>
145
            </header>
146
 
147
            <div class="d-flex body-content-container">
148
                <div class="mr-3 d-sm-none d-md-block" style="width: 60px; flex-shrink: 0"></div>
149
                <div class="w-100 content-alignment-container">
454 ariadna 150
                    <div id="post-content-{{id}}" class="post-content-container">
452 ariadna 151
                        {{{message}}}
152
                    </div>
153
 
154
                    {{^isdeleted}}
155
                        {{#haswordcount}}
156
                            <p class="mt-3 mb-0 badge badge-info"><small>{{#str}} numwords, core, {{wordcount}} {{/str}}</small></p>
157
                        {{/haswordcount}}
158
 
159
                        {{#attachments}}
160
                            {{#isimage}}
161
                                <div class="attachedimages">
162
                                    <img
163
                                        src="{{{url}}}"
164
                                        alt="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
165
                                        style="max-width: 100%"
166
                                    >
167
                                    {{#urls.export}}
168
                                        <a href="{{{.}}}" title="{{#str}} addtoportfolio, core_portfolio {{/str}}">
169
                                            {{#pix}} t/portfolioadd, core {{/pix}}
170
                                        </a>
171
                                    {{/urls.export}}
172
                                    {{#html.plagiarism}}
173
                                        <div>{{{.}}}</div>
174
                                    {{/html.plagiarism}}
175
                                </div>
176
                            {{/isimage}}
177
                        {{/attachments}}
178
 
179
                        {{{html.taglist}}}
180
 
181
                        {{#attachments}}
182
                            {{^isimage}}
183
                                <div class="attachments">
184
                                    <a
185
                                        href="{{{url}}}"
186
                                        aria-label="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
187
                                    >
188
                                        {{#pix}} {{icon}}, core {{/pix}} {{filename}}
189
                                    </a>
190
                                    {{#urls.export}}
191
                                        <a href="{{{.}}}" title="{{#str}} exportattachmentname, mod_forum, {{filename}} {{/str}}">
192
                                            {{#pix}} t/portfolioadd, core {{/pix}}
193
                                        </a>
194
                                    {{/urls.export}}
195
                                    {{#html.plagiarism}}
196
                                        <div>{{{.}}}</div>
197
                                    {{/html.plagiarism}}
198
                                </div>
199
                            {{/isimage}}
200
                        {{/attachments}}
201
 
202
                        {{^readonly}}
203
                            <div class="d-flex flex-wrap">
204
                                {{#html.rating}}
205
                                    <div class="mt-2 forum-post-rating">{{{.}}}</div>
206
                                {{/html.rating}}
207
                                {{$actions}}
208
                                    <div
209
                                        class="w-100 post-actions d-flex align-items-center justify-content-md-end justify-content-lg-start flex-wrap mx-0 mt-2 mb-0"
210
                                        data-region="post-actions-container"
211
                                        role="menubar"
212
                                        aria-label='{{#str}} postbyuser, mod_forum, {"post": "{{subject}}", "user": "{{author.fullname}}"} {{/str}}'
213
                                        aria-controls="p{{id}}"
214
                                    >
215
                                        {{#capabilities}}
216
 
217
                                            {{#reply}}
721 ariadna 218
                                            <div>
452 ariadna 219
                                                {{$replyoutput}}
220
                                                    <a
221
                                                        data-region="post-action"
222
                                                        href="{{{urls.reply}}}"
223
                                                        class="btn btn-primary btn-sm"
224
                                                        data-post-id="{{id}}"
225
                                                        data-action="collapsible-link"
226
                                                        data-can-reply-privately="{{canreplyprivately}}"
227
                                                        title="{{#str}} reply, mod_forum {{/str}}"
228
                                                        aria-label="{{#str}} reply, mod_forum {{/str}}"
229
                                                        role="menuitem"
230
                                                    >
231
                                                        <svg width="18" height="18" fill="none" viewBox="0 0 24 24">
232
                                                            <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.25 15.25V6.75H8.75"></path>
233
                                                            <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 7L6.75 17.25"></path>
234
                                                        </svg>
235
                                                        <span class="d-none d-md-flex ml-md-2">{{#str}} reply, mod_forum {{/str}}</span>
236
                                                    </a>
237
                                                {{/replyoutput}}
238
                                            </div>
239
                                            {{/reply}}
240
                                            {{^reply}}
241
                                                {{#selfenrol}}
242
                                                    {{$replyoutput}}
243
                                                        <a
244
                                                            href="{{{urls.reply}}}"
721 ariadna 245
                                                            class="btn btn-primary btn-sm"
452 ariadna 246
                                                            data-post-id="{{id}}"
247
                                                            data-can-reply-privately="{{canreplyprivately}}"
248
                                                            title="{{#str}} reply, mod_forum {{/str}}"
249
                                                            aria-label="{{#str}} reply, mod_forum {{/str}}"
250
                                                            role="menuitem"
251
                                                        >
252
                                                            {{#str}} reply, mod_forum {{/str}}
253
                                                        </a>
254
                                                    {{/replyoutput}}
255
                                                {{/selfenrol}}
256
                                            {{/reply}}
257
 
258
                                            {{#edit}}
721 ariadna 259
                                            <div class="rui-forum-edit-buttons">
452 ariadna 260
                                                {{#controlreadstatus}}
261
                                                {{#unread}}
262
                                                    <a
263
                                                        data-region="post-action"
264
                                                        href="{{{urls.markasread}}}"
265
                                                        class="btn btn-primary btn-sm mb-2"
266
                                                        role="menuitem"
267
                                                        title="{{#str}} markread, mod_forum {{/str}}"
268
                                                        aria-label="{{#str}} markread, mod_forum {{/str}}"
269
                                                    >
270
                                                        {{#str}} markread, mod_forum {{/str}}
271
                                                    </a>
272
                                                {{/unread}}
273
                                                {{^unread}}
274
                                                    <a
275
                                                        data-region="post-action"
276
                                                        href="{{{urls.markasunread}}}"
277
                                                        class="btn btn-secondary btn-sm mb-2"
278
                                                        role="menuitem"
279
                                                        title="{{#str}} markunread, mod_forum {{/str}}"
280
                                                        aria-label="{{#str}} markunread, mod_forum {{/str}}"
281
                                                    >
282
                                                        {{#str}} markunread, mod_forum {{/str}}
283
                                                    </a>
284
                                                {{/unread}}
285
                                                {{/controlreadstatus}}
286
 
287
                                                {{#view}}
288
                                                <a
289
                                                    data-region="post-action"
290
                                                    href="{{{urls.view}}}"
291
                                                    class="btn btn-secondary btn-sm"
292
                                                    title="{{#str}} permanentlinktopost, mod_forum {{/str}}"
293
                                                    aria-label="{{#str}} permanentlinktopost, mod_forum {{/str}}"
294
                                                    role="menuitem"
295
                                                >
296
                                                    <svg width="18" height="18" fill="none" viewBox="0 0 24 24">
297
                                                        <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16.75 13.25L18 12C19.6569 10.3431 19.6569 7.65685 18 6V6C16.3431 4.34315 13.6569 4.34315 12 6L10.75 7.25"></path>
298
                                                        <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7.25 10.75L6 12C4.34315 13.6569 4.34315 16.3431 6 18V18C7.65685 19.6569 10.3431 19.6569 12 18L13.25 16.75"></path>
299
                                                        <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.25 9.75L9.75 14.25"></path>
300
                                                    </svg>
301
                                                    <span class="d-none d-md-flex ml-md-2">{{#str}} permalink, mod_forum {{/str}}</span>
302
                                                </a>
303
                                                {{/view}}
304
 
305
                                                {{#urls.viewparent}}
306
                                                <a
307
                                                    data-region="post-action"
308
                                                    href="{{{.}}}"
309
                                                    class="btn btn-secondary btn-sm"
310
                                                    title="{{#str}} permanentlinktoparentpost, mod_forum {{/str}}"
311
                                                    aria-label="{{#str}} permanentlinktoparentpost, mod_forum {{/str}}"
312
                                                    role="menuitem"
313
                                                >
314
                                                    <svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
315
                                                        <path d="M4.75 19.25H19.25" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
316
                                                        <path d="M12 15.25V4.75" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
317
                                                        <path d="M15.25 8.25L12 4.75L8.75 8.25" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
318
                                                    </svg>
319
                                                    <span class="d-none d-md-flex ml-md-2">{{#str}} parent, mod_forum {{/str}}</span>
320
                                                </a>
321
                                                {{/urls.viewparent}}
322
 
323
                                                <a
324
                                                    data-region="post-action"
325
                                                    href="{{{urls.edit}}}"
326
                                                    class="btn btn-outline-secondary btn-sm"
327
                                                    role="menuitem"
328
                                                    title="{{#str}} edit, mod_forum {{/str}}"
329
                                                    aria-label="{{#str}} edit, mod_forum {{/str}}"
330
                                                >
331
                                                    <svg width="18" height="18" fill="none" viewBox="0 0 24 24">
332
                                                        <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" 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>
333
                                                        <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19.25 19.25H13.75"></path>
334
                                                    </svg>
335
                                                    <span class="d-none d-md-flex ml-md-2">{{#str}} edit, mod_forum {{/str}}</span>
336
                                                </a>
337
                                            {{/edit}}
338
 
339
                                            {{#split}}
340
                                                <a
341
                                                    data-region="post-action"
342
                                                    href="{{{urls.split}}}"
343
                                                    class="btn btn-outline-secondary btn-sm"
344
                                                    role="menuitem"
345
                                                    title="{{#str}} prune, mod_forum {{/str}}"
346
                                                    aria-label="{{#str}} prune, mod_forum {{/str}}"
347
                                                >
348
                                                    <svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
349
                                                        <path d="M9.25 8C9.25 9.24264 8.24264 10.25 7 10.25C5.75736 10.25 4.75 9.24264 4.75 8C4.75 6.75736 5.75736 5.75 7 5.75C8.24264 5.75 9.25 6.75736 9.25 8Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
350
                                                        <path d="M9.25 16C9.25 17.2426 8.24264 18.25 7 18.25C5.75736 18.25 4.75 17.2426 4.75 16C4.75 14.7574 5.75736 13.75 7 13.75C8.24264 13.75 9.25 14.7574 9.25 16Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
351
                                                        <path d="M9 15L19.25 6.75" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
352
                                                        <path d="M9 9L19.25 16.25" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
353
                                                    </svg>
354
                                                    <span class="d-none d-md-flex ml-md-2">{{#str}} prune, mod_forum {{/str}}</span>
355
                                                </a>
356
                                            {{/split}}
357
                                            {{#delete}}
358
                                                <a
359
                                                    data-region="post-action"
360
                                                    href="{{{urls.delete}}}"
361
                                                    class="btn btn-outline-danger btn-sm btn-icon"
362
                                                    role="menuitem"
363
                                                    title="{{#str}} delete, mod_forum {{/str}}"
364
                                                    aria-label="{{#str}} delete, mod_forum {{/str}}"
365
                                                >
366
                                                    <svg width="18" height="18" fill="none" viewBox="0 0 24 24">
367
                                                        <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" 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>
368
                                                        <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" 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>
369
                                                        <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 7.75H19"></path>
370
                                                    </svg>
371
                                                </a>
372
                                            {{/delete}}
373
 
374
                                            {{#edit}}
375
                                            </div>
376
                                            {{/edit}}
377
 
378
                                            {{#export}}
721 ariadna 379
                                            <div class="ml-md-auto">
452 ariadna 380
                                                <a
381
                                                    data-region="post-action"
382
                                                    href="{{{urls.export}}}"
383
                                                    class="btn btn-secondary btn-sm"
384
                                                    title="{{#str}} addtoportfolio, core_portfolio {{/str}}"
385
                                                    aria-label="{{#str}} addtoportfolio, core_portfolio {{/str}}"
386
                                                    role="menuitem"
387
                                                >
388
                                                    {{#str}} addtoportfolio, core_portfolio {{/str}}
389
                                                </a>
390
                                            </div>
391
                                            {{/export}}
392
                                        {{/capabilities}}
393
                                    </div>
394
                                {{/actions}}
395
                            </div>
396
                        {{/readonly}}
397
 
398
                        <div class="forum-post-footer">{{$footer}}{{/footer}}</div>
399
                    {{/isdeleted}}
400
                </div>
401
            </div>
402
        </div>
403
    </div>
404
 
405
    {{$replies}}
406
        <div data-region="replies-container">
407
            {{#hasreplies}}
408
                {{#replies}}
409
                    {{> mod_forum/forum_discussion_post }}
410
                {{/replies}}
411
            {{/hasreplies}}
412
        </div>
413
    {{/replies}}
414
</article>