MDL-64506 templates: Move BS2 btns' to BS4 btns'
[moodle.git] / admin / tool / analytics / templates / models_list.mustache
CommitLineData
efaf8534
DM
1{{!
2 This file is part of Moodle - http://moodle.org/
3
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.
8
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.
13
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{{!
e10b29ed 18 @template tool_analytics/models_list
efaf8534
DM
19
20 Template for models list.
21
22 Classes required for JS:
23 * none
24
25 Data attributes required for JS:
26 * none
27
28 Context variables required for this template:
29 * none
30
31 Example context (json):
32 {
acb14d08
DM
33 "models": [
34 {
35 "target": "Prevent devs at risk",
2fa1f92a
MN
36 "targethelp": [
37 {
38 "title": "Help with something",
39 "url": "http://example.org/help",
40 "linktext": "",
41 "icon":{
42 "extraclasses": "iconhelp",
43 "attributes": [
44 {"name": "src", "value": "../../../pix/help.svg"},
45 {"name": "alt", "value": "Help icon"}
46 ]
47 }
48 }
acb14d08 49 ],
2fa1f92a
MN
50 "enabled": 1,
51 "indicators": [{
52 "name": "Indicator 1",
53 "help": [{
54 "title": "Help with something",
55 "url": "http://example.org/help",
56 "linktext": "",
57 "icon":{
58 "extraclasses": "iconhelp",
59 "attributes": [
60 {"name": "src", "value": "../../../pix/help.svg"},
61 {"name": "alt", "value": "Help icon"}
62 ]
63 }
64 }]
65 },
66 {
67 "name": "Indicator 2",
68 "help": [{
69 "title": "Help with something",
70 "url": "http://example.org/help",
71 "linktext": "",
72 "icon":{
73 "extraclasses": "iconhelp",
74 "attributes": [
75 {"name": "src", "value": "../../../pix/help.svg"},
76 {"name": "alt", "value": "Help icon"}
77 ]
78 }
79 }]
80 }],
acb14d08 81 "timesplitting": "Quarters",
2fa1f92a
MN
82 "timesplittinghelp": [
83 {
84 "title": "Help with something",
85 "url": "http://example.org/help",
86 "linktext": "",
87 "icon":{
88 "extraclasses": "iconhelp",
89 "attributes": [
90 {"name": "src", "value": "../../../pix/help.svg"},
91 {"name": "alt", "value": "Help icon"}
92 ]
93 }
94 }
95 ],
acb14d08
DM
96 "noinsights": "No insights available yet"
97 }
1cc2b4ba
DM
98 ],
99 "warnings": {
100 "message": "Hey, this is a warning"
101 }
efaf8534
DM
102 }
103}}
104
105{{#warnings}}
106 {{> core/notification_warning}}
107{{/warnings}}
f19719c1
DM
108{{#infos}}
109 {{> core/notification_info}}
110{{/infos}}
111
efaf8534 112<div class="box">
e4453adc 113 <div class="top-nav d-flex">
29551c4b
MM
114 <a href="{{createmodelurl}}" class="btn btn-secondary mr-2">{{#str}}createmodel, tool_analytics{{/str}}</a>
115 <a href="{{importmodelurl}}" class="btn btn-secondary">{{#str}}importmodel, tool_analytics{{/str}}</a>
e4453adc 116 </div>
efaf8534 117 <table class="generaltable fullwidth">
8816022d 118 <caption>{{#str}}analyticmodels, tool_analytics{{/str}}</caption>
efaf8534
DM
119 <thead>
120 <tr>
e10b29ed
DM
121 <th scope="col">{{#str}}target, tool_analytics{{/str}}</th>
122 <th scope="col">{{#str}}enabled, tool_analytics{{/str}}</th>
123 <th scope="col">{{#str}}indicators, tool_analytics{{/str}}</th>
124 <th scope="col">{{#str}}modeltimesplitting, tool_analytics{{/str}}</th>
125 <th scope="col">{{#str}}insights, tool_analytics{{/str}}</th>
efaf8534
DM
126 <th scope="col">{{#str}}actions{{/str}}</th>
127 </tr>
128 </thead>
129 <tbody>
130 {{#models}}
131 <tr>
2fa1f92a 132 <td>
8816022d 133 <span class="target-name">{{target}}</span>
2fa1f92a
MN
134 {{#targethelp}}
135 {{>core/help_icon}}
136 {{/targethelp}}
137 </td>
efaf8534
DM
138 <td>
139 {{#enabled}}
140 {{#pix}}i/checked, core, {{#str}}yes{{/str}}{{/pix}}
141 {{/enabled}}
142 {{^enabled}}
143 {{#str}}no{{/str}}
144 {{/enabled}}
145 </td>
146 <td>
147 <ul>
148 {{#indicators}}
2fa1f92a
MN
149 <li>
150 {{name}}
151 {{#help}}
152 {{>core/help_icon}}
153 {{/help}}
154 </li>
efaf8534
DM
155 {{/indicators}}
156 </ul>
157 </td>
158 <td>
2fa1f92a
MN
159 {{#timesplitting}}
160 {{timesplitting}}
161 {{#timesplittinghelp}}
162 {{>core/help_icon}}
163 {{/timesplittinghelp}}
164 {{/timesplitting}}
165 {{^timesplitting}}
166 {{#str}}notdefined, tool_analytics{{/str}}
8d6b7f0c
AA
167 {{#timesplittinghelp}}
168 {{>core/help_icon}}
169 {{/timesplittinghelp}}
2fa1f92a 170 {{/timesplitting}}
efaf8534
DM
171 </td>
172 <td>
f9e7447f
DM
173 {{! models_list renderer is responsible of sending one or the other}}
174 {{#insights}}
efaf8534 175 {{> core/single_select }}
f9e7447f
DM
176 {{/insights}}
177 {{#noinsights}}
178 {{.}}
179 {{/noinsights}}
efaf8534
DM
180 </td>
181 <td>
182 {{#actions}}
183 {{> core/action_menu}}
184 {{/actions}}
185 </td>
186 </tr>
187 {{/models}}
188 </tbody>
189 </table>
190</div>