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_nested_v2_first_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"
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 focus-target mb-4 {{#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="author-image-container d-inline-block text-center">
51
            {{^isdeleted}}
52
                {{#author}}
53
                    {{#urls.profileimage}}
54
                        <img
55
                            class="rounded-circle w-100"
56
                            src="{{{.}}}"
57
                            alt="{{#str}} pictureof, core, {{author.fullname}} {{/str}}"
58
                            aria-hidden="true"
59
                        >
60
                    {{/urls.profileimage}}
61
                {{/author}}
62
            {{/isdeleted}}
63
 
64
            {{#unread}}
65
                <div class="icon-size-4 text-info text-center mt-3 icon-no-margin">
66
                    <span
67
                        data-toggle="tooltip"
68
                        data-placement="left"
69
                        title="{{#str}} unreadpost, mod_forum {{/str}}"
70
                        tabindex="0"
71
                    >{{#pix}} i/flagged, core {{/pix}}</span>
72
                </div>
73
            {{/unread}}
74
        </div>
75
 
76
        <div class="forum-post-core d-flex flex-column w-100"  data-region-content="forum-post-core">
77
            <header id="post-header-{{id}}-{{uniqid}}">
78
                {{^isdeleted}}
79
                    <div class="d-flex flex-wrap align-items-center mb-1">
80
                        <div class="mr-2" tabindex="-1">
81
                            {{#author}}
82
                                <h4 class="h6 d-lg-inline-block mb-0 author-header mr-1">
83
                                    {{#parentauthorname}}
84
                                        {{#isprivatereply}}
85
                                            <span class="text-danger">
86
                                                {{#str}}
87
                                                    authorreplyingprivatelytoauthor, mod_forum, {
88
                                                        "respondant":"<a class='font-weight-bold author-name' data-region='author-name' href='{{{urls.profile}}}'>{{fullname}}</a>",
89
                                                        "author":"{{parentauthorname}}"
90
                                                    }
91
                                                {{/str}}
92
                                            </span>
93
                                        {{/isprivatereply}}
94
                                        {{^isprivatereply}}
95
                                            {{#str}}
96
                                                authorreplyingtoauthor, mod_forum, {
97
                                                    "respondant":"<a class='font-weight-bold author-name' data-region='author-name' href='{{{urls.profile}}}'>{{fullname}}</a>",
98
                                                    "author":"{{parentauthorname}}"
99
                                                }
100
                                            {{/str}}
101
                                        {{/isprivatereply}}
102
                                    {{/parentauthorname}}
103
                                    {{^parentauthorname}}
104
                                        <a class='font-weight-bold author-name' data-region='author-name' href="{{{urls.profile}}}">{{fullname}}</a>
105
                                    {{/parentauthorname}}
106
                                </h4>
107
                            {{/author}}
108
                            {{< core/time_element }}
109
                                {{$elementid}}created-{{id}}-{{uniqid}}{{/elementid}}
110
                                {{$elementclass}}text-muted{{/elementclass}}
111
                                {{$timestampval}}{{timecreated}}{{/timestampval}}
112
                                {{$userdateformatval}}{{#str}} strftimerecentfull, core_langconfig {{/str}}{{/userdateformatval}}
113
                            {{/core/time_element}}
114
                        </div>
115
 
116
                        <div class="d-flex align-items-center ml-auto">
117
                            {{#author.groups}}
118
                                {{#urls.image}}
119
                                    <div class="mr-2">
120
                                        {{#urls.group}}
121
                                            <a href="{{urls.group}}" aria-label='{{#str}} memberofgroup, group, {{name}}{{/str}}'>
122
                                                <img
123
                                                    class="rounded-circle group-image"
124
                                                    src="{{{urls.image}}}"
125
                                                    alt="{{#str}} pictureof, core, {{name}} {{/str}}"
126
                                                    aria-hidden="true"
127
                                                    title="{{#str}} pictureof, core, {{name}} {{/str}}"
128
                                                >
129
                                            </a>
130
                                        {{/urls.group}}
131
                                        {{^urls.group}}
132
                                            <img class="rounded-circle group-image"
133
                                                src="{{{urls.image}}}"
134
                                                alt="{{#str}} pictureof, core, {{name}} {{/str}}"
135
                                                title="{{#str}} pictureof, core, {{name}} {{/str}}"
136
                                            >
137
                                        {{/urls.group}}
138
                                    </div>
139
                                {{/urls.image}}
140
                            {{/author.groups}}
141
 
142
                            {{^readonly}}
143
                                {{#showactionmenu}}
144
                                    <div class="dropdown">
145
                                        <button
146
                                            class="btn btn-icon text-muted icon-no-margin icon-size-3"
147
                                            type="button"
148
                                            id="post-actions-menu-{{id}}-{{uniqid}}"
149
                                            data-toggle="dropdown"
150
                                            aria-haspopup="true"
151
                                            aria-expanded="false"
152
                                            aria-label="{{#str}} actionsforpost, mod_forum {{/str}}"
153
                                        >
154
                                            {{#pix}} i/moremenu {{/pix}}
155
                                        </button>
156
                                        <!-- inline style to fix RTL placement bug -->
157
                                        <div class="dropdown-menu dropdown-menu-right rounded-lg shadow border-0" aria-labelledby="post-actions-menu-{{id}}-{{uniqid}}" style="right: auto" role="menubar">
158
                                            {{#capabilities}}
159
                                                {{#view}}
160
                                                    <a
161
                                                        href="{{{urls.view}}}"
162
                                                        class="dropdown-item"
163
                                                        role="menuitem"
164
                                                    >
165
                                                        {{#str}} permalink, mod_forum {{/str}}
166
                                                    </a>
167
                                                {{/view}}
168
                                                {{#controlreadstatus}}
169
                                                    {{#unread}}
170
                                                        <a
171
                                                            href="{{{urls.markasread}}}"
172
                                                            class="dropdown-item"
173
                                                            role="menuitem"
174
                                                        >
175
                                                            {{#str}} markread, mod_forum {{/str}}
176
                                                        </a>
177
                                                    {{/unread}}
178
                                                    {{^unread}}
179
                                                        <a
180
                                                            href="{{{urls.markasunread}}}"
181
                                                            class="dropdown-item"
182
                                                            role="menuitem"
183
                                                        >
184
                                                            {{#str}} markunread, mod_forum {{/str}}
185
                                                        </a>
186
                                                    {{/unread}}
187
                                                {{/controlreadstatus}}
188
                                                {{#urls.viewparent}}
189
                                                    <a
190
                                                        href="{{{.}}}"
191
                                                        class="dropdown-item"
192
                                                        title="{{#str}} permanentlinktoparentpost, mod_forum {{/str}}"
193
                                                        role="menuitem"
194
                                                    >
195
                                                        {{#str}} parent, mod_forum {{/str}}
196
                                                    </a>
197
                                                {{/urls.viewparent}}
198
                                                {{#edit}}
199
                                                    <a
200
                                                        href="{{{urls.edit}}}"
201
                                                        class="dropdown-item"
202
                                                        role="menuitem"
203
                                                    >
204
                                                        {{#str}} edit, mod_forum {{/str}}
205
                                                    </a>
206
                                                {{/edit}}
207
                                                {{#split}}
208
                                                    <a
209
                                                        href="{{{urls.split}}}"
210
                                                        class="dropdown-item"
211
                                                        role="menuitem"
212
                                                    >
213
                                                        {{#str}} prune, mod_forum {{/str}}
214
                                                    </a>
215
                                                {{/split}}
216
                                                {{#delete}}
217
                                                    <a
218
                                                        href="{{{urls.delete}}}"
219
                                                        class="dropdown-item"
220
                                                        role="menuitem"
221
                                                    >
222
                                                        {{#str}} delete, mod_forum {{/str}}
223
                                                    </a>
224
                                                {{/delete}}
225
                                                {{#export}}
226
                                                    <a
227
                                                        href="{{{urls.export}}}"
228
                                                        class="dropdown-item"
229
                                                        role="menuitem"
230
                                                    >
231
                                                        {{#str}} addtoportfolio, core_portfolio {{/str}}
232
                                                    </a>
233
                                                {{/export}}
234
                                            {{/capabilities}}
235
                                        </div>
236
                                    </div>
237
                                {{/showactionmenu}}
238
                            {{/readonly}}
239
                            </div>
240
                    </div>
241
                {{/isdeleted}}
242
                {{$subject}}
243
                    <h2
244
                        class="h1 font-weight-bold post-subject mt-n2"
245
                        data-region-content="forum-post-core-subject"
246
                        data-reply-subject="{{replysubject}}"
247
                    >{{{subject}}}</h2>
248
                {{/subject}}
249
                {{#hasreplycount}}
250
                    <span class="sr-only">{{#str}} numberofreplies, mod_forum, {{replycount}} {{/str}}</span>
251
                {{/hasreplycount}}
252
            </header>
253
 
254
            <div class="post-message pr-md-5" id="post-content-{{id}}">
255
                {{{message}}}
256
            </div>
257
 
258
            {{^isdeleted}}
259
                {{#attachments}}
260
                    {{#isimage}}
261
                        <div class="attachedimages">
262
                            <img
263
                                src="{{{url}}}"
264
                                alt="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
265
                                style="max-width: 100%"
266
                            >
267
                            {{#urls.export}}
268
                                <a href="{{{.}}}" title="{{#str}} addtoportfolio, core_portfolio {{/str}}">
269
                                    {{#pix}} t/portfolioadd, core {{/pix}}
270
                                </a>
271
                            {{/urls.export}}
272
                            {{#html.plagiarism}}
273
                                <div>{{{.}}}</div>
274
                            {{/html.plagiarism}}
275
                        </div>
276
                    {{/isimage}}
277
                {{/attachments}}
278
 
279
                {{#attachments}}
280
                    {{^isimage}}
281
                        <div class="mt-3">
282
                            <span class="icon-size-6">{{#pix}} {{icon}}, core {{/pix}}</span>
283
                            <div class="align-bottom d-inline-block">
284
                                <a
285
                                    href="{{{url}}}"
286
                                    aria-label="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
287
                                    class="font-weight-bold"
288
                                >
289
                                    {{#str}} attachmentnameandfilesize, mod_forum, {"name": "{{filename}}", "size": "{{filesizeformatted}}"} {{/str}}
290
                                </a>
291
                                {{#urls.export}}
292
                                    <a class="icon-no-margin" href="{{{.}}}" title="{{#str}} exportattachmentname, mod_forum, {{filename}} {{/str}}">
293
                                        {{#pix}} t/portfolioadd, core {{/pix}}
294
                                    </a>
295
                                {{/urls.export}}
296
                                {{#html.plagiarism}}
297
                                    <div>{{{.}}}</div>
298
                                {{/html.plagiarism}}
299
                            </div>
300
                        </div>
301
                    {{/isimage}}
302
                {{/attachments}}
303
 
304
                <div class="d-flex mt-3 align-items-center">
305
                    {{^readonly}}
306
                        {{#html.rating}}
307
                            <div>{{{.}}}</div>
308
                        {{/html.rating}}
309
                    {{/readonly}}
310
                    <div class="ml-auto d-flex flex-column">
311
                        {{#haswordcount}}
312
                            <span class="ml-auto badge bg-light text-dark">
313
                                {{#str}} numwords, core, {{wordcount}} {{/str}}
314
                            </span>
315
                        {{/haswordcount}}
316
                        {{#html.taglist}}
317
                            <div class="d-inline-block ml-auto {{#haswordcount}}mt-2{{/haswordcount}}">{{{.}}}</div>
318
                        {{/html.taglist}}
319
                    </div>
320
                </div>
321
            {{/isdeleted}}
322
 
323
            {{$footer}}
324
                {{^isdeleted}}
325
                    {{^readonly}}
326
                        <div class="d-flex mt-3">
327
                            {{#capabilities.reply}}
328
                                <button
329
                                    class="btn btn-primary btn-lg font-weight-bold px-4"
330
                                    data-href="{{{urls.reply}}}"
331
                                    data-post-id="{{id}}"
332
                                    data-action="create-inpage-reply"
333
                                    data-can-reply-privately="{{capabilities.canreplyprivately}}"
334
                                >
335
                                    {{#str}} reply, mod_forum {{/str}}
336
                                </button>
337
                            {{/capabilities.reply}}
338
                            {{^capabilities.reply}}
339
                                {{#discussionlocked}}
340
                                    <button class="btn btn-secondary btn-lg disabled" disabled>
341
                                        {{#str}} reply, mod_forum {{/str}}
342
                                    </button>
343
                                {{/discussionlocked}}
344
                            {{/capabilities.reply}}
345
                        </div>
346
                    {{/readonly}}
347
                {{/isdeleted}}
348
                {{#discussionlocked}}
349
                    <div><span class="badge bg-danger text-white mt-2">{{#str}} locked, mod_forum {{/str}}</span></div>
350
                {{/discussionlocked}}
351
            {{/footer}}
352
        </div>
353
    </div>
354
 
355
    {{$replies}}
356
        <div class="indent inline-reply-container" data-region="inpage-reply-container"></div>
357
 
358
        <div class="indent replies-container" data-region="replies-container">
359
            {{#hasreplies}}
360
                {{#replies}}
361
                    {{> mod_forum/forum_discussion_nested_v2_post_reply }}
362
                {{/replies}}
363
            {{/hasreplies}}
364
        </div>
365
    {{/replies}}
366
</article>