Merge branch 'MDL-67119-39' of git://github.com/aanabit/moodle into MOODLE_39_STABLE
[moodle.git] / message / templates / message_drawer_view_overview_section.mustache
blob9330fe64172b4fd3156eaade8a421d068e258fef
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_overview_section
20     This template is a base template to render a collapsible "section" on the
21     overview page of the message drawer, for example the messages section.
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     {}
38 <div
39     class="section border-0 card"
40     data-region="{{$region}}{{/region}}"
42     <div id="{{$region}}{{/region}}-toggle" class="card-header p-0" data-region="toggle">
43         <button
44             class="btn btn-link w-100 text-left p-1 p-sm-2 d-flex align-items-center overview-section-toggle {{^expanded}}collapsed{{/expanded}}"
45             data-toggle="collapse"
46             data-target="#{{$region}}{{/region}}-target-{{uniqid}}"
47             aria-expanded="{{#expanded}}true{{/expanded}}{{^expanded}}false{{/expanded}}"
48             aria-controls="{{$region}}{{/region}}-target-{{uniqid}}"
49         >
50             <span class="collapsed-icon-container">
51                 {{#pix}} t/collapsedcaret, core {{/pix}}
52             </span>
53             <span class="expanded-icon-container">
54                 {{#pix}} t/expanded, core {{/pix}}
55             </span>
56             <span class="font-weight-bold">{{$title}}{{/title}}</span>
57             <small class="hidden ml-1" data-region="section-total-count-container"
58             aria-label="{{#str}} totalconversations, core_message, {{count.total}} {{/str}}">
59                 (<span data-region="section-total-count">{{count.total}}</span>)
60             </small>
61             <span class="hidden ml-2" data-region="loading-icon-container">
62                 {{> core/loading }}
63             </span>
64             <span class="{{^count.unread}}hidden{{/count.unread}} badge badge-pill badge-primary ml-auto bg-primary"
65             data-region="section-unread-count"
66             {{#count.unread}}aria-label="{{#str}} unreadconversations, core_message, {{count.unread}} {{/str}}"{{/count.unread}}>
67                 {{count.unread}}
68             </span>
69         </button>
70     </div>
71     {{< core_message/message_drawer_lazy_load_list }}
72         {{$rootclasses}}collapse border-bottom {{#expanded}}show{{/expanded}}{{/rootclasses}}
73         {{$rootattributes}}
74             id="{{$region}}{{/region}}-target-{{uniqid}}"
75             aria-labelledby="{{$region}}{{/region}}-toggle"
76             data-parent="#message-drawer-view-overview-container-{{uniqid}}"
77         {{/rootattributes}}
78     {{/ core_message/message_drawer_lazy_load_list }}
79 </div>