060d2878bfdc488c97663492ab6b3c6011328959
[moodle.git] / theme / bootstrapbase / templates / core_message / message_drawer_view_overview_section.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_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     This is an overridden template
34     changing icon "t/collapsedcaret" to "t/collapsed"
35     adding ".in" to ".show"
37     Example context (json):
38     {}
40 }}
41 <div
42     class="accordion-group section border-0"
43     data-region="{{$region}}{{/region}}"
44 >
45     <div id="{{$region}}{{/region}}-toggle" class="card-header p-0" data-region="toggle">
46         <button
47             class="btn btn-link w-100 text-left p-2 m-0 d-flex align-items-center overview-section-toggle {{^expanded}}collapsed{{/expanded}}"
48             data-toggle="collapse"
49             data-target="#{{$region}}{{/region}}-target"
50             aria-expanded="{{#expanded}}true{{/expanded}}{{^expanded}}false{{/expanded}}"
51             aria-controls="{{$region}}{{/region}}-target"
52         >
53             <span class="collapsed-icon-container">
54                 {{#pix}} t/collapsed, core {{/pix}}
55             </span>
56             <span class="expanded-icon-container">
57                 {{#pix}} t/expanded, core {{/pix}}
58             </span>
59             {{$title}}{{/title}} (<span data-region="section-total-count">{{count.total}}</span>)
60             <span class="hidden ml-2" data-region="loading-icon-container">
61                 {{> core/loading }}
62             </span>
63             <span class="{{^count.unread}}hidden{{/count.unread}} badge badge-pill badge-primary ml-auto bg-primary" data-region="section-unread-count">
64                 {{count.unread}}
65             </span>
66         </button>
67     </div>
68     {{< core_message/message_drawer_lazy_load_list }}
69         {{$rootclasses}}collapse border-bottom {{#expanded}}show in{{/expanded}}{{/rootclasses}}
70         {{$rootattributes}}
71             id="{{$region}}{{/region}}-target"
72             aria-labelledby="{{$region}}{{/region}}-toggle"
73             data-parent="#message-drawer-view-overview-container"
74         {{/rootattributes}}
75     {{/ core_message/message_drawer_lazy_load_list }}
76 </div>