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 tool_dataprivacy/categories
|
|
|
19 |
|
|
|
20 |
Manage categories.
|
|
|
21 |
|
|
|
22 |
Classes required for JS:
|
|
|
23 |
|
|
|
24 |
Data attributes required for JS:
|
|
|
25 |
|
|
|
26 |
Context variables required for this template:
|
|
|
27 |
* categories - array of objects
|
|
|
28 |
* actions - array of actions (already in HTML).
|
|
|
29 |
|
|
|
30 |
Example context (json):
|
|
|
31 |
{
|
|
|
32 |
"categoriesexist": 1,
|
|
|
33 |
"categories": [
|
|
|
34 |
{
|
|
|
35 |
"name" : "Category 1",
|
|
|
36 |
"description": "<strong>Description 1</strong>",
|
|
|
37 |
"actions": [
|
|
|
38 |
]
|
|
|
39 |
}, {
|
|
|
40 |
"name" : "Category 2",
|
|
|
41 |
"description": "<strong>Description 2</strong>",
|
|
|
42 |
"actions": [
|
|
|
43 |
]
|
|
|
44 |
}
|
|
|
45 |
]
|
|
|
46 |
}
|
|
|
47 |
}}
|
|
|
48 |
|
|
|
49 |
{{#navigation}}
|
|
|
50 |
{{> core/action_link}}
|
|
|
51 |
{{/navigation}}
|
|
|
52 |
|
|
|
53 |
<div data-region="categories" class="mt-3 mb-1">
|
|
|
54 |
<div class="my-2">
|
|
|
55 |
<button class="btn btn-secondary" data-add-element="category" title="{{#str}}addcategory, tool_dataprivacy{{/str}}">
|
|
|
56 |
{{#pix}}t/add, moodle, {{#str}}addcategory, tool_dataprivacy{{/str}}{{/pix}}<span class="ml-2">{{#str}}addcategory, tool_dataprivacy{{/str}}</span>
|
|
|
57 |
</button>
|
|
|
58 |
</div>
|
|
|
59 |
|
|
|
60 |
<div class="overflow-auto">
|
|
|
61 |
<table class="table table-striped table-hover">
|
|
|
62 |
<caption class="accesshide">{{#str}}categorieslist, tool_dataprivacy{{/str}}</caption>
|
|
|
63 |
<thead>
|
|
|
64 |
<tr>
|
|
|
65 |
<th scope="col">{{#str}}name{{/str}}</th>
|
|
|
66 |
<th scope="col" class="w-50">{{#str}}description{{/str}}</th>
|
|
|
67 |
<th scope="col">{{#str}}actions{{/str}}</th>
|
|
|
68 |
</tr>
|
|
|
69 |
</thead>
|
|
|
70 |
<tbody>
|
|
|
71 |
{{#categories}}
|
|
|
72 |
<tr data-categoryid="{{id}}">
|
|
|
73 |
<td>{{{name}}}</td>
|
|
|
74 |
<td>{{{description}}}</td>
|
|
|
75 |
<td>
|
|
|
76 |
{{#actions}}
|
|
|
77 |
{{> core/action_menu}}
|
|
|
78 |
{{/actions}}
|
|
|
79 |
</td>
|
|
|
80 |
</tr>
|
|
|
81 |
{{/categories}}
|
|
|
82 |
</tbody>
|
|
|
83 |
</table>
|
|
|
84 |
</div>
|
|
|
85 |
{{^categories}}
|
|
|
86 |
<span class="badge badge-warning">
|
|
|
87 |
{{#str}}nocategories, tool_dataprivacy{{/str}}
|
|
|
88 |
</span>
|
|
|
89 |
{{/categories}}
|
|
|
90 |
</div>
|