Merge branch 'MDL-76207-39' of https://github.com/andrewnicols/moodle into MOODLE_39_...
[moodle.git] / message / templates / message_drawer_view_conversation_body_message.mustache
blob23f1e75cf1350a523edbb9c3d7c63ad8b4e698a3
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/>.
17 {{!
18     @template core_message/message_drawer_view_conversation_body_message
20     This template will render a single message for the body of the conversation page
21     in the message drawer.
23     Classes required for JS:
24     * none
26     Data attributes required for JS:
27     * All data attributes are required
29     Context variables required for this template:
30     * userid The logged in user id
31     * urls The URLs for the popover
33     Example context (json):
34     {}
37 <div
38     class="message clickable d-flex flex-column p-2 mx-1 position-relative {{#fromloggedinuser}}send {{/fromloggedinuser}}{{^fromloggedinuser}}received{{/fromloggedinuser}} rounded mb-2 mt-2"
39     data-region="message"
40     data-message-id="{{id}}"
41     role="checkbox"
42     aria-checked="false"
43     tabindex="0"
45     <div class="tail position-absolute"></div>
46     <div class="d-flex align-items-center {{^fromloggedinuser}}pb-2{{/fromloggedinuser}}">
47         {{^fromloggedinuser}}
48         <div style="flex-shrink: 0">
49             <img
50                 class="rounded-circle"
51                 src="{{{userfrom.profileimageurl}}}"
52                 alt="{{userfrom.fullname}}"
53                 aria-hidden="true"
54                 style="height: 30px"
55             >
56         </div>
57         <div class="text-truncate pl-2 pr-2">
58             <h6 class="text-truncate m-0 font-weight-bold">{{userfrom.fullname}}</h6>
59         </div>
60         {{/fromloggedinuser}}
62         <div
63             class="ml-auto small text-right time {{^formattedtime}}hidden{{/formattedtime}}"
64             style="flex-shrink: 0"
65             data-region="time-created"
66         >
67             {{formattedtime}}
68         </div>
69         <div
70             class="ml-auto small {{#formattedtime}}hidden{{/formattedtime}}"
71             {{#formattedtime}}aria-hidden="true"{{/formattedtime}}
72             {{^formattedtime}}aria-hidden="false"{{/formattedtime}}
73             data-region="loading-icon-container"
74         >
75             {{> core/loading }}
76         </div>
77         <div role="alert" class="text-danger hidden small" aria-hidden="true" data-region="error-message-container">
78             <div class="d-flex align-items-center">
79                 {{#pix}} req, core {{/pix}}
80                 <span class="ml-1" data-region="error-message"></span>
81             </div>
82         </div>
83         <button
84             class="ml-auto btn btn-link p-0 line-height-3 hidden"
85             aria-hidden="true"
86             data-region="retry-send"
87             title="{{#str}} retry, core {{/str}}"
88         >
89             <span class="text-primary small">{{#str}} retry, core {{/str}}</span>
90         </button>
91         <span class="hidden ml-2 small" data-region="not-selected-icon">{{#pix}} i/uncheckedcircle, core {{/pix}}</span>
92         <span class="hidden ml-2 small" data-region="selected-icon">{{#pix}} i/checkedcircle, core {{/pix}}</span>
93     </div>
94     <div dir="auto" align="initial" data-region="text-container">{{{text}}}</div>
95 </div>