MDL-69454 core_search: consistent navbar search
[moodle.git] / message / templates / message_popover.mustache
CommitLineData
1e3453b7
RW
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 core_message/message_popover
19
20 This template will render the message popover for the navigation bar.
21
22 Classes required for JS:
23 * none
24
25 Data attributes required for JS:
26 * All data attributes are required
27
28 Context variables required for this template:
29 * userid The logged in user id
30 * urls The URLs for the popover
31
32 Example context (json):
33 {
34 "unreadcount": 3
35 }
36
37}}
77e5b446 38<div class="popover-region collapsed" data-region="popover-region-messages">
1fdb4fda 39 <a id="message-drawer-toggle-{{uniqid}}" class="nav-link d-inline-block popover-region-toggle position-relative icon-no-margin" href="#"
c0d2558c 40 role="button">
1e3453b7 41 {{#pix}} t/message, core, {{#str}} togglemessagemenu, message {{/str}} {{/pix}}
ccd47523
SA
42 <div class="count-container {{^unreadcount}}hidden{{/unreadcount}}" data-region="count-container"
43 aria-label="{{#str}} unreadconversations, core_message, {{unreadcount}} {{/str}}">{{unreadcount}}</div>
1e3453b7 44 </a>
45decc81 45 {{> core_message/message_jumpto }}
1e3453b7
RW
46</div>
47
48{{#js}}
49require(
50[
51 'jquery',
52 'core_message/message_popover'
53],
54function(
55 $,
56 Popover
57) {
58 var toggle = $('#message-drawer-toggle-{{uniqid}}');
59 Popover.init(toggle);
60});
61{{/js}}