Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
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
                <div class="d-block">
41
                    <h3 class="mb-3">{{#str}} discussionstartedby, mod_forum, {{authorfullname}} {{/str}}</h3>
42
                    <p class="d-inline-block badge-sq badge-info">
43
                        {{#userdate}} {{timecreated}}, {{#str}} strftimedate, core_langconfig {{/str}} {{/userdate}}
44
                    </p>
45
                </div>
46
 
47
                <h2 class="pt-2 mb-4">{{name}}</h2>
48
 
49
                {{#posts}}
50
                    <div class="posts-container">
51
                        {{#parent}}
52
                            <div class="parent-container">
53
                                <button
54
                                    class="show-content-button collapsed btn btn-secondary btn-sm mb-2"
55
                                    data-target="#parent-post-content-{{id}}"
56
                                    aria-expanded="false"
57
                                    aria-controls="parent-post-content-{{id}}"
58
                                    data-toggle="collapse"
59
                                >
60
                                    {{#str}} viewparentpost, mod_forum {{/str}}
61
                                </button>
62
                                <div id="parent-post-content-{{id}}" class="content collapse">
63
                                    {{#experimentaldisplaymode}}{{> mod_forum/forum_discussion_nested_v2_first_post }}{{/experimentaldisplaymode}}
64
                                    {{^experimentaldisplaymode}}{{> mod_forum/forum_discussion_nested_post }}{{/experimentaldisplaymode}}
65
                                </div>
66
                            </div>
67
                        {{/parent}}
68
                        {{#post}}
69
                            <div class="post-container">
70
                                {{#experimentaldisplaymode}}{{> mod_forum/forum_discussion_nested_v2_first_post }}{{/experimentaldisplaymode}}
71
                                {{^experimentaldisplaymode}}{{> mod_forum/forum_discussion_nested_post }}{{/experimentaldisplaymode}}
72
                            </div>
73
                            <button
74
                                class="view-context-button btn btn-outline-primary"
75
                                type="button"
76
                                data-action="view-context"
77
                                data-discussionid="{{discussionid}}"
78
                                data-postid="{{id}}"
79
                                data-name="{{name}}"
80
                                data-experimental-display-mode="{{experimentaldisplaymode}}"
81
                            >
82
                                {{#str}} viewconversation, forum {{/str}}
83
                            </button>
84
                        {{/post}}
85
                        <hr class="w-25 mx-auto my-5">
86
                    </div>
87
                {{/posts}}
88
            </div>
89
            <hr>
90
        </div>
91
    {{/discussions}}
92
    {{^discussions}}
93
        <div class="no-post-container text-center p-5">
94
            {{#pix}} no-posts, mod_forum {{/pix}}
95
            <h2 class="mt-3 font-weight-bold">{{#str}} noposts, mod_forum {{/str}}</h2>
96
        </div>
97
    {{/discussions}}
98
</div>
99
{{#js}}
100
    require(['mod_forum/grades/expandconversation'], function(Conversation) {
101
        Conversation.registerEventListeners(document.querySelector('#post-region-{{uniqid}}'));
102
    });
103
{{/js}}