MDL-66477 message: Use the generic drawer for the message drawer
[moodle.git] / message / templates / message_drawer.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 core_message/message_drawer
20     This template will render the message drawer.
22     Classes required for JS:
23     * none
25     Data attributes required for JS:
26     * All data attributes are required
28     Context variables required for this template:
29     * userid The logged in user id
30     * urls The URLs for the popover
32     Example context (json):
33     {}
35 }}
36 {{< core/drawer}}
37     {{$rootId}}message-drawer-{{uniqid}}{{/rootId}}
38     {{$drawerContent}}
39         <div id="message-drawer-{{uniqid}}" class="message-app" data-region="message-drawer" role="region">
40             <div class="header-container position-relative" data-region="header-container">
41                 {{> core_message/message_drawer_view_contacts_header }}
42                 {{> core_message/message_drawer_view_conversation_header }}
43                 {{> core_message/message_drawer_view_overview_header }}
44                 {{> core_message/message_drawer_view_search_header }}
45                 {{> core_message/message_drawer_view_settings_header }}
46             </div>
47             <div class="body-container position-relative" data-region="body-container">
48                 {{> core_message/message_drawer_view_contact_body }}
49                 {{> core_message/message_drawer_view_contacts_body }}
50                 {{> core_message/message_drawer_view_conversation_body }}
51                 {{> core_message/message_drawer_view_group_info_body }}
52                 {{> core_message/message_drawer_view_overview_body }}
53                 {{> core_message/message_drawer_view_search_body }}
54                 {{> core_message/message_drawer_view_settings_body }}
55             </div>
56             <div class="footer-container position-relative" data-region="footer-container">
57                 {{> core_message/message_drawer_view_conversation_footer }}
58                 {{> core_message/message_drawer_view_overview_footer }}
59             </div>
60         </div>
61     {{/drawerContent}}
62 {{/core/drawer}}
64 {{#js}}
65 require(['jquery', 'core_message/message_drawer'], function($, MessageDrawer) {
66     var root = $('#message-drawer-{{uniqid}}');
67     MessageDrawer.init(root, '{{uniqid}}', false);
68 });
69 {{/js}}