Merge branch 'MDL-58454-master' of git://github.com/junpataleta/moodle
[moodle.git] / lib / templates / settings_link_page.mustache
blobb61bf204254e3bd98849e341f8b00652f55bac57
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     }
40 <ul class="nav nav-tabs" role="tablist">
41 <!-- First the top most node and immediate children -->
42     <li class="active"> <a href="#link{{node.key}}" data-toggle="tab" role="tab">{{node.text}}</a> </li>
43 <!-- Now the first level children with sub nodes -->
44 {{#node.children}}
45     {{#children.count}}
46         {{#display}}
47             {{^is_short_branch}}
48                 <li> <a href="#link{{key}}" data-toggle="tab" role="tab">{{text}}</a> </li>
49             {{/is_short_branch}}
50         {{/display}}
51     {{/children.count}}
52 {{/node.children}}
53 </ul>
55 <div class="tab-content">
56     <div class="tab-pane active" id="link{{node.key}}" role="tabpanel">
57         <div class="well">
58             <div class="container-fluid">
59                 <div class="row">
60                     <div class="span9 offset3">
61                         <ul class="unstyled indented-list">
62                             {{#node.children}}
63                                 {{^children.count}}
64                                     {{#display}}
65                                         <li><a href="{{{action}}}">{{text}}</a></li>
66                                     {{/display}}
67                                 {{/children.count}}
68                             {{/node.children}}
69                         </ul>
70                     </div>
71                 </div>
73                 {{#node.children}}
74                     {{#display}}
75                         {{#children.count}}
76                             {{#is_short_branch}}
77                                 <hr>
78                                 <div class="row">
79                                     <div class="span3">
80                                         {{#action}}<h4><a href="{{action}}">{{text}}</a><h4>{{/action}}
81                                         {{^action}}<h4>{{text}}<h4>{{/action}}
82                                     </div>
83                                     <div class="span9">
84                                         <ul class="unstyled indented-list">
85                                             {{#children}}
86                                                 {{> core/settings_link_page_single }}
87                                             {{/children}}
88                                         </ul>
89                                     </div>
90                                 </div>
91                             {{/is_short_branch}}
92                         {{/children.count}}
93                     {{/display}}
94                 {{/node.children}}
95             </div>
96         </div>
97     </div>
98     {{#node.children}}
99         {{#children.count}}
100             <div class="tab-pane" id="link{{key}}" role="tabpanel">
101                 <div class="well">
102                     <div class="container-fluid">
103                         <div class="row">
104                             <div class="span3">
105                                 {{#action}}<h4><a href="{{action}}">{{text}}</a><h4>{{/action}}
106                                 {{^action}}<h4>{{text}}<h4>{{/action}}
107                             </div>
108                             <div class="span9">
109                                 <ul class="unstyled">
110                                     {{#children}}
111                                         {{#display}}
112                                             {{^children.count}}
113                                                 <li><a href="{{{action}}}">{{text}}</a></li>
114                                             {{/children.count}}
115                                         {{/display}}
116                                     {{/children}}
117                                 </ul>
118                             </div>
119                         </div>
120                         {{#children}}
121                             {{#display}}
122                                 {{#children.count}}
123                                     <hr>
124                                     <div class="row">
125                                         <div class="span3">
126                                             {{#action}}<h4><a href="{{action}}">{{text}}</a><h4>{{/action}}
127                                             {{^action}}<h4>{{text}}<h4>{{/action}}
128                                         </div>
129                                         <div class="span9">
130                                             <ul class="unstyled indented-list">
131                                                 {{#children}}
132                                                     {{> core/settings_link_page_single }}
133                                                 {{/children}}
134                                             </ul>
135                                         </div>
136                                     </div>
137                                 {{/children.count}}
138                             {{/display}}
139                         {{/children}}
140                     </div>
141                 </div>
142             </div>
143         {{/children.count}}
144     {{/node.children}}
145 </div>