MDL-78258 libraries: upgrade lti1p3 to v5.4.1
[moodle.git] / message / templates / message_popover.mustache
blobdb9b40d058c13c430092e3940ed6719a8609eb04
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/>.
17 {{!
18     @template core_message/message_popover
20     This template will render the message popover for the navigation bar.
22     Classes required for JS:
23     * none
25     Data attributes required for JS:
26     * All data attributes are required
28     Context variables required for this template:
29     * userid The logged in user id
30     * urls The URLs for the popover
32     Example context (json):
33     {
34         "unreadcount": 3
35     }
38 <div class="popover-region collapsed" data-region="popover-region-messages">
39     <a id="message-drawer-toggle-{{uniqid}}" class="nav-link popover-region-toggle position-relative icon-no-margin" href="#"
40             role="button">
41         {{#pix}} t/message, core, {{#str}} togglemessagemenu, message {{/str}} {{/pix}}
42         <div
43             class="count-container {{^unreadcount}}hidden{{/unreadcount}}"
44             data-region="count-container"
45         >
46             <span aria-hidden="true">{{unreadcount}}</span>
47             <span class="sr-only">{{#str}} unreadconversations, core_message, {{unreadcount}} {{/str}}</span>
48         </div>
49     </a>
50     {{> core_message/message_jumpto }}
51 </div>
53 {{#js}}
54 require(
56     'jquery',
57     'core_message/message_popover'
59 function(
60     $,
61     Popover
62 ) {
63     var toggle = $('#message-drawer-toggle-{{uniqid}}');
64     Popover.init(toggle);
65 });
66 {{/js}}