MDL-65032 mod_forum: Use correct template context data 'istimelocked'
[moodle.git] / mod / forum / templates / forum_discussion.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
47d38303 19
f30f46db 20 Template for displaying a single forum 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}}
32
9b4f09ba 33<div id="discussion-container-{{uniqid}}" data-content="forum-discussion">
47d38303 34{{#html}}
2893812e 35 <div class="d-flex flex-wrap flex-row-reverse m-b-1" data-container="discussion-tools" style="text-align: right;">
bdb4a87d 36 {{#capabilities.manage}}
fdbadf82 37 {{^istimelocked}}
bdb4a87d
P
38 <div class="pl-1 discussionlock">
39 {{> forum/discussion_lock_toggle }}
40 </div>
fdbadf82 41 {{/istimelocked}}
bdb4a87d 42 {{/capabilities.manage}}
2893812e
P
43 <div class="pl-1">{{{subscribe}}}</div>
44 </div>
47d38303
RW
45 {{{neighbourlinks}}}
46
5cac5fa4 47 <div class="d-flex flex-wrap mb-1">
47d38303
RW
48 <div>{{{exportdiscussion}}}</div>
49 <div class="{{#exportdiscussion}}ml-2{{/exportdiscussion}}">{{{modeselectorform}}}</div>
50 <div class="ml-2">{{{movediscussion}}}</div>
51 <div class="ml-2">{{{pindiscussion}}}</div>
52 </div>
53{{/html}}
54
55{{#notifications}}
56 {{> core/notification}}
57{{/notifications}}
58
59{{{html.posts}}}
60
61{{#html.neighbourlinks}}{{{.}}}{{/html.neighbourlinks}}
e564ae86
RW
62</div>
63{{#js}}
2893812e 64require(['jquery', 'mod_forum/discussion', 'mod_forum/posts_list', 'mod_forum/lock_toggle'], function($, Discussion, PostsList, LockToggle) {
9b4f09ba 65 var root = $("[data-content='forum-discussion']");
e564ae86 66 Discussion.init(root);
9b4f09ba 67 PostsList.init(root);
2893812e
P
68 var root = $('[data-container="discussion-tools"]');
69 LockToggle.init(root);
e564ae86
RW
70});
71{{/js}}