MDL-65658 mod_forum: Update the group image titles
[moodle.git] / mod / forum / templates / forum_discussion_post.mustache
CommitLineData
47d38303
RW
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{{!
f30f46db 18 @template mod_forum/forum_discussion_post
47d38303 19
f30f46db 20 Template to render a single post from a discussion.
47d38303
RW
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}}
53d74374
RW
32<article
33 id="p{{id}}"
f2eb9de4 34 class="forum-post-container mb-2"
53d74374 35 data-post-id="{{id}}"
e564ae86 36 data-region="post"
9b4f09ba 37 data-target="{{id}}-target"
23129586 38 tabindex="0"
53d74374
RW
39 aria-labelledby="post-header-{{id}}"
40 aria-describedby="post-content-{{id}}"
41>
57ad9a0c
RW
42 <!-- The firstpost and starter classes below aren't used for anything other than to identify the first post in behat -->
43 <div
f2eb9de4 44 class="d-flex border p-2 mb-2 forumpost focus-target {{#unread}}unread{{/unread}} {{#firstpost}}firstpost starter{{/firstpost}}"
57ad9a0c 45 aria-label='{{#str}} postbyuser, mod_forum, {"post": "{{subject}}", "user": "{{author.fullname}}"} {{/str}}'
9b4f09ba 46 data-post-id="{{id}}" data-content="forum-post"
57ad9a0c 47 >
53d74374 48 {{#isfirstunread}}<a id="unread" aria-hidden="true"></a>{{/isfirstunread}}
47d38303 49
c70ddc33
RW
50 <div class="d-flex flex-column w-100" data-region-content="forum-post-core">
51 <header class="mb-2 header row d-flex">
47d38303 52 {{^isdeleted}}
c70ddc33
RW
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"
dd287e7d 61 title="{{#str}} pictureof, core, {{author.fullname}} {{/str}}"
c70ddc33
RW
62 >
63 {{/urls.profileimage}}
64 </div>
65 {{/author}}
47d38303 66 {{/isdeleted}}
c70ddc33
RW
67 <div class="d-flex flex-column">
68 {{#parentauthorname}}
69 <span class="sr-only">{{#str}} inreplyto, mod_forum, {{.}} {{/str}}</span>
70 {{/parentauthorname}}
9ba09a12
AN
71 <h3 {{!
72 }}class="h6 font-weight-bold mb-0" {{!
73 }}data-region-content="forum-post-core-subject" {{!
74 }}data-reply-subject="{{replysubject}}" {{!
75 }}>{{$subject}}{{{subject}}}{{/subject}}</h3>
c70ddc33
RW
76 {{^isdeleted}}
77 <address tabindex="-1">
78 {{#html.authorsubheading}}{{{.}}}{{/html.authorsubheading}}
79 {{^html.authorsubheading}}
80 <time>
81 {{#userdate}} {{timecreated}}, {{#str}} strftimedaydatetime, core_langconfig {{/str}} {{/userdate}}
82 </time>
83 {{/html.authorsubheading}}
84 </address>
85 {{/isdeleted}}
86 {{#isprivatereply}}
87 <div class="privatereplyinfo">
88 {{#str}}postisprivatereply, forum{{/str}}
89 </div>
90 {{/isprivatereply}}
91 {{#hasreplycount}}
92 <span class="sr-only">{{#str}} numberofreplies, mod_forum, {{replycount}} {{/str}}</span>
93 {{/hasreplycount}}
94 </div>
47d38303 95 </header>
47d38303 96
c70ddc33
RW
97 <div class="d-flex body-content-container">
98 {{^isdeleted}}
99 {{#author}}
100 <div class="mr-2 author-groups-container" style="width: 45px; flex-shrink: 0">
101 {{#groups}}
c939a043
MM
102 {{#urls.group}}
103 {{#urls.image}}
104 <a href="{{urls.group}}" role="button" aria-label='{{#str}} memberofgroup, group, {{name}}{{/str}}'>
105 <img
106 class="rounded-circle w-100"
107 src="{{{.}}}"
108 alt="{{#str}} pictureof, core, {{name}} {{/str}}"
109 aria-hidden="true"
dd287e7d 110 title="{{#str}} pictureof, core, {{name}} {{/str}}"
c939a043
MM
111 >
112 </a>
113 {{/urls.image}}
114 {{/urls.group}}
115 {{^urls.group}}
116 {{#urls.image}}
117 <img class="rounded-circle w-100"
118 src="{{{.}}}"
119 alt="{{#str}} pictureof, core, {{name}} {{/str}}"
dd287e7d 120 title="{{#str}} pictureof, core, {{name}} {{/str}}"
c939a043
MM
121 >
122 {{/urls.image}}
123 {{/urls.group}}
c70ddc33 124 {{/groups}}
47d38303 125 </div>
c70ddc33
RW
126 {{/author}}
127 {{/isdeleted}}
47d38303 128
c70ddc33
RW
129 <div class="no-overflow w-100 content-alignment-container">
130 <div id="post-content-{{id}}" class="post-content-container">
131 {{{message}}}
132 </div>
47d38303 133
c70ddc33
RW
134 {{^isdeleted}}
135 {{#haswordcount}}
136 <p class="font-italic mb-0"><small>{{#str}} numwords, core, {{wordcount}} {{/str}}</small></p>
137 {{/haswordcount}}
47d38303 138
c70ddc33
RW
139 {{#attachments}}
140 {{#isimage}}
141 <div class="attachedimages">
142 <img
143 src="{{{url}}}"
144 alt="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
145 style="max-width: 100%"
53d74374 146 >
c70ddc33
RW
147 {{#urls.export}}
148 <a href="{{{.}}}" title="{{#str}} addtoportfolio, core_portfolio {{/str}}">
149 {{#pix}} t/portfolioadd, core {{/pix}}
47d38303 150 </a>
c70ddc33
RW
151 {{/urls.export}}
152 {{#html.plagiarism}}
153 <div>{{{.}}}</div>
154 {{/html.plagiarism}}
155 </div>
156 {{/isimage}}
157 {{/attachments}}
158
159 {{{html.taglist}}}
160
161 {{#attachments}}
162 {{^isimage}}
163 <div>
53d74374 164 <a
c70ddc33
RW
165 href="{{{url}}}"
166 aria-label="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
53d74374 167 >
c70ddc33 168 {{#pix}} {{icon}}, core {{/pix}} {{filename}}
47d38303 169 </a>
c70ddc33
RW
170 {{#urls.export}}
171 <a href="{{{.}}}" title="{{#str}} exportattachmentname, mod_forum, {{filename}} {{/str}}">
172 {{#pix}} t/portfolioadd, core {{/pix}}
54d38a73 173 </a>
c70ddc33
RW
174 {{/urls.export}}
175 {{#html.plagiarism}}
176 <div>{{{.}}}</div>
177 {{/html.plagiarism}}
178 </div>
179 {{/isimage}}
180 {{/attachments}}
181
182 <div class="d-flex flex-wrap">
183 {{#html.rating}}
184 <div class="mt-2">{{{.}}}</div>
185 {{/html.rating}}
186 {{$actions}}
187 {{^readonly}}
188 <div
23129586 189 class="post-actions d-flex align-self-end justify-content-end flex-wrap ml-auto"
c70ddc33
RW
190 data-region="post-actions-container"
191 role="menubar"
192 aria-label='{{#str}} postbyuser, mod_forum, {"post": "{{subject}}", "user": "{{author.fullname}}"} {{/str}}'
193 aria-controls="p{{id}}"
53d74374 194 >
c70ddc33
RW
195 {{#capabilities}}
196 {{#view}}
197 <a
198 data-region="post-action"
199 href="{{{urls.view}}}"
200 class="btn btn-link"
201 title="{{#str}} permanentlinktopost, mod_forum {{/str}}"
23129586 202 aria-label="{{#str}} permanentlinktopost, mod_forum {{/str}}"
c70ddc33
RW
203 >
204 {{#str}} permalink, mod_forum {{/str}}
205 </a>
206 {{/view}}
207 {{#controlreadstatus}}
208 {{#unread}}
209 <a
210 data-region="post-action"
211 href="{{{urls.markasread}}}"
212 class="btn btn-link"
c70ddc33
RW
213 >
214 {{#str}} markread, mod_forum {{/str}}
215 </a>
216 {{/unread}}
217 {{^unread}}
218 <a
219 data-region="post-action"
220 href="{{{urls.markasunread}}}"
221 class="btn btn-link"
c70ddc33
RW
222 >
223 {{#str}} markunread, mod_forum {{/str}}
224 </a>
225 {{/unread}}
226 {{/controlreadstatus}}
227 {{#urls.viewparent}}
228 <a
229 data-region="post-action"
230 href="{{{.}}}"
231 class="btn btn-link"
232 title="{{#str}} permanentlinktoparentpost, mod_forum {{/str}}"
23129586 233 aria-label="{{#str}} permanentlinktoparentpost, mod_forum {{/str}}"
c70ddc33
RW
234 >
235 {{#str}} parent, mod_forum {{/str}}
236 </a>
237 {{/urls.viewparent}}
238 {{#edit}}
239 <a
240 data-region="post-action"
241 href="{{{urls.edit}}}"
242 class="btn btn-link"
c70ddc33
RW
243 >
244 {{#str}} edit, mod_forum {{/str}}
245 </a>
246 {{/edit}}
247 {{#split}}
248 <a
249 data-region="post-action"
250 href="{{{urls.split}}}"
251 class="btn btn-link"
c70ddc33
RW
252 >
253 {{#str}} prune, mod_forum {{/str}}
254 </a>
255 {{/split}}
256 {{#delete}}
257 <a
258 data-region="post-action"
259 href="{{{urls.delete}}}"
260 class="btn btn-link"
c70ddc33
RW
261 >
262 {{#str}} delete, mod_forum {{/str}}
263 </a>
264 {{/delete}}
265 {{#reply}}
266 {{$replyoutput}}
267 <a
268 data-region="post-action"
269 href="{{{urls.reply}}}"
270 class="btn btn-link"
c70ddc33
RW
271 data-post-id="{{id}}"
272 data-action="collapsible-link"
cee572aa 273 data-can-reply-privately="{{canreplyprivately}}"
c70ddc33
RW
274 title="{{#str}} reply, mod_forum {{/str}}"
275 >
276 {{#str}} reply, mod_forum {{/str}}
277 </a>
278 {{/replyoutput}}
279 {{/reply}}
92ba55ee
P
280 {{^reply}}
281 {{#selfenrol}}
282 {{$replyoutput}}
283 <a
284 href="{{{urls.reply}}}"
285 class="btn btn-link"
286 data-post-id="{{id}}"
287 data-can-reply-privately="{{canreplyprivately}}"
288 title="{{#str}} reply, mod_forum {{/str}}"
289 >
290 {{#str}} reply, mod_forum {{/str}}
291 </a>
292 {{/replyoutput}}
293 {{/selfenrol}}
294 {{/reply}}
c70ddc33
RW
295 {{#export}}
296 <a
297 data-region="post-action"
298 href="{{{urls.export}}}"
299 class="btn btn-link"
c70ddc33
RW
300 >
301 {{#str}} addtoportfolio, core_portfolio {{/str}}
302 </a>
303 {{/export}}
304 {{/capabilities}}
305 </div>
306 {{/readonly}}
307 {{/actions}}
47d38303 308 </div>
47d38303 309
c70ddc33
RW
310 {{$footer}}{{/footer}}
311 {{/isdeleted}}
312 </div>
313 </div>
47d38303
RW
314 </div>
315 </div>
316
9b4f09ba 317 <div data-region="replies-container">
47d38303 318 {{$replies}}
9b4f09ba 319 <div>
47d38303 320 {{#hasreplies}}
9b4f09ba
P
321 {{#replies}}
322 {{> mod_forum/forum_discussion_post }}
323 {{/replies}}
47d38303 324 {{/hasreplies}}
9b4f09ba 325 </div>
47d38303 326 {{/replies}}
9b4f09ba 327 </div>
47d38303 328</article>