| 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 core_reportbuilder/report
|
|
|
19 |
|
|
|
20 |
Template for a report
|
|
|
21 |
|
|
|
22 |
Example context (json):
|
|
|
23 |
{
|
|
|
24 |
"id": 1,
|
|
|
25 |
"contextid": 1,
|
|
|
26 |
"type": 1,
|
|
|
27 |
"parameters": [],
|
|
|
28 |
"attributes": [{
|
|
|
29 |
"name": "data-custom",
|
|
|
30 |
"value": "1"
|
|
|
31 |
}],
|
|
|
32 |
"table": "table",
|
| 1441 |
ariadna |
33 |
"button": {
|
|
|
34 |
"tag": "button",
|
|
|
35 |
"title": "Click me",
|
|
|
36 |
"attributes": [{
|
|
|
37 |
"name": "class",
|
|
|
38 |
"value": "btn btn-primary"
|
|
|
39 |
}]
|
|
|
40 |
},
|
|
|
41 |
"infocontainer": "Here's some information",
|
| 1 |
efrain |
42 |
"filterspresent": true,
|
|
|
43 |
"filtersform": "form"
|
|
|
44 |
}
|
|
|
45 |
}}
|
|
|
46 |
<div class="reportbuilder-report {{classes}}"
|
| 1441 |
ariadna |
47 |
id="reportbuilder-report-{{uniqid}}"
|
| 1 |
efrain |
48 |
data-region="core_reportbuilder/report"
|
|
|
49 |
data-report-id="{{id}}"
|
|
|
50 |
data-report-type="{{type}}"
|
| 1441 |
ariadna |
51 |
data-report-parameters="{{parameters}}"
|
| 1 |
efrain |
52 |
{{#attributes}}{{name}}="{{value}}" {{/attributes}}>
|
|
|
53 |
<div class="reportbuilder-wrapper">
|
| 1441 |
ariadna |
54 |
{{! Action buttons }}
|
|
|
55 |
<div class="dropdown d-flex justify-content-end mb-3">
|
|
|
56 |
{{#button}}
|
|
|
57 |
<{{{tag}}} {{#attributes}}{{name}}="{{value}}" {{/attributes}}>{{title}}</{{{tag}}}>
|
|
|
58 |
{{/button}}
|
|
|
59 |
{{#filterspresent}}
|
| 1 |
efrain |
60 |
{{>core_reportbuilder/local/filters/area}}
|
| 1441 |
ariadna |
61 |
{{/filterspresent}}
|
|
|
62 |
</div>
|
|
|
63 |
{{! Info container }}
|
|
|
64 |
{{#infocontainer}}<div class="mt-2">{{{.}}}</div>{{/infocontainer}}
|
| 1 |
efrain |
65 |
{{! Table }}
|
| 1441 |
ariadna |
66 |
<div class="mt-2">{{{table}}}</div>
|
| 1 |
efrain |
67 |
</div>
|
|
|
68 |
</div>
|
|
|
69 |
|
|
|
70 |
{{#js}}
|
|
|
71 |
require(['core_reportbuilder/report'], function(report) {
|
|
|
72 |
report.init();
|
|
|
73 |
});
|
|
|
74 |
{{/js}}
|