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 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
        <div class="d-flex flex-column w-100"  data-region-content="forum-post-core">
51
            <header id="post-header-{{id}}-{{uniqid}}" class="mb-2 pb-2 forum-post-header d-flex align-items-center">
52
                {{^isdeleted}}
53
                    {{#author}}
54
                        <div class="mb-0 mr-3" style="width: 60px;">
55
                            {{#urls.profileimage}}
56
                                <img
57
                                    class="rounded w-100"
58
                                    src="{{{.}}}"
59
                                    alt="{{#str}} pictureof, core, {{author.fullname}} {{/str}}"
60
                                    aria-hidden="true"
61
                                    title="{{#str}} pictureof, core, {{author.fullname}} {{/str}}"
62
                                >
63
                            {{/urls.profileimage}}
64
                        </div>
65
                    {{/author}}
66
                {{/isdeleted}}
67
                <div class="d-flex flex-column">
68
                    {{#parentauthorname}}
69
                        <span class="sr-only">{{#str}} inreplyto, mod_forum, {{.}} {{/str}}</span>
70
                    {{/parentauthorname}}
71
                    {{$subjectheading}}
72
                    {{#subject}}
73
                        <div {{!
74
                            }}class="{{#unread}}forum-post-unread font-weight-bold{{/unread}} forum-post-core-subject" {{!
75
                            }}data-region-content="forum-post-core-subject" {{!
76
                            }}data-reply-subject="{{replysubject}}" {{!
77
                            }}>
78
 
79
                                {{$subject}}<h5 class="my-0" title="{{{subject}}}"><span class="d-inline-block text-truncate font-weight-bold" style="max-width: 600px;" title="{{subject}}">{{{subject}}}</span></h5>{{/subject}}
80
 
81
                            </div>
82
                    {{/subject}}
83
                    {{/subjectheading}}
84
                    {{^isdeleted}}
85
                        <div class="forum-post-details" tabindex="-1">
86
                            {{#html.authorsubheading}}{{{.}}}{{/html.authorsubheading}}
87
                            {{^html.authorsubheading}}
88
                                {{< core/time_element }}
89
                                    {{$elementid}}created-{{id}}-{{uniqid}}{{/elementid}}
90
                                    {{$timestampval}}{{timecreated}}{{/timestampval}}
91
                                    {{$userdateformatval}}{{#str}} strftimedaydatetime, core_langconfig {{/str}}{{/userdateformatval}}
92
                                {{/core/time_element}}
93
                            {{/html.authorsubheading}}
94
                        </div>
95
                    {{/isdeleted}}
96
                    {{#isprivatereply}}
97
                        <div class="privatereplyinfo badge badge-dark mt-1">
98
                        {{#str}}postisprivatereply, forum{{/str}}
99
                        </div>
100
                    {{/isprivatereply}}
101
                    {{#hasreplycount}}
102
                        <span class="sr-only">{{#str}} numberofreplies, mod_forum, {{replycount}} {{/str}}</span>
103
                    {{/hasreplycount}}
104
                </div>
105
            </header>
106
 
107
            <div class="d-flex body-content-container">
1441 ariadna 108
                {{^isdeleted}}
109
                    {{#author}}
110
                        <div class="me-2 author-groups-container" style="width: 68px; flex-shrink: 0">
111
                            {{#groups}}
112
                                {{#urls.group}}
113
                                    {{#urls.image}}
114
                                        <a href="{{urls.group}}" role="button" aria-label='{{#str}} memberofgroup, group, {{name}}{{/str}}'>
115
                                            <img
116
                                                 class="rounded-circle w-100"
117
                                                 src="{{{.}}}"
118
                                                 alt="{{#str}} pictureof, core, {{name}} {{/str}}"
119
                                                 aria-hidden="true"
120
                                                 title="{{#str}} pictureof, core, {{name}} {{/str}}"
121
                                            >
122
                                        </a>
123
                                    {{/urls.image}}
124
                                {{/urls.group}}
125
                                {{^urls.group}}
126
                                    {{#urls.image}}
127
                                        <img class="rounded-circle w-100"
128
                                            src="{{{.}}}"
129
                                            alt="{{#str}} pictureof, core, {{name}} {{/str}}"
130
                                            title="{{#str}} pictureof, core, {{name}} {{/str}}"
131
                                        >
132
                                    {{/urls.image}}
133
                                {{/urls.group}}
134
                            {{/groups}}
135
                        </div>
136
                    {{/author}}
137
                {{/isdeleted}}
138
 
1 efrain 139
                <div class="w-100 content-alignment-container">
140
                    <div id="post-content-{{id}}" class="post-content-container mb-2">
141
                        {{{message}}}
142
                    </div>
143
 
144
                    {{^isdeleted}}
145
                        {{#haswordcount}}
146
                            <p class="mt-3 mb-0 badge badge-info"><small>{{#str}} numwords, core, {{wordcount}} {{/str}}</small></p>
147
                        {{/haswordcount}}
148
 
149
                        {{#attachments}}
150
                            {{#isimage}}
151
                                <div class="attachedimages">
152
                                    <img
153
                                        src="{{{url}}}"
154
                                        alt="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
155
                                        style="max-width: 100%"
156
                                    >
157
                                    {{#urls.export}}
158
                                        <a href="{{{.}}}" title="{{#str}} addtoportfolio, core_portfolio {{/str}}">
159
                                            {{#pix}} t/portfolioadd, core {{/pix}}
160
                                        </a>
161
                                    {{/urls.export}}
162
                                    {{#html.plagiarism}}
163
                                        <div>{{{.}}}</div>
164
                                    {{/html.plagiarism}}
165
                                </div>
166
                            {{/isimage}}
167
                        {{/attachments}}
168
 
169
                        {{{html.taglist}}}
170
 
171
                        {{#attachments}}
172
                            {{^isimage}}
173
                                <div class="attachments">
174
                                    <a
175
                                        href="{{{url}}}"
176
                                        aria-label="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
177
                                    >
178
                                        {{#pix}} {{icon}}, core {{/pix}} {{filename}}
179
                                    </a>
180
                                    {{#urls.export}}
181
                                        <a href="{{{.}}}" title="{{#str}} exportattachmentname, mod_forum, {{filename}} {{/str}}">
182
                                            {{#pix}} t/portfolioadd, core {{/pix}}
183
                                        </a>
184
                                    {{/urls.export}}
185
                                    {{#html.plagiarism}}
186
                                        <div>{{{.}}}</div>
187
                                    {{/html.plagiarism}}
188
                                </div>
189
                            {{/isimage}}
190
                        {{/attachments}}
191
 
192
                        {{^readonly}}
193
                            <div class="d-flex flex-wrap">
194
                                {{#html.rating}}
195
                                    <div class="mt-2 forum-post-rating">{{{.}}}</div>
196
                                {{/html.rating}}
197
                                {{$actions}}
198
                                    <div
199
                                        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"
200
                                        data-region="post-actions-container"
201
                                        role="menubar"
202
                                        aria-label='{{#str}} postbyuser, mod_forum, {"post": "{{subject}}", "user": "{{author.fullname}}"} {{/str}}'
203
                                        aria-controls="p{{id}}"
204
                                    >
205
                                        {{#capabilities}}
206
 
207
                                            {{#reply}}
208
                                            <div class="mb-2">
209
                                                {{$replyoutput}}
210
                                                    <a
211
                                                        data-region="post-action"
212
                                                        href="{{{urls.reply}}}"
213
                                                        class="btn btn-primary btn-sm"
214
                                                        data-post-id="{{id}}"
215
                                                        data-action="collapsible-link"
216
                                                        data-can-reply-privately="{{canreplyprivately}}"
217
                                                        title="{{#str}} reply, mod_forum {{/str}}"
218
                                                        aria-label="{{#str}} reply, mod_forum {{/str}}"
219
                                                        role="menuitem"
220
                                                    >
221
                                                        <svg width="18" height="18" fill="none" viewBox="0 0 24 24">
222
                                                            <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.25 15.25V6.75H8.75"></path>
223
                                                            <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 7L6.75 17.25"></path>
224
                                                        </svg>
225
                                                        <span class="d-none d-md-flex ml-md-2">{{#str}} reply, mod_forum {{/str}}</span>
226
                                                    </a>
227
                                                {{/replyoutput}}
228
                                            </div>
229
                                            {{/reply}}
230
                                            {{^reply}}
231
                                                {{#selfenrol}}
232
                                                    {{$replyoutput}}
233
                                                        <a
234
                                                            href="{{{urls.reply}}}"
235
                                                            class="btn btn-primary btn-sm mb-2"
236
                                                            data-post-id="{{id}}"
237
                                                            data-can-reply-privately="{{canreplyprivately}}"
238
                                                            title="{{#str}} reply, mod_forum {{/str}}"
239
                                                            aria-label="{{#str}} reply, mod_forum {{/str}}"
240
                                                            role="menuitem"
241
                                                        >
242
                                                            {{#str}} reply, mod_forum {{/str}}
243
                                                        </a>
244
                                                    {{/replyoutput}}
245
                                                {{/selfenrol}}
246
                                            {{/reply}}
247
 
248
                                            {{#edit}}
249
                                            <div class="ml-2 mb-2 rui-forum-edit-buttons">
250
                                                {{#controlreadstatus}}
251
                                                {{#unread}}
252
                                                    <a
253
                                                        data-region="post-action"
254
                                                        href="{{{urls.markasread}}}"
255
                                                        class="btn btn-primary btn-sm mb-2"
256
                                                        role="menuitem"
257
                                                        title="{{#str}} markread, mod_forum {{/str}}"
258
                                                        aria-label="{{#str}} markread, mod_forum {{/str}}"
259
                                                    >
260
                                                        {{#str}} markread, mod_forum {{/str}}
261
                                                    </a>
262
                                                {{/unread}}
263
                                                {{^unread}}
264
                                                    <a
265
                                                        data-region="post-action"
266
                                                        href="{{{urls.markasunread}}}"
267
                                                        class="btn btn-secondary btn-sm mb-2"
268
                                                        role="menuitem"
269
                                                        title="{{#str}} markunread, mod_forum {{/str}}"
270
                                                        aria-label="{{#str}} markunread, mod_forum {{/str}}"
271
                                                    >
272
                                                        {{#str}} markunread, mod_forum {{/str}}
273
                                                    </a>
274
                                                {{/unread}}
275
                                                {{/controlreadstatus}}
276
 
277
                                                {{#view}}
278
                                                <a
279
                                                    data-region="post-action"
280
                                                    href="{{{urls.view}}}"
281
                                                    class="btn btn-secondary btn-sm"
282
                                                    title="{{#str}} permanentlinktopost, mod_forum {{/str}}"
283
                                                    aria-label="{{#str}} permanentlinktopost, mod_forum {{/str}}"
284
                                                    role="menuitem"
285
                                                >
286
                                                    <svg width="18" height="18" fill="none" viewBox="0 0 24 24">
287
                                                        <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>
288
                                                        <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>
289
                                                        <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.25 9.75L9.75 14.25"></path>
290
                                                    </svg>
291
                                                    <span class="d-none d-md-flex ml-md-2">{{#str}} permalink, mod_forum {{/str}}</span>
292
                                                </a>
293
                                                {{/view}}
294
 
295
                                                {{#urls.viewparent}}
296
                                                <a
297
                                                    data-region="post-action"
298
                                                    href="{{{.}}}"
299
                                                    class="btn btn-secondary btn-sm"
300
                                                    title="{{#str}} permanentlinktoparentpost, mod_forum {{/str}}"
301
                                                    aria-label="{{#str}} permanentlinktoparentpost, mod_forum {{/str}}"
302
                                                    role="menuitem"
303
                                                >
304
                                                    <svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
305
                                                        <path d="M4.75 19.25H19.25" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
306
                                                        <path d="M12 15.25V4.75" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
307
                                                        <path d="M15.25 8.25L12 4.75L8.75 8.25" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
308
                                                    </svg>
309
                                                    <span class="d-none d-md-flex ml-md-2">{{#str}} parent, mod_forum {{/str}}</span>
310
                                                </a>
311
                                                {{/urls.viewparent}}
312
 
313
                                                <a
314
                                                    data-region="post-action"
315
                                                    href="{{{urls.edit}}}"
316
                                                    class="btn btn-outline-secondary btn-sm"
317
                                                    role="menuitem"
318
                                                    title="{{#str}} edit, mod_forum {{/str}}"
319
                                                    aria-label="{{#str}} edit, mod_forum {{/str}}"
320
                                                >
321
                                                    <svg width="18" height="18" fill="none" viewBox="0 0 24 24">
322
                                                        <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>
323
                                                        <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19.25 19.25H13.75"></path>
324
                                                    </svg>
325
                                                    <span class="d-none d-md-flex ml-md-2">{{#str}} edit, mod_forum {{/str}}</span>
326
                                                </a>
327
                                            {{/edit}}
328
 
329
                                            {{#split}}
330
                                                <a
331
                                                    data-region="post-action"
332
                                                    href="{{{urls.split}}}"
333
                                                    class="btn btn-outline-secondary btn-sm"
334
                                                    role="menuitem"
335
                                                    title="{{#str}} prune, mod_forum {{/str}}"
336
                                                    aria-label="{{#str}} prune, mod_forum {{/str}}"
337
                                                >
338
                                                    <svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
339
                                                        <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>
340
                                                        <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>
341
                                                        <path d="M9 15L19.25 6.75" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
342
                                                        <path d="M9 9L19.25 16.25" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
343
                                                    </svg>
344
                                                    <span class="d-none d-md-flex ml-md-2">{{#str}} prune, mod_forum {{/str}}</span>
345
                                                </a>
346
                                            {{/split}}
347
                                            {{#delete}}
348
                                                <a
349
                                                    data-region="post-action"
350
                                                    href="{{{urls.delete}}}"
351
                                                    class="btn btn-outline-danger btn-sm btn-icon"
352
                                                    role="menuitem"
353
                                                    title="{{#str}} delete, mod_forum {{/str}}"
354
                                                    aria-label="{{#str}} delete, mod_forum {{/str}}"
355
                                                >
356
                                                    <svg width="18" height="18" fill="none" viewBox="0 0 24 24">
357
                                                        <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>
358
                                                        <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>
359
                                                        <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 7.75H19"></path>
360
                                                    </svg>
361
                                                </a>
362
                                            {{/delete}}
363
 
364
                                            {{#edit}}
365
                                            </div>
366
                                            {{/edit}}
367
 
368
                                            {{#export}}
369
                                            <div class="ml-md-auto mb-2">
370
                                                <a
371
                                                    data-region="post-action"
372
                                                    href="{{{urls.export}}}"
373
                                                    class="btn btn-secondary btn-sm"
374
                                                    title="{{#str}} addtoportfolio, core_portfolio {{/str}}"
375
                                                    aria-label="{{#str}} addtoportfolio, core_portfolio {{/str}}"
376
                                                    role="menuitem"
377
                                                >
378
                                                    {{#str}} addtoportfolio, core_portfolio {{/str}}
379
                                                </a>
380
                                            </div>
381
                                            {{/export}}
382
                                        {{/capabilities}}
383
                                    </div>
384
                                {{/actions}}
385
                            </div>
386
                        {{/readonly}}
387
 
388
                        <div class="forum-post-footer">{{$footer}}{{/footer}}</div>
389
                    {{/isdeleted}}
390
                </div>
391
            </div>
392
        </div>
393
    </div>
394
 
395
    {{$replies}}
396
        <div data-region="replies-container">
397
            {{#hasreplies}}
398
                {{#replies}}
399
                    {{> mod_forum/forum_discussion_post }}
400
                {{/replies}}
401
            {{/hasreplies}}
402
        </div>
403
    {{/replies}}
404
</article>