Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 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
{{!
18
    @template report_insights/insights_list
19
 
20
    Template for the insights 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
    {
33
        "contextid": 123,
34
        "modelid": 321,
35
        "insightname": "Best insight ever",
36
        "nostaticmodelnotification": {
37
            "message": "This is just a prediction."
38
        },
39
        "showpredictionheading": "true",
40
        "predictions": [
41
            {
42
                "predictiondisplayvalue": "This dev will understand it",
43
                "style": "success",
44
                "outcomeicon": {
45
                    "attributes": [
46
                        {"name": "src", "value": "https://moodle.org/logo/moodle-logo.svg" }
47
                    ]
48
                },
49
                "multiplepredictions": "true",
50
                "insights": [
51
                    {
52
                        "sampleimage": "<a href=\"#\">Link</a>",
53
                        "sampledescription": "Sample description",
54
                        "actions": [
55
                            {
56
                                "classes": "",
57
                                "primary": {
58
                                    "items": [{"rawhtml": "<p>View details</p>"}]
59
                                },
60
                                "secondary": {
61
                                    "items": [{"rawhtml": "<p>Not useful</p>"}]
62
                                }
63
                            }
64
                        ]
65
                    }, {
66
                        "sampleimage": "<a href=\"#\">Link</a>",
67
                        "sampledescription": "Sample description",
68
                        "actions": [
69
                            {
70
                                "classes": "",
71
                                "primary": {
72
                                    "items": [{"rawhtml": "<p>View details</p>"}]
73
                                },
74
                                "secondary": {
75
                                    "items": [{"rawhtml": "<p>Not useful</p>"}]
76
                                }
77
                            }
78
                        ]
79
                    }
80
                ]
81
            }, {
82
                "predictiondisplayvalue": "This dev will not understand it",
83
                "style": "danger",
84
                "outcomeicon": {
85
                    "attributes": [
86
                        {"name": "src", "value": "https://moodle.org/logo/moodle-logo.svg" }
87
                    ]
88
                },
89
                "insights": [
90
                    {
91
                        "sampleimage": "<a href=\"#\">Any renderable</a>",
92
                        "sampledescription": "Another sample description"
93
                    }
94
                ]
95
            }
96
        ],
97
        "noinsights": false
98
    }
99
}}
100
 
101
{{#modelselector}}
102
    <div class="mb-2">
103
        {{> core/single_select}}
104
    </div>
105
{{/modelselector}}
106
 
107
<div class="insight-container" data-context-id="{{contextid}}" data-model-id="{{modelid}}">
108
 
109
    <h3 class="mb-2">{{insightname}}</h3>
110
 
111
    {{{insightdescription}}}
112
 
113
    {{^noinsights}}
114
    {{#nostaticmodelnotification}}
115
        <div class="mt-2">
116
            {{> core/notification_info}}
117
        </div>
118
    {{/nostaticmodelnotification}}
119
 
120
    {{{ pagingbar }}}
121
 
122
    {{> report_insights/bulk_actions}}
123
 
124
    {{#predictions}}
125
 
126
        <table class="generaltable insights-list mt-3">
127
            {{#showpredictionheading}}
128
                <caption>
129
                    {{#str}}prediction, report_insights{{/str}}:
130
                    <span class="{{#style}}table-{{style}}{{/style}}">
131
                        {{#outcomeicon}}
132
                            {{> core/pix_icon}}
133
                        {{/outcomeicon}}
134
                        {{predictiondisplayvalue}}
135
                    </span>
136
                </caption>
137
            {{/showpredictionheading}}
138
            <thead>
139
                <tr class="d-flex">
140
                    {{#multiplepredictions}}
141
                        <th class="col-1{{^bulkactions}} hidden{{/bulkactions}}">
142
                            {{{checkboxtoggleall}}}
143
                        </th>
144
                    {{/multiplepredictions}}
145
                    {{^multiplepredictions}}
146
                        <th class="col-1{{^bulkactions}} hidden{{/bulkactions}}">
147
                    {{/multiplepredictions}}
148
                    <th scope="col" class="col-8">{{#str}}description{{/str}}</th>
149
                    <th scope="col" class="col-3">{{#str}}actions{{/str}}</th>
150
                </tr>
151
            </thead>
152
            <tbody>
153
                {{#insights}}
154
                    {{> report_insights/insight}}
155
                {{/insights}}
156
            </tbody>
157
        </table>
158
 
159
    {{/predictions}}
160
 
161
    {{#multiplepredictions}}
162
        {{> report_insights/bulk_actions}}
163
    {{/multiplepredictions}}
164
 
165
    {{{ pagingbar }}}
166
    {{/noinsights}}
167
    {{#noinsights}}
168
        <div class="mt-2">
169
            {{> core/notification_info}}
170
        </div>
171
    {{/noinsights}}
172
 
173
</div>