MDL-54708 message: add notification popover to nav bar
[moodle.git] / message / templates / notification_content_item.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 message/notification_content_item
20     This template will render the notification content item for the
21     navigation bar notification menu.
23     Classes required for JS:
24     * none
26     Data attributes required for JS:
27     * none
29     Context variables required for this template:
30     * userid the logged in user id
32     Example context (json):
33     {
34     }
36 }}
37 <div class="content-item-container"
38     role="listitem"
39     aria-expanded="false"
40     aria-label="{{subject}}"
41     tabindex="0"
42     {{#contexturl}}data-context-url="{{{.}}}"{{/contexturl}}>
44     <div class="content-item">
45         <div class="content-item-header">
46             <h3>
47                 {{#userfromprofileurl}}<a href="{{{.}}}">{{/userfromprofileurl}}
48                     {{userfromfullname}}
49                 {{#userfromprofileurl}}</a>{{/userfromprofileurl}}
50             </h3>
51         </div>
52         <div class="content-item-body">
53             <div class="content-body-short">
54                 <div class="notification-image">
55                     <img src="{{{iconurl}}}" alt="{{#str}}notificationimage, message{{/str}}"/>
56                 </div>
57                 <p class="notification-message">{{subject}}</p>
58             </div>
59             <div class="content-body-full" aria-hidden="true">
60                 <pre>{{fullmessage}}</pre>
61             </div>
62         </div>
63         <div class="content-item-footer">
64             <p>{{timecreatedpretty}}</p>
65         </div>
66     </div>
67     <div class="content-item-controls">
68         <span class="block-button">{{#pix}} t/block {{/pix}}</span>
69         <div class="expand-buttons">
70             <span class="show-button"
71                 tabindex="0"
72                 aria-role="button"
73                 aria-label="{{#str}} expandnotification, message {{/str}}">
74                 {{#pix}} t/sort_desc {{/pix}}
75             </span>
76             <span class="hide-button"
77                 tabindex="0"
78                 aria-role="button"
79                 aria-hidden="true"
80                 aria-label="{{#str}} collapsenotification, message {{/str}}">
81                 {{#pix}} t/sort_asc {{/pix}}
82             </span>
83         </div>
84     </div>
85 </div>