MDL-64506 templates: Move BS2 labels to BS4 badges
[moodle.git] / message / output / popup / templates / message_content_item.mustache
CommitLineData
40624338
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{{!
7d69958e 18 @template message_output_popup/message_content_item
40624338
RW
19
20 This template will render the message content item for the
21 navigation bar message menu.
22
23 Classes required for JS:
24 * none
25
26 Data attributes required for JS:
14617a56 27 * All data attributes are required
40624338
RW
28
29 Context variables required for this template:
14617a56
RW
30 * isread If the message is read or not
31 * contexturl The link to the message on the messages page
32 * fullname The name of the sender
33 * profileimageurl The URL for the sender's profile image
34 * sentfromcurrentuser Was the last message sent by the current user
35 * lastmessage The message text
36 * unreadcount The number of unread messages in this conversation
40624338
RW
37
38 Example context (json):
39 {
14617a56
RW
40 "isread": true,
41 "contexturl": "http://www.moodle.com",
42 "fullname": "Some Person",
43 "profileimageurl": "http://www.moodle.com",
44 "sentfromcurrentuser": false,
45 "lastmessage": "Hello, this is Some Person!",
46 "unreadcount": 1
40624338
RW
47 }
48
49}}
eeee7bca 50<a class="content-item-container {{^isread}}unread{{/isread}}"
6af2bd09 51 data-region="message-content-item-container"
40624338 52 role="listitem"
eeee7bca
RW
53 href="{{{contexturl}}}"
54 {{^isread}}aria-label="{{#str}} viewunreadmessageswith, message, {{fullname}} {{/str}}"{{/isread}}
55 {{#isread}}aria-label="{{#str}} viewmessageswith, message, {{fullname}} {{/str}}"{{/isread}}
c826fa23 56 tabindex="0">
40624338
RW
57
58 <div class="content-item">
c826fa23
RW
59 <div class="profile-image-container">
60 <img src="{{{profileimageurl}}}" />
61 </div>
40624338 62 <div class="content-item-body">
c4624a76 63 <h3>{{fullname}}</h3>
89a70ba1
MN
64 <p>
65 {{#sentfromcurrentuser}}
66 <span data-region="last-message-user">{{#str}}you, message{{/str}}</span>
67 {{/sentfromcurrentuser}}
68 {{lastmessage}}
69 </p>
40624338 70 </div>
c33b7d89 71 <div class="unread-count-container">
3f2c68f1 72 <span data-region="unread-count" class="badge badge-danger">{{unreadcount}}</span>
c33b7d89 73 </div>
40624338 74 </div>
eeee7bca 75</a>