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 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 mb-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="d-flex border p-2 mb-2 forumpost 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 header row d-flex">
52
                {{^isdeleted}}
53
                    {{#author}}
54
                        <div class="mr-2" style="width: 45px;">
55
                            {{#urls.profileimage}}
56
                                <img
57
                                    class="rounded-circle 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
                        <h3 {{!
73
                            }}class="h6 font-weight-bold mb-0" {{!
74
                            }}data-region-content="forum-post-core-subject" {{!
75
                            }}data-reply-subject="{{replysubject}}" {{!
76
                            }}>{{$subject}}{{{subject}}}{{/subject}}</h3>
77
                    {{/subjectheading}}
78
                    {{^isdeleted}}
79
                        <div class="mb-3" tabindex="-1">
80
                            {{#html.authorsubheading}}{{{.}}}{{/html.authorsubheading}}
81
                            {{^html.authorsubheading}}
82
                                {{< core/time_element }}
83
                                    {{$elementid}}created-{{id}}-{{uniqid}}{{/elementid}}
84
                                    {{$timestampval}}{{timecreated}}{{/timestampval}}
85
                                    {{$userdateformatval}}{{#str}} strftimedaydatetime, core_langconfig {{/str}}{{/userdateformatval}}
86
                                {{/core/time_element}}
87
                            {{/html.authorsubheading}}
88
                        </div>
89
                    {{/isdeleted}}
90
                    {{#isprivatereply}}
91
                        <div class="privatereplyinfo">
92
                        {{#str}}postisprivatereply, forum{{/str}}
93
                        </div>
94
                    {{/isprivatereply}}
95
                    {{#hasreplycount}}
96
                        <span class="sr-only">{{#str}} numberofreplies, mod_forum, {{replycount}} {{/str}}</span>
97
                    {{/hasreplycount}}
98
                </div>
99
            </header>
100
 
101
            <div class="d-flex body-content-container">
102
                {{^isdeleted}}
103
                    {{#author}}
104
                        <div class="mr-2 author-groups-container" style="width: 45px; flex-shrink: 0">
105
                            {{#groups}}
106
                                {{#urls.group}}
107
                                    {{#urls.image}}
108
                                        <a href="{{urls.group}}" role="button" aria-label='{{#str}} memberofgroup, group, {{name}}{{/str}}'>
109
                                            <img
110
                                                 class="rounded-circle w-100"
111
                                                 src="{{{.}}}"
112
                                                 alt="{{#str}} pictureof, core, {{name}} {{/str}}"
113
                                                 aria-hidden="true"
114
                                                 title="{{#str}} pictureof, core, {{name}} {{/str}}"
115
                                            >
116
                                        </a>
117
                                    {{/urls.image}}
118
                                {{/urls.group}}
119
                                {{^urls.group}}
120
                                    {{#urls.image}}
121
                                        <img class="rounded-circle w-100"
122
                                            src="{{{.}}}"
123
                                            alt="{{#str}} pictureof, core, {{name}} {{/str}}"
124
                                            title="{{#str}} pictureof, core, {{name}} {{/str}}"
125
                                        >
126
                                    {{/urls.image}}
127
                                {{/urls.group}}
128
                            {{/groups}}
129
                        </div>
130
                    {{/author}}
131
                {{/isdeleted}}
132
 
133
                <div class="no-overflow w-100 content-alignment-container">
134
                    <div id="post-content-{{id}}" class="post-content-container">
135
                        {{{message}}}
136
                    </div>
137
 
138
                    {{^isdeleted}}
139
                        {{#haswordcount}}
140
                            <p class="font-italic mb-0"><small>{{#str}} numwords, core, {{wordcount}} {{/str}}</small></p>
141
                        {{/haswordcount}}
142
 
143
                        {{#attachments}}
144
                            {{#isimage}}
145
                                <div class="attachedimages">
146
                                    <img
147
                                        src="{{{url}}}"
148
                                        alt="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
149
                                        style="max-width: 100%"
150
                                    >
151
                                    {{#urls.export}}
152
                                        <a href="{{{.}}}" title="{{#str}} addtoportfolio, core_portfolio {{/str}}">
153
                                            {{#pix}} t/portfolioadd, core {{/pix}}
154
                                        </a>
155
                                    {{/urls.export}}
156
                                    {{#html.plagiarism}}
157
                                        <div>{{{.}}}</div>
158
                                    {{/html.plagiarism}}
159
                                </div>
160
                            {{/isimage}}
161
                        {{/attachments}}
162
 
163
                        {{{html.taglist}}}
164
 
165
                        {{#attachments}}
166
                            {{^isimage}}
167
                                <div>
168
                                    <a
169
                                        href="{{{url}}}"
170
                                        aria-label="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
171
                                    >
172
                                        {{#pix}} {{icon}}, core {{/pix}} {{filename}}
173
                                    </a>
174
                                    {{#urls.export}}
175
                                        <a href="{{{.}}}" title="{{#str}} exportattachmentname, mod_forum, {{filename}} {{/str}}">
176
                                            {{#pix}} t/portfolioadd, core {{/pix}}
177
                                        </a>
178
                                    {{/urls.export}}
179
                                    {{#html.plagiarism}}
180
                                        <div>{{{.}}}</div>
181
                                    {{/html.plagiarism}}
182
                                </div>
183
                            {{/isimage}}
184
                        {{/attachments}}
185
 
186
                        {{^readonly}}
187
                            <div class="d-flex flex-wrap">
188
                                {{#html.rating}}
189
                                    <div class="mt-2">{{{.}}}</div>
190
                                {{/html.rating}}
191
                                {{$actions}}
192
                                    <div
193
                                        class="post-actions d-flex align-self-end justify-content-end flex-wrap ml-auto"
194
                                        data-region="post-actions-container"
195
                                        role="menubar"
196
                                        aria-label='{{#str}} postbyuser, mod_forum, {"post": "{{subject}}", "user": "{{author.fullname}}"} {{/str}}'
197
                                        aria-controls="p{{id}}"
198
                                    >
199
                                        {{#capabilities}}
200
                                            {{#view}}
201
                                                <a
202
                                                    data-region="post-action"
203
                                                    href="{{{urls.view}}}"
204
                                                    class="btn btn-link"
205
                                                    title="{{#str}} permanentlinktopost, mod_forum {{/str}}"
206
                                                    aria-label="{{#str}} permanentlinktopost, mod_forum {{/str}}"
207
                                                    role="menuitem"
208
                                                >
209
                                                    {{#str}} permalink, mod_forum {{/str}}
210
                                                </a>
211
                                            {{/view}}
212
                                            {{#controlreadstatus}}
213
                                                {{#unread}}
214
                                                    <a
215
                                                        data-region="post-action"
216
                                                        href="{{{urls.markasread}}}"
217
                                                        class="btn btn-link"
218
                                                        role="menuitem"
219
                                                    >
220
                                                        {{#str}} markread, mod_forum {{/str}}
221
                                                    </a>
222
                                                {{/unread}}
223
                                                {{^unread}}
224
                                                    <a
225
                                                        data-region="post-action"
226
                                                        href="{{{urls.markasunread}}}"
227
                                                        class="btn btn-link"
228
                                                        role="menuitem"
229
                                                    >
230
                                                        {{#str}} markunread, mod_forum {{/str}}
231
                                                    </a>
232
                                                {{/unread}}
233
                                            {{/controlreadstatus}}
234
                                            {{#urls.viewparent}}
235
                                                <a
236
                                                    data-region="post-action"
237
                                                    href="{{{.}}}"
238
                                                    class="btn btn-link"
239
                                                    title="{{#str}} permanentlinktoparentpost, mod_forum {{/str}}"
240
                                                    aria-label="{{#str}} permanentlinktoparentpost, mod_forum {{/str}}"
241
                                                    role="menuitem"
242
                                                >
243
                                                    {{#str}} parent, mod_forum {{/str}}
244
                                                </a>
245
                                            {{/urls.viewparent}}
246
                                            {{#edit}}
247
                                                <a
248
                                                    data-region="post-action"
249
                                                    href="{{{urls.edit}}}"
250
                                                    class="btn btn-link"
251
                                                    role="menuitem"
252
                                                >
253
                                                    {{#str}} edit, mod_forum {{/str}}
254
                                                </a>
255
                                            {{/edit}}
256
                                            {{#split}}
257
                                                <a
258
                                                    data-region="post-action"
259
                                                    href="{{{urls.split}}}"
260
                                                    class="btn btn-link"
261
                                                    role="menuitem"
262
                                                >
263
                                                    {{#str}} prune, mod_forum {{/str}}
264
                                                </a>
265
                                            {{/split}}
266
                                            {{#delete}}
267
                                                <a
268
                                                    data-region="post-action"
269
                                                    href="{{{urls.delete}}}"
270
                                                    class="btn btn-link"
271
                                                    role="menuitem"
272
                                                >
273
                                                    {{#str}} delete, mod_forum {{/str}}
274
                                                </a>
275
                                            {{/delete}}
276
                                            {{#reply}}
277
                                                {{$replyoutput}}
278
                                                    <a
279
                                                        data-region="post-action"
280
                                                        href="{{{urls.reply}}}"
281
                                                        class="btn btn-link"
282
                                                        data-post-id="{{id}}"
283
                                                        data-action="collapsible-link"
284
                                                        data-can-reply-privately="{{canreplyprivately}}"
285
                                                        title="{{#str}} reply, mod_forum {{/str}}"
286
                                                        role="menuitem"
287
                                                    >
288
                                                        {{#str}} reply, mod_forum {{/str}}
289
                                                    </a>
290
                                                {{/replyoutput}}
291
                                            {{/reply}}
292
                                            {{^reply}}
293
                                                {{#selfenrol}}
294
                                                    {{$replyoutput}}
295
                                                        <a
296
                                                            href="{{{urls.reply}}}"
297
                                                            class="btn btn-link"
298
                                                            data-post-id="{{id}}"
299
                                                            data-can-reply-privately="{{canreplyprivately}}"
300
                                                            title="{{#str}} reply, mod_forum {{/str}}"
301
                                                            role="menuitem"
302
                                                        >
303
                                                            {{#str}} reply, mod_forum {{/str}}
304
                                                        </a>
305
                                                    {{/replyoutput}}
306
                                                {{/selfenrol}}
307
                                            {{/reply}}
308
                                            {{#export}}
309
                                                <a
310
                                                    data-region="post-action"
311
                                                    href="{{{urls.export}}}"
312
                                                    class="btn btn-link"
313
                                                    role="menuitem"
314
                                                >
315
                                                    {{#str}} addtoportfolio, core_portfolio {{/str}}
316
                                                </a>
317
                                            {{/export}}
318
                                        {{/capabilities}}
319
                                    </div>
320
                                {{/actions}}
321
                            </div>
322
                        {{/readonly}}
323
 
324
                        {{$footer}}{{/footer}}
325
                    {{/isdeleted}}
326
                </div>
327
            </div>
328
        </div>
329
    </div>
330
 
331
    {{$replies}}
332
        <div data-region="replies-container">
333
            {{#hasreplies}}
334
                {{#replies}}
335
                    {{> mod_forum/forum_discussion_post }}
336
                {{/replies}}
337
            {{/hasreplies}}
338
        </div>
339
    {{/replies}}
340
</article>