2 This file is part of Moodle - http://moodle.org/
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.
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.
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/>.
18 @template mod_forum/forum_discussion_post
20 Template to render a single post from a discussion.
22 Classes required for JS:
25 Data attributes required for JS:
28 Example context (json):
34 class="forum-post-container mb-2"
37 data-target="{{id}}-target"
39 aria-labelledby="post-header-{{id}}"
40 aria-describedby="post-content-{{id}}"
42 <!-- The firstpost and starter classes below aren't used for anything other than to identify the first post in behat -->
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"
48 {{#isfirstunread}}<a id="unread" aria-hidden="true"></a>{{/isfirstunread}}
50 <div class="d-flex flex-column w-100" data-region-content="forum-post-core">
51 <header class="mb-2 header row d-flex">
54 <div class="mr-2" style="width: 45px;">
55 {{#urls.profileimage}}
57 class="rounded-circle w-100"
59 alt="{{#str}} pictureof, core, {{author.fullname}} {{/str}}"
61 title="{{author.fullname}}"
63 {{/urls.profileimage}}
67 <div class="d-flex flex-column">
69 <span class="sr-only">{{#str}} inreplyto, mod_forum, {{.}} {{/str}}</span>
71 <h3 class="h6 font-weight-bold mb-0" data-region-content="forum-post-core-subject">{{$subject}}{{{subject}}}{{/subject}}</h3>
73 <address tabindex="-1">
74 {{#html.authorsubheading}}{{{.}}}{{/html.authorsubheading}}
75 {{^html.authorsubheading}}
77 {{#userdate}} {{timecreated}}, {{#str}} strftimedaydatetime, core_langconfig {{/str}} {{/userdate}}
79 {{/html.authorsubheading}}
83 <div class="privatereplyinfo">
84 {{#str}}postisprivatereply, forum{{/str}}
88 <span class="sr-only">{{#str}} numberofreplies, mod_forum, {{replycount}} {{/str}}</span>
93 <div class="d-flex body-content-container">
96 <div class="mr-2 author-groups-container" style="width: 45px; flex-shrink: 0">
100 <a href="{{urls.group}}" role="button" aria-label='{{#str}} memberofgroup, group, {{name}}{{/str}}'>
102 class="rounded-circle w-100"
104 alt="{{#str}} pictureof, core, {{name}} {{/str}}"
113 <img class="rounded-circle w-100"
115 alt="{{#str}} pictureof, core, {{name}} {{/str}}"
125 <div class="no-overflow w-100 content-alignment-container">
126 <div id="post-content-{{id}}" class="post-content-container">
132 <p class="font-italic mb-0"><small>{{#str}} numwords, core, {{wordcount}} {{/str}}</small></p>
137 <div class="attachedimages">
140 alt="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
141 style="max-width: 100%"
144 <a href="{{{.}}}" title="{{#str}} addtoportfolio, core_portfolio {{/str}}">
145 {{#pix}} t/portfolioadd, core {{/pix}}
162 aria-label="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
164 {{#pix}} {{icon}}, core {{/pix}} {{filename}}
167 <a href="{{{.}}}" title="{{#str}} exportattachmentname, mod_forum, {{filename}} {{/str}}">
168 {{#pix}} t/portfolioadd, core {{/pix}}
178 <div class="d-flex flex-wrap">
180 <div class="mt-2">{{{.}}}</div>
185 class="post-actions d-flex align-self-end justify-content-end flex-wrap ml-auto"
186 data-region="post-actions-container"
188 aria-label='{{#str}} postbyuser, mod_forum, {"post": "{{subject}}", "user": "{{author.fullname}}"} {{/str}}'
189 aria-controls="p{{id}}"
194 data-region="post-action"
195 href="{{{urls.view}}}"
197 title="{{#str}} permanentlinktopost, mod_forum {{/str}}"
198 aria-label="{{#str}} permanentlinktopost, mod_forum {{/str}}"
200 {{#str}} permalink, mod_forum {{/str}}
203 {{#controlreadstatus}}
206 data-region="post-action"
207 href="{{{urls.markasread}}}"
210 {{#str}} markread, mod_forum {{/str}}
215 data-region="post-action"
216 href="{{{urls.markasunread}}}"
219 {{#str}} markunread, mod_forum {{/str}}
222 {{/controlreadstatus}}
225 data-region="post-action"
228 title="{{#str}} permanentlinktoparentpost, mod_forum {{/str}}"
229 aria-label="{{#str}} permanentlinktoparentpost, mod_forum {{/str}}"
231 {{#str}} parent, mod_forum {{/str}}
236 data-region="post-action"
237 href="{{{urls.edit}}}"
240 {{#str}} edit, mod_forum {{/str}}
245 data-region="post-action"
246 href="{{{urls.split}}}"
249 {{#str}} prune, mod_forum {{/str}}
254 data-region="post-action"
255 href="{{{urls.delete}}}"
258 {{#str}} delete, mod_forum {{/str}}
264 data-region="post-action"
265 href="{{{urls.reply}}}"
267 data-post-id="{{id}}"
268 data-action="collapsible-link"
269 data-can-reply-privately="{{canreplyprivately}}"
270 title="{{#str}} reply, mod_forum {{/str}}"
272 {{#str}} reply, mod_forum {{/str}}
278 data-region="post-action"
279 href="{{{urls.export}}}"
282 {{#str}} addtoportfolio, core_portfolio {{/str}}
291 {{$footer}}{{/footer}}
298 <div data-region="replies-container">
303 {{> mod_forum/forum_discussion_post }}