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/local/audience/form
|
|
|
19 |
|
|
|
20 |
Template for an audience form
|
|
|
21 |
|
|
|
22 |
Example context (json):
|
|
|
23 |
{
|
|
|
24 |
"instanceid": 1,
|
|
|
25 |
"classname": "some\\class\\name",
|
|
|
26 |
"heading": "Title",
|
|
|
27 |
"headingeditable": "Title (edit me)",
|
|
|
28 |
"showormessage": 1,
|
|
|
29 |
"editwarning": "Oh dear",
|
|
|
30 |
"canedit": 1,
|
|
|
31 |
"candelete": 1,
|
|
|
32 |
"description": "description",
|
|
|
33 |
"form": "form"
|
|
|
34 |
}
|
|
|
35 |
}}
|
|
|
36 |
<div data-region="audience-card" class="instance-card" data-audience-id="{{instanceid}}" data-audience-title="{{heading}}"
|
|
|
37 |
{{#editwarning}}
|
|
|
38 |
data-audience-edit-warning="1"
|
|
|
39 |
{{/editwarning}}
|
|
|
40 |
>
|
|
|
41 |
{{#showormessage}}
|
|
|
42 |
<span class="audience-separator d-flex mb-3 justify-content-center align-items-center small text-muted font-weight-bold">
|
|
|
43 |
{{#str}} or, core_reportbuilder {{/str}}
|
|
|
44 |
</span>
|
|
|
45 |
{{/showormessage}}
|
|
|
46 |
<div class="mb-3 card">
|
|
|
47 |
<div class="card-header p-0">
|
|
|
48 |
<div class="mb-0 d-flex">
|
|
|
49 |
<h3 class="h6 text-left m-0 align-self-center pl-3" data-region="audience-heading">
|
|
|
50 |
{{{headingeditable}}}
|
|
|
51 |
</h3>
|
|
|
52 |
<span class="ml-auto">
|
|
|
53 |
{{#canedit}}
|
|
|
54 |
<button class="btn btn-link px-0"
|
|
|
55 |
data-action="edit-audience"
|
|
|
56 |
title="{{#str}} editaudience, core_reportbuilder, {{heading}} {{/str}}"
|
|
|
57 |
aria-label="{{#str}} editaudience, core_reportbuilder, {{heading}} {{/str}}"
|
|
|
58 |
{{^description}}disabled{{/description}}>
|
|
|
59 |
{{#pix}} i/settings, core {{/pix}}
|
|
|
60 |
</button>
|
|
|
61 |
{{/canedit}}
|
|
|
62 |
{{#candelete}}
|
|
|
63 |
<button class="btn btn-link px-0 mr-2"
|
|
|
64 |
data-action="delete-audience"
|
|
|
65 |
title="{{#str}} deleteaudience, core_reportbuilder, {{heading}} {{/str}}"
|
|
|
66 |
aria-label="{{#str}} deleteaudience, core_reportbuilder, {{heading}} {{/str}}"
|
|
|
67 |
{{^description}}disabled{{/description}}>
|
|
|
68 |
{{#pix}} i/trash, core {{/pix}}
|
|
|
69 |
</button>
|
|
|
70 |
{{/candelete}}
|
|
|
71 |
</span>
|
|
|
72 |
</div>
|
|
|
73 |
</div>
|
|
|
74 |
<div class="card-body p-3" data-region="audience-form">
|
|
|
75 |
{{#editwarning}}<div class="alert alert-warning p-2">{{.}}</div>{{/editwarning}}
|
|
|
76 |
<div data-region="audience-description" {{^description}}class="hidden"{{/description}}>
|
|
|
77 |
{{{description}}}
|
|
|
78 |
</div>
|
|
|
79 |
<div data-region="audience-form-container" {{^form}}class="hidden"{{/form}}>
|
|
|
80 |
<div class="alert alert-warning p-2" data-region="audience-not-saved">{{#str}} audiencenotsaved, core_reportbuilder {{/str}}</div>
|
|
|
81 |
{{{form}}}
|
|
|
82 |
</div>
|
|
|
83 |
</div>
|
|
|
84 |
</div>
|
|
|
85 |
</div>
|