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/>.
18 @template message/notification_popover
20 This template will render the notification popover for the navigation bar.
22 Classes required for JS:
25 Data attributes required for JS:
28 Context variables required for this template:
29 * userid the logged in user id
31 Example context (json):
36 {{< core/mdl_popover }}
37 {{$classes}}mdl-popover-notifications unread-only{{/classes}}
38 {{$attributes}}id="nav-notification-popover-container" data-userid="{{userid}}"{{/attributes}}
40 {{$togglelabel}}{{#str}} shownotificationwindownonew, message {{/str}}{{/togglelabel}}
42 {{#pix}} i/notifications, core, {{#str}} togglenotificationmenu, message {{/str}} {{/pix}}
43 <div class="count-container hidden"></div>
46 {{$containerlabel}}{{#str}} notificationwindow, message {{/str}}{{/containerlabel}}
48 {{$headertext}}{{#str}} notifications, message {{/str}}{{/headertext}}
50 <div class="fancy-toggle on" tabindex="0" aria-label="{{#str}} showallnotifications, message {{/str}}">
51 <div class="slider-container"><div class="slider"></div></div>
52 <div class="off-text">{{#str}} all {{/str}}</div>
53 <div class="on-text">{{#str}} new {{/str}}</div>
55 <a id="mark-all-read-button"
59 data-original-title="{{#str}} markallread {{/str}}"
61 <span class="normal-icon">{{#pix}} t/markasread, core, {{#str}} markallread {{/str}} {{/pix}}</span>
62 <span class="loading-icon">{{#pix}} y/loading, core, {{#str}} loading, mod_assign {{/str}} {{/pix}}</span>
64 <a href="{{{urls.preferences}}}"
67 data-original-title="{{#str}} notificationpreferences, message {{/str}}">
68 {{#pix}} i/settings, core, {{#str}} notificationpreferences, message {{/str}} {{/pix}}
73 <div class="all-notifications" role="log" aria-busy="false" aria-atomic="false" aria-relevant="additions"></div>
74 <div class="empty-message" tabindex="0">{{#str}} nonotifications, message {{/str}}</div>
75 <div class="unread-notifications" role="log" aria-busy="false" aria-atomic="false" aria-relevant="additions"></div>
76 <div class="empty-message" tabindex="0">{{#str}} nonewnotifications, message {{/str}}</div>
78 {{/ core/mdl_popover }}
80 require(['jquery', 'message/notification_popover_controller'], function($, controller) {
81 var container = $('#nav-notification-popover-container');
82 var controller = new controller(container);
83 controller.registerEventListeners();
84 controller.registerListNavigationEventListeners();