Merge branch 'MDL-62397-master' of git://github.com/andrewnicols/moodle
[moodle.git] / report / insights / templates / insights_list.mustache
blobb13137d8580657dc6809e42e0137940f6427982c
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 report_insights/insights_list
20     Template for the insights list.
22     Classes required for JS:
23     * none
25     Data attributes required for JS:
26     * none
28     Context variables required for this template:
29     * none
31     Example context (json):
32     {
33         "insightname": "Best insight ever",
34         "nostaticmodelnotification": {
35             "message": "This is just a prediction."
36         },
37         "predictions": [
38             {
39                 "predictiondisplayvalue": "This dev will understand it",
40                 "style": "success",
41                 "outcomeicon": {
42                     "attributes": [
43                         {"name": "src", "value": "https://moodle.org/logo/moodle-logo.svg" }
44                     ]
45                 },
46                 "insights": [
47                     {
48                         "sampleimage": "<a href=\"#\">Link</a>",
49                         "sampledescription": "Sample description"
50                     }
51                 ]
52             }, {
53                 "predictiondisplayvalue": "This dev will not understand it",
54                 "style": "danger",
55                 "outcomeicon": {
56                     "attributes": [
57                         {"name": "src", "value": "https://moodle.org/logo/moodle-logo.svg" }
58                     ]
59                 },
60                 "insights": [
61                     {
62                         "sampleimage": "<a href=\"#\">Any renderable</a>",
63                         "sampledescription": "Another sample description"
64                     }
65                 ]
66             }
67         ],
68         "noinsights": false
69     }
72 {{#modelselector}}
73     <div class="m-b-2">
74         {{> core/single_select}}
75     </div>
76 {{/modelselector}}
78 <h2 class="m-b-2">{{{insightname}}}</h2>
80 {{^noinsights}}
81 {{#nostaticmodelnotification}}
82     <div class="m-t-2">
83         {{> core/notification_info}}
84     </div>
85 {{/nostaticmodelnotification}}
87 {{{ pagingbar }}}
88 {{#predictions}}
89     <table class="generaltable insights-list">
90         <caption>
91             {{#str}}prediction, report_insights{{/str}}:
92             <span class="{{#style}}table-{{style}}{{/style}}">
93                 {{#outcomeicon}}
94                     {{> core/pix_icon}}
95                 {{/outcomeicon}}
96                 {{predictiondisplayvalue}}
97             </span>
98         </caption>
99         <thead>
100             <tr>
101                 <th scope="col" class="col-sm-10">{{#str}}name{{/str}}</th>
102                 <th scope="col" class="col-sm-2">{{#str}}actions{{/str}}</th>
103             </tr>
104         </thead>
105     {{#insights}}
106         <tbody>
107             {{> report_insights/insight}}
108         </tbody>
109     {{/insights}}
110     </table>
111 {{/predictions}}
112 {{{ pagingbar }}}
113 {{/noinsights}}
114 {{#noinsights}}
115     <div class="m-t-2">
116         {{> core/notification_info}}
117     </div>
118 {{/noinsights}}