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="relativelink 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 {{#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}}"
62 {{/urls.profileimage}}
66 <div class="d-flex flex-column">
68 <span class="sr-only">{{#str}} inreplyto, mod_forum, {{.}} {{/str}}</span>
70 <h3 class="h6 font-weight-bold mb-0" data-region-content="forum-post-core-subject">{{$subject}}{{{subject}}}{{/subject}}</h3>
72 <address tabindex="-1">
73 {{#html.authorsubheading}}{{{.}}}{{/html.authorsubheading}}
74 {{^html.authorsubheading}}
76 {{#userdate}} {{timecreated}}, {{#str}} strftimedaydatetime, core_langconfig {{/str}} {{/userdate}}
78 {{/html.authorsubheading}}
82 <div class="privatereplyinfo">
83 {{#str}}postisprivatereply, forum{{/str}}
87 <span class="sr-only">{{#str}} numberofreplies, mod_forum, {{replycount}} {{/str}}</span>
92 <div class="d-flex body-content-container">
95 <div class="mr-2 author-groups-container" style="width: 45px; flex-shrink: 0">
99 class="rounded-circle w-100"
101 alt="{{#str}} pictureof, core, {{name}} {{/str}}"
110 <div class="no-overflow w-100 content-alignment-container">
111 <div id="post-content-{{id}}" class="post-content-container">
117 <p class="font-italic mb-0"><small>{{#str}} numwords, core, {{wordcount}} {{/str}}</small></p>
122 <div class="attachedimages">
125 alt="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
126 style="max-width: 100%"
129 <a href="{{{.}}}" title="{{#str}} addtoportfolio, core_portfolio {{/str}}">
130 {{#pix}} t/portfolioadd, core {{/pix}}
147 aria-label="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
149 {{#pix}} {{icon}}, core {{/pix}} {{filename}}
152 <a href="{{{.}}}" title="{{#str}} exportattachmentname, mod_forum, {{filename}} {{/str}}">
153 {{#pix}} t/portfolioadd, core {{/pix}}
163 <div class="d-flex flex-wrap">
165 <div class="mt-2">{{{.}}}</div>
170 class="post-actions d-flex align-self-end justify-content-end flex-wrap ml-auto"
171 data-region="post-actions-container"
173 aria-label='{{#str}} postbyuser, mod_forum, {"post": "{{subject}}", "user": "{{author.fullname}}"} {{/str}}'
174 aria-controls="p{{id}}"
179 data-region="post-action"
180 href="{{{urls.view}}}"
182 title="{{#str}} permanentlinktopost, mod_forum {{/str}}"
183 aria-label="{{#str}} permanentlinktopost, mod_forum {{/str}}"
185 {{#str}} permalink, mod_forum {{/str}}
188 {{#controlreadstatus}}
191 data-region="post-action"
192 href="{{{urls.markasread}}}"
195 {{#str}} markread, mod_forum {{/str}}
200 data-region="post-action"
201 href="{{{urls.markasunread}}}"
204 {{#str}} markunread, mod_forum {{/str}}
207 {{/controlreadstatus}}
210 data-region="post-action"
213 title="{{#str}} permanentlinktoparentpost, mod_forum {{/str}}"
214 aria-label="{{#str}} permanentlinktoparentpost, mod_forum {{/str}}"
216 {{#str}} parent, mod_forum {{/str}}
221 data-region="post-action"
222 href="{{{urls.edit}}}"
225 {{#str}} edit, mod_forum {{/str}}
230 data-region="post-action"
231 href="{{{urls.split}}}"
234 {{#str}} prune, mod_forum {{/str}}
239 data-region="post-action"
240 href="{{{urls.delete}}}"
243 {{#str}} delete, mod_forum {{/str}}
249 data-region="post-action"
250 href="{{{urls.reply}}}"
252 data-post-id="{{id}}"
253 data-action="collapsible-link"
254 data-can-reply-privately="{{canreplyprivately}}"
255 title="{{#str}} reply, mod_forum {{/str}}"
257 {{#str}} reply, mod_forum {{/str}}
263 data-region="post-action"
264 href="{{{urls.export}}}"
267 {{#str}} addtoportfolio, core_portfolio {{/str}}
276 {{$footer}}{{/footer}}
283 <div data-region="replies-container">
288 {{> mod_forum/forum_discussion_post }}