Merge branch 'MDL-66883-master' of git://github.com/bmbrands/moodle
[moodle.git] / mod / forum / templates / inpage_reply_v2.mustache
1 {{!
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/>.
16 }}
17 {{!
18     @template mod_forum/inpage_reply_v2
20     In page reply HTML for the nested v2 discussion display mode.
22     Classes required for JS:
23     * none
25     Data attributes required for JS:
26     * none
28     Example context (json):
29     {
30         "postid": 0,
31         "reply_url": "",
32         "sesskey": "",
33         "parentsubject": ""
34     }
35 }}
36 <div
37     class="mt-4 mb-4"
38     data-content="inpage-reply-content"
39     style="display: none;"
40 >
41     <div class="d-flex">
42         <div class="author-image-container">
43             {{#loggedinuser}}
44                 <img
45                     class="rounded-circle w-100"
46                     src="{{{profileimageurl}}}"
47                     alt="{{#str}} pictureof, core, {{fullname}} {{/str}}"
48                     aria-hidden="true"
49                 >
50             {{/loggedinuser}}
51         </div>
52         <div class="w-100">
53             {{#loggedinuser}}
54                 <h4 class="h5 font-weight-bold reply-author">{{#str}} replyauthorself, mod_forum, {{firstname}}{{/str}}</h4>
55             {{/loggedinuser}}
56             <form data-post-id="{{postid}}" data-content="inpage-reply-form" action="{{{reply_url}}}">
57                 <textarea
58                     name="post"
59                     rows="3"
60                     class="w-100"
61                     {{#parentauthorname}}
62                     placeholder="{{#str}} replyingtoauthor, forum, {{.}} {{/str}}"
63                     {{/parentauthorname}}
64                     {{^parentauthorname}}
65                     placeholder="{{#str}} replyplaceholder, forum {{/str}}"
66                     {{/parentauthorname}}
67                     data-auto-rows
68                     data-min-rows="3"
69                     data-max-rows="10"
70                 ></textarea>
71                 <input type="hidden" name="postformat" value="{{postformat}}"/>
72                 <input type="hidden" name="subject" value="{{parentsubject}}"/>
73                 <input type="hidden" name="reply" value="{{postid}}"/>
74                 <input type="hidden" name="sesskey" value="{{sesskey}}"/>
75                 <div class="d-flex mt-3 align-items-center flex-wrap">
76                     <button class="btn btn-primary font-weight-bold px-3" data-action="forum-inpage-submit">
77                         <span data-region="submit-text">{{#str}} post, core {{/str}}</span>
78                         <span data-region="loading-icon-container" class="hidden">{{> core/loading }}</span>
79                     </button>
80                     <button data-action="forum-advanced-reply" class="btn btn-link mr-auto" type="submit">
81                         {{#str}} advanced, core {{/str}}
82                     </button>
83                     {{#canreplyprivately}}
84                     <div class="form-check form-check-inline">
85                         <div class="custom-control custom-switch">
86                             <input name="privatereply" type="checkbox" class="custom-control-input" id="private-reply-checkbox-{{uniqid}}">
87                             <label class="custom-control-label" for="private-reply-checkbox-{{uniqid}}">
88                                 {{#str}} privatereply, forum {{/str}}
89                             </label>
90                         </div>
91                     </div>
92                     {{/canreplyprivately}}
93                     <button
94                         class="btn btn-icon icon-no-margin icon-size-4 text-muted"
95                         title="{{#str}} cancelreply, mod_forum {{/str}}"
96                         data-action="cancel-inpage-reply"
97                     >
98                         {{#pix}} i/delete, core {{/pix}}
99                     </button>
100                 </div>
101             </form>
102         </div>
103     </div>
104 </div>