Merge branch 'MDL-77272-main' of https://github.com/SergioComeron/moodle
[moodle.git] / lib / templates / settings_link_page.mustache
blobbee9fbde429ef56811f6d9475a5847936c2c8ff9
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/settings_link_page
20     Displays the admin tree as a list of grouped links.
22     Example context (json):
23     {
24         "node": {
25             "text": "Root of menu",
26             "key": "test0",
27             "display": true,
28             "children": [
29                 {
30                     "text": "Child of menu",
31                     "key": "test1",
32                     "display": true,
33                     "children": []
34                 }
35             ]
36         }
37     }
39 {{^secondarynavigation}}
40     <ul class="nav nav-tabs" role="tablist">
41         <!-- First the top most node and immediate children -->
42         <li class="nav-item">
43             <a class="nav-link active" href="#link{{node.key}}" data-toggle="tab" role="tab" aria-selected="true">{{node.text}}</a>
44         </li>
45         <!-- Now the first level children with sub nodes -->
46         {{#node.children}}
47             {{#children.count}}
48                 {{#display}}
49                     {{^is_short_branch}}
50                         <li class="nav-item">
51                             <a class="nav-link" href="#link{{key}}" data-toggle="tab" role="tab" aria-selected="false" tabindex="-1">{{text}}</a>
52                         </li>
53                     {{/is_short_branch}}
54                 {{/display}}
55             {{/children.count}}
56         {{/node.children}}
57     </ul>
58 {{/secondarynavigation}}
59 <div class="tab-content mt-3">
60     <div class="tab-pane active" id="link{{node.key}}" {{^secondarynavigation}}role="tabpanel"{{/secondarynavigation}}>
61         <div class="container-fluid">
62             <div class="row">
63                 <div class="col-sm-3">
64                 </div>
65                 <div class="col">
66                     <ul class="list-unstyled">
67                         {{#node.children}}
68                             {{^children.count}}
69                                 {{#display}}
70                                     <li><a href="{{{action}}}">{{text}}</a></li>
71                                 {{/display}}
72                             {{/children.count}}
73                         {{/node.children}}
74                     </ul>
75                 </div>
76             </div>
78             {{#node.children}}
79                 {{#display}}
80                     {{#children.count}}
81                         {{#is_short_branch}}
82                             <hr>
83                             <div class="row">
84                                 <div class="col-sm-3">
85                                     {{#action}}<h4><a href="{{action}}">{{text}}</a></h4>{{/action}}
86                                     {{^action}}<h4>{{text}}</h4>{{/action}}
87                                 </div>
88                                 <div class="col">
89                                     <ul class="list-unstyled">
90                                         {{#children}}
91                                             {{> core/settings_link_page_single }}
92                                         {{/children}}
93                                     </ul>
94                                 </div>
95                             </div>
96                         {{/is_short_branch}}
97                     {{/children.count}}
98                 {{/display}}
99             {{/node.children}}
100         </div>
101     </div>
102     {{#node.children}}
103         {{#children.count}}
104             <div class="tab-pane" id="link{{key}}" {{^secondarynavigation}}role="tabpanel"{{/secondarynavigation}}>
105                 <div class="container-fluid">
106                     <div class="row">
107                         <div class="col-sm-3">
108                             {{#action}}<h4><a href="{{action}}">{{text}}</a></h4>{{/action}}
109                             {{^action}}<h4>{{text}}</h4>{{/action}}
110                         </div>
111                         <div class="col-sm-9">
112                             <ul class="list-unstyled">
113                                 {{#children}}
114                                     {{#display}}
115                                         {{^children.count}}
116                                             <li><a href="{{{action}}}">{{text}}</a></li>
117                                         {{/children.count}}
118                                     {{/display}}
119                                 {{/children}}
120                             </ul>
121                         </div>
122                     </div>
123                     {{#children}}
124                         {{#display}}
125                             {{#children.count}}
126                                 <hr>
127                                 <div class="row">
128                                     <div class="col-sm-3">
129                                         {{#action}}<h4><a href="{{action}}">{{text}}</a></h4>{{/action}}
130                                         {{^action}}<h4>{{text}}</h4>{{/action}}
131                                     </div>
132                                     <div class="col-sm-9">
133                                         <ul class="list-unstyled">
134                                             {{#children}}
135                                                 {{> core/settings_link_page_single }}
136                                             {{/children}}
137                                         </ul>
138                                     </div>
139                                 </div>
140                             {{/children.count}}
141                         {{/display}}
142                     {{/children}}
143                 </div>
144             </div>
145         {{/children.count}}
146     {{/node.children}}
147 </div>