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