MDL-61899 tool_dataprivacy: Subject access requests tool
[moodle.git] / admin / tool / dataprivacy / templates / categories.mustache
blob5bf63fb03f77e7967e7bf5f336c9ed2801cb3128
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 tool_dataprivacy/categories
20     Manage categories.
22     Classes required for JS:
24     Data attributes required for JS:
26     Context variables required for this template:
27     * categories - array of objects
28     * actions - array of actions (already in HTML).
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     }
49 {{#navigation}}
50     {{> core/action_link}}
51 {{/navigation}}
53 <div data-region="categories" class="m-t-3 m-b-1">
54     <h3>{{#str}}categories, tool_dataprivacy{{/str}}</h3>
55     <div class="m-y-1">
56         <button class="btn btn-secondary" data-add-element="category">
57             {{#pix}}t/add, moodle, {{#str}}addcategory, tool_dataprivacy{{/str}}{{/pix}}
58         </button>
59     </div>
60     <table class="generaltable fullwidth">
61         <caption class="accesshide">{{#str}}categorieslist, tool_dataprivacy{{/str}}</caption>
62         <thead>
63             <tr>
64                 <th scope="col">{{#str}}name{{/str}}</th>
65                 <th scope="col">{{#str}}description{{/str}}</th>
66                 <th scope="col">{{#str}}actions{{/str}}</th>
67             </tr>
68         </thead>
69         <tbody>
70             {{#categories}}
71             <tr data-categoryid="{{id}}">
72                 <td>{{{name}}}</td>
73                 <td>{{{description}}}</td>
74                 <td>
75                     {{#actions}}
76                         {{> core/action_menu}}
77                     {{/actions}}
78                 </td>
79             </tr>
80             {{/categories}}
81         </tbody>
82     </table>
83     {{^categories}}
84         <p>
85             {{#str}}nocategories, tool_dataprivacy{{/str}}
86         </p>
87     {{/categories}}
88 </div>