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/>.
18 @template core/dynamic_tabs
20 Template for showing dynamic tabs
22 Example context (json):
24 "dataattributes": [ {"name": "programid", "value": "13"} ],
25 "showtabsnavigation": "1",
29 "displayname": "Tab 1",
30 "content": "Content of tab 1",
35 "displayname": "Tab 2",
36 "content": "Content of tab 2",
42 {{! We must not use the JS helper otherwise this gets executed too late. Tell behat to wait. }}
44 M.util.js_pending('core_dynamic_tabs_init');
47 <div class="dynamictabs">
48 {{#showtabsnavigation}}
49 <ul class="nav nav-tabs mb-4 moodle-has-zindex" id="dynamictabs-tabs" role="tablist">
51 <li class="nav-item" role="presentation">
52 <a class="nav-link {{#active}}active{{/active}} {{^enabled}}disabled{{/enabled}}" id="{{shortname}}-tab" data-toggle="tab" href="#{{shortname}}" role="tab" aria-controls="{{shortname}}">
58 {{/showtabsnavigation}}
59 <div class="tab-content" id="dynamictabs-content">
61 <div class="tab-pane fade container-fluid {{#active}}show active{{/active}}"
64 aria-labelledby="{{shortname}}-tab"
65 data-tab-content="{{shortname}}"
66 data-tab-class="{{tabclass}}"
67 {{#dataattributes}}data-{{name}}="{{value}}"{{/dataattributes}}>
75 require(['core/dynamic_tabs'], function(Tabs) {
77 M.util.js_complete('core_dynamic_tabs_init');