Merge branch 'MDL-62397-master' of git://github.com/andrewnicols/moodle
[moodle.git] / report / insights / templates / insight_details.mustache
blobf5a6493d263a847d6610c695e5c552ab49ef63cf
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/insight_details
20     Actions panel at the bottom of the assignment grading UI.
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         "timecreated": "Thursday, 5 October 2017, 4:16 PM",
35         "timerange": "Monday, 4 September 2017, 6:00 PM to Thursday, 5 October 2017, 12:00 AM",
36         "sampleimage": "<a href=\"#\">Link</a>",
37         "sampledescription": "Sample description",
38         "style": "success",
39         "outcomeicon": {
40             "attributes": [
41                 {"name": "src", "value": "https://moodle.org/logo/moodle-logo.svg" }
42             ]
43         },
44         "predictiondisplayvalue": "This dev will understand it",
45         "calculations": [
46             {
47                 "style": "success",
48                 "outcomeicon": {
49                     "attributes": [
50                         {"name": "src", "value": "https://moodle.org/logo/moodle-logo.svg" }
51                     ]
52                 },
53                 "name": "Indicator 1",
54                 "displayvalue": "yes"
55             }, {
56                 "style": "info",
57                 "name": "Indicator 2",
58                 "displayvalue": "20%"
59             }, {
60                 "style": "",
61                 "name": "Indicator 2",
62                 "displayvalue": "20%"
63             }, {
64                 "style": "warning",
65                 "name": "Indicator 2",
66                 "displayvalue": "20%"
67             }, {
68                 "style": "danger",
69                 "name": "Indicator 2",
70                 "displayvalue": "20%"
71             }
72         ]
73     }
76 <h2 class="m-b-2">{{#str}}insightprediction, report_insights, {{insightname}} {{/str}}</h2>
77 <table class="generaltable insights-list">
78     <caption>
79             {{#str}}prediction, report_insights{{/str}}:
80             <span class="{{#style}}table-{{style}}{{/style}}">
81                 {{#outcomeicon}}
82                     {{> core/pix_icon}}
83                 {{/outcomeicon}}
84                 {{predictiondisplayvalue}}
85             </span>
86         </caption>
87     <thead>
88         <tr>
89             <th scope="col" class="col-sm-10">{{#str}}name{{/str}}</th>
90             <th scope="col" class="col-sm-2">{{#str}}actions{{/str}}</th>
91         </tr>
92     </thead>
93     <tbody>
94         {{> report_insights/insight}}
95     </tbody>
96 </table>
98 <table class="generaltable prediction-timedetails">
99     <caption>{{#str}}predictiondetails, report_insights{{/str}}</caption>
100     <tbody>
101         <tr>
102             <td scope="col" class="col-sm-3">{{#str}}timecreated, report_insights{{/str}}</td>
103             <td scope="col" class="col-sm-9">{{timecreated}}</td>
104         </tr>
105         {{#timerange}}
106             <tr>
107                 <td scope="col" class="col-sm-3">{{#str}}timerange, report_insights{{/str}}</td>
108                 <td scope="col" class="col-sm-9">{{.}}</td>
109             </tr>
110         {{/timerange}}
111     </tbody>
112 </table>
113 <table class="generaltable prediction-calculations">
114     <caption class="accesshide">{{#str}}predictioncalculations, report_insights{{/str}}</caption>
115     <thead>
116         <tr>
117             <th scope="col" class="col-sm-8">{{#str}}indicator, report_insights{{/str}}</th>
118             <th scope="col" class="col-sm-4">{{#str}}calculatedvalue, report_insights{{/str}}</th>
119         </tr>
120     </thead>
121     <tbody>
122     {{#calculations}}
123         <tr>
124             <td class="{{#style}}table-{{style}}{{/style}} col-sm-8">{{name}}</td>
125             <td class="{{#style}}table-{{style}}{{/style}} col-sm-4">{{#outcomeicon}}{{> core/pix_icon}}{{/outcomeicon}} {{displayvalue}}</td>
126         </tr>
127     {{/calculations}}
128     </tbody>
129 </table>
130 {{#nocalculations}}
131     {{> core/notification_info}}
132 {{/nocalculations}}