MDL-61899 tool_dataprivacy: Add lawful bases fields
[moodle.git] / admin / tool / dataprivacy / templates / purposes.mustache
blobd25fe14e1291948c10b2391b0bed5eeb919ddfb8
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/purposes
20     Manage purposes.
22     Classes required for JS:
24     Data attributes required for JS:
26     Context variables required for this template:
27     * purposes - array of objects
28     * actions - array of actions (already in HTML).
30     Example context (json):
31     {
32         "purposesexist": 1,
33         "purposes": [
34             {
35                 "name" : "Purpose 1",
36                 "description": "<strong>Purpose 1 description</strong>",
37                 "retentionperiod": 86400,
38                 "protected": 1,
39                 "formattedretentionperiod": "1 day",
40                 "actions": [
41                 ]
42             }, {
43                 "name" : "Purpose 2",
44                 "description": "<strong>Purpose 2 description</strong>",
45                 "retentionperiod": 7200,
46                 "protected": 0,
47                 "formattedretentionperiod": "2 hours",
48                 "actions": [
49                 ]
50             }
51         ]
52     }
56 {{#navigation}}
57     {{> core/action_link}}
58 {{/navigation}}
60 <div data-region="purposes" class="m-t-3 m-b-1">
61     <h3>{{#str}}purposes, tool_dataprivacy{{/str}}</h3>
62     <div class="m-y-1">
63         <button class="btn btn-secondary" data-add-element="purpose">
64             {{#pix}}t/add, moodle, {{#str}}addpurpose, tool_dataprivacy{{/str}}{{/pix}}
65         </button>
66     </div>
67     <table class="generaltable fullwidth">
68         <caption class="accesshide">{{#str}}purposeslist, tool_dataprivacy{{/str}}</caption>
69         <thead>
70             <tr>
71                 <th scope="col">{{#str}}name{{/str}}</th>
72                 <th scope="col">{{#str}}description{{/str}}</th>
73                 <th scope="col">{{#str}}lawfulbases, tool_dataprivacy{{/str}}</th>
74                 <th scope="col">{{#str}}sensitivedatareasons, tool_dataprivacy{{/str}}</th>
75                 <th scope="col">{{#str}}retentionperiod, tool_dataprivacy{{/str}}</th>
76                 <th scope="col">{{#str}}protected, tool_dataprivacy{{/str}}</th>
77                 <th scope="col">{{#str}}actions{{/str}}</th>
78             </tr>
79         </thead>
80         <tbody>
81             {{#purposes}}
82             <tr data-purposeid="{{id}}">
83                 <td>{{{name}}}</td>
84                 <td>{{{description}}}</td>
85                 <td>
86                     <ul>
87                         {{#formattedlawfulbases}}
88                             <li>
89                                 <span>{{name}}{{# pix }} i/info, core, {{description}} {{/ pix }}</span>
90                             </li>
91                         {{/formattedlawfulbases}}
92                     </ul>
93                 </td>
94                 <td>
95                     <ul>
96                         {{#formattedsensitivedatareasons}}
97                             <li>
98                                 <span>{{name}}{{# pix }} i/info, core, {{description}} {{/ pix }}</span>
99                             </li>
100                         {{/formattedsensitivedatareasons}}
101                     </ul>
102                 </td>
103                 <td>{{formattedretentionperiod}}</td>
104                 <td>
105                     {{#protected}}
106                         {{#pix}}i/checked, core, {{#str}}yes{{/str}}{{/pix}}
107                     {{/protected}}
108                     {{^protected}}
109                         {{#str}}no{{/str}}
110                     {{/protected}}
111                 </td>
112                 <td>
113                     {{#actions}}
114                         {{> core/action_menu}}
115                     {{/actions}}
116                 </td>
117             </tr>
118             {{/purposes}}
119         </tbody>
120     </table>
121     {{^purposes}}
122         <p>
123             {{#str}}nopurposes, tool_dataprivacy{{/str}}
124         </p>
125     {{/purposes}}
126 </div>