1 |
efrain |
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 message_popup/notification_popover
|
|
|
19 |
|
|
|
20 |
This template will render the notification 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 |
"userid": 3,
|
|
|
35 |
"urls": {
|
|
|
36 |
"preferences": "http://www.moodle.com"
|
|
|
37 |
}
|
|
|
38 |
}
|
|
|
39 |
|
|
|
40 |
}}
|
|
|
41 |
{{< core/popover_region }}
|
|
|
42 |
{{$classes}}popover-region-notifications{{/classes}}
|
|
|
43 |
{{$attributes}}id="nav-notification-popover-container" data-userid="{{userid}}"{{/attributes}}
|
|
|
44 |
|
|
|
45 |
{{$togglelabel}}{{!
|
|
|
46 |
}}{{^unreadcount}} {{#str}} shownotificationwindownonew, message {{/str}} {{/unreadcount}} {{!
|
|
|
47 |
}}{{#unreadcount}} {{#str}} shownotificationwindowwithcount, message, {{.}} {{/str}} {{/unreadcount}} {{!
|
|
|
48 |
}}{{/togglelabel}}
|
|
|
49 |
{{$togglecontent}}
|
|
|
50 |
{{#pix}} i/notifications, core, {{#str}} togglenotificationmenu, message {{/str}} {{/pix}}
|
|
|
51 |
<div
|
|
|
52 |
class="count-container {{^unreadcount}}hidden{{/unreadcount}}"
|
|
|
53 |
data-region="count-container"
|
|
|
54 |
aria-hidden=true
|
|
|
55 |
>
|
|
|
56 |
{{unreadcount}}
|
|
|
57 |
</div>
|
|
|
58 |
{{/togglecontent}}
|
|
|
59 |
|
|
|
60 |
{{$containerlabel}}{{#str}} notificationwindow, message {{/str}}{{/containerlabel}}
|
|
|
61 |
|
|
|
62 |
{{$headertext}}{{#str}} notifications, message {{/str}}{{/headertext}}
|
|
|
63 |
{{$headeractions}}
|
|
|
64 |
<a class="mark-all-read-button"
|
|
|
65 |
href="#"
|
|
|
66 |
title="{{#str}} markallread {{/str}}"
|
|
|
67 |
data-action="mark-all-read"
|
|
|
68 |
role="button"
|
|
|
69 |
aria-label="{{#str}} markallread {{/str}}">
|
|
|
70 |
<span class="normal-icon">{{#pix}} t/markasread, core {{/pix}}</span>
|
|
|
71 |
{{> core/loading }}
|
|
|
72 |
</a>
|
|
|
73 |
{{# urls.preferences }}
|
|
|
74 |
<a href="{{{ . }}}"
|
|
|
75 |
title="{{#str}} notificationpreferences, message {{/str}}"
|
|
|
76 |
aria-label="{{#str}} notificationpreferences, message {{/str}}">
|
|
|
77 |
{{#pix}} i/settings, core {{/pix}}</a>
|
|
|
78 |
{{/ urls.preferences }}
|
|
|
79 |
{{/headeractions}}
|
|
|
80 |
|
|
|
81 |
{{$content}}
|
|
|
82 |
<div class="all-notifications"
|
|
|
83 |
data-region="all-notifications"
|
|
|
84 |
role="log"
|
|
|
85 |
aria-busy="false"
|
|
|
86 |
aria-atomic="false"
|
|
|
87 |
aria-relevant="additions"></div>
|
|
|
88 |
<div class="empty-message" tabindex="0" data-region="empty-message">{{#str}} nonotifications, message {{/str}}</div>
|
|
|
89 |
{{/content}}
|
|
|
90 |
{{/ core/popover_region }}
|
|
|
91 |
{{#js}}
|
|
|
92 |
require(['jquery', 'message_popup/notification_popover_controller'], function($, Controller) {
|
|
|
93 |
var container = $('#nav-notification-popover-container');
|
|
|
94 |
var controller = new Controller(container);
|
|
|
95 |
controller.registerEventListeners();
|
|
|
96 |
controller.registerListNavigationEventListeners();
|
|
|
97 |
});
|
|
|
98 |
{{/js}}
|