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/grades/grader/discussion/posts
|
|
|
19 |
|
|
|
20 |
Template to render a list of posts for a discussion.
|
|
|
21 |
|
|
|
22 |
Classes required for JS:
|
|
|
23 |
* none
|
|
|
24 |
|
|
|
25 |
Data attributes required for JS:
|
|
|
26 |
* data-region="posts"
|
|
|
27 |
|
|
|
28 |
Example context (json):
|
|
|
29 |
{
|
|
|
30 |
}
|
|
|
31 |
}}
|
|
|
32 |
<div
|
|
|
33 |
class="{{#experimentaldisplaymode}}nested-v2-display-mode{{/experimentaldisplaymode}}"
|
|
|
34 |
data-region="posts"
|
|
|
35 |
id="post-region-{{uniqid}}"
|
|
|
36 |
>
|
|
|
37 |
{{#discussions}}
|
|
|
38 |
<div class="discussion-container">
|
|
|
39 |
<div class="p-4">
|
|
|
40 |
<h3 class="d-inline-block m-0 h6 font-weight-bold">{{#str}} discussionstartedby, mod_forum, {{authorfullname}} {{/str}}</h3>
|
|
|
41 |
<p class="d-inline-block m-0 h6 font-weight-normal text-muted ml-1">
|
|
|
42 |
{{#userdate}} {{timecreated}}, {{#str}} strftimedate, core_langconfig {{/str}} {{/userdate}}
|
|
|
43 |
</p>
|
|
|
44 |
<h2 class="mb-4 font-weight-bold">{{name}}</h2>
|
|
|
45 |
|
|
|
46 |
{{#posts}}
|
|
|
47 |
<div class="posts-container">
|
|
|
48 |
{{#parent}}
|
|
|
49 |
<div class="parent-container">
|
|
|
50 |
<button
|
|
|
51 |
class="btn btn-link show-content-button collapsed"
|
|
|
52 |
data-target="#parent-post-content-{{id}}"
|
|
|
53 |
aria-expanded="false"
|
|
|
54 |
aria-controls="parent-post-content-{{id}}"
|
|
|
55 |
data-toggle="collapse"
|
|
|
56 |
>
|
|
|
57 |
{{#str}} viewparentpost, mod_forum {{/str}}
|
|
|
58 |
</button>
|
|
|
59 |
<div id="parent-post-content-{{id}}" class="content collapse">
|
|
|
60 |
{{#experimentaldisplaymode}}{{> mod_forum/forum_discussion_nested_v2_first_post }}{{/experimentaldisplaymode}}
|
|
|
61 |
{{^experimentaldisplaymode}}{{> mod_forum/forum_discussion_nested_post }}{{/experimentaldisplaymode}}
|
|
|
62 |
</div>
|
|
|
63 |
</div>
|
|
|
64 |
{{/parent}}
|
|
|
65 |
{{#post}}
|
|
|
66 |
<div class="post-container">
|
|
|
67 |
{{#experimentaldisplaymode}}{{> mod_forum/forum_discussion_nested_v2_first_post }}{{/experimentaldisplaymode}}
|
|
|
68 |
{{^experimentaldisplaymode}}{{> mod_forum/forum_discussion_nested_post }}{{/experimentaldisplaymode}}
|
|
|
69 |
</div>
|
|
|
70 |
<button
|
|
|
71 |
class="view-context-button btn btn-link border"
|
|
|
72 |
type="button"
|
|
|
73 |
data-action="view-context"
|
|
|
74 |
data-discussionid="{{discussionid}}"
|
|
|
75 |
data-postid="{{id}}"
|
|
|
76 |
data-name="{{name}}"
|
|
|
77 |
data-experimental-display-mode="{{experimentaldisplaymode}}"
|
|
|
78 |
>
|
|
|
79 |
{{#str}} viewconversation, forum {{/str}}
|
|
|
80 |
</button>
|
|
|
81 |
{{/post}}
|
|
|
82 |
<hr class="w-75 mx-auto my-5">
|
|
|
83 |
</div>
|
|
|
84 |
{{/posts}}
|
|
|
85 |
</div>
|
|
|
86 |
<hr>
|
|
|
87 |
</div>
|
|
|
88 |
{{/discussions}}
|
|
|
89 |
{{^discussions}}
|
|
|
90 |
<div class="no-post-container text-center p-5">
|
|
|
91 |
{{#pix}} no-posts, mod_forum {{/pix}}
|
|
|
92 |
<h2 class="mt-3 font-weight-bold">{{#str}} noposts, mod_forum {{/str}}</h2>
|
|
|
93 |
</div>
|
|
|
94 |
{{/discussions}}
|
|
|
95 |
</div>
|
|
|
96 |
{{#js}}
|
|
|
97 |
require(['mod_forum/grades/expandconversation'], function(Conversation) {
|
|
|
98 |
Conversation.registerEventListeners(document.querySelector('#post-region-{{uniqid}}'));
|
|
|
99 |
});
|
|
|
100 |
{{/js}}
|