b7d0ccc83e3da741961d479ffc1520b7dcca2b71
[moodle.git] / message / templates / message_area_messages_area.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 core_message/message_area_messages_area
20     Messages area template.
22     Classes required for JS:
23     * none
25     Data attributes required for JS:
26     * none
28     Context variables required for this template:
29     * isonline - boolean
30     * isblocked - boolean
31     * otheruserid - int
32     * otheruserfullname - string
33     * messages - array of messages
35     Example context (json):
36     {
37         "isonline": true,
38         "isblocked": true,
39         "otheruserid": 1,
40         "otheruserfullname": "Sam Student",
41         "messages": [
42             {
43                 "text": "Hello there!"
44             }
45         ]
46     }
47 }}
48 {{#otheruserid}}
49 <div class="messages-header">
50     <div class="view-toggle btn-container">
51         <button class="btn btn-link" data-action="show-contacts">&lt; {{#str}} messages, message {{/str}}</button>
52     </div>
53     <div class="delete-all btn-container">
54         <button class="btn btn-link" data-action="delete-all-messages">{{#str}} deleteall {{/str}}</button>
55     </div>
56     <div class="name-container">
57         <div class="name">
58             <button class="btn btn-link" data-action="view-contact-profile" data-userid="{{otheruserid}}">{{otheruserfullname}}</button>
59             {{#isblocked}}
60                 <span data-region="contact-icon-blocked">
61                     {{#pix}} t/block, core, {{#str}} contactblocked, message {{/str}} {{/pix}}
62                 </span>
63             {{/isblocked}}
64         </div>
65         <div class="status {{#isonline}}online{{/isonline}}">
66             <span class="offline-text">{{#str}} offline, message {{/str}}</span>
67             <span class="online-text">{{#str}} online, message {{/str}}</span>
68         </div>
69     </div>
70     <div class="delete-instructions">
71         {{#str}} selectmessagestodelete, message {{/str}}
72     </div>
73     <div class="actions" data-region="messages-header-actions">
74         <button class="btn btn-link messages-delete" data-action="start-delete-messages">{{#str}}edit{{/str}}</button>
75         <button class="btn btn-link cancel-messages-delete" data-action="cancel-delete-messages">{{#str}}cancel{{/str}}</button>
76     </div>
77 </div>
78 {{/otheruserid}}
79 {{#contactsfirst}}
80 <div class="messages-header">
81     <div class="name-container">
82         <div class="name">
83             {{#str}}newmessagesearch, message{{/str}}
84         </div>
85     </div>
86 </div>
87 {{/contactsfirst}}
88 <div class="messages" data-region="messages" data-userid="{{otheruserid}}">
89     {{> core_message/message_area_messages }}
90 </div>
91 {{#otheruserid}}
92 <div class="response" data-region="response">
93     {{#iscurrentuser}}
94         <div class="message-box">
95             {{> core_message/message_area_response }}
96         </div>
97     {{/iscurrentuser}}
98     <div class="delete-confirmation">
99         <button class="btn btn-link confirm" data-action="delete-messages">{{#str}} deleteselectedmessages, message {{/str}}</button>
100     </div>
101 </div>
102 {{/otheruserid}}