93c9a8ca38d9eb76d825a958503a960c23e4ab79
[moodle.git] / admin / tool / dataprivacy / templates / data_requests.mustache
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 comments.
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/data_requests
20     Data requests page.
22     Classes required for JS:
23     * requestactions
25     Data attributes required for JS:
26     * none
28     Context variables required for this template:
29     * requests - Array of data requests.
31     Example context (json):
32     {
33         "requests": [
34             {
35                 "id": 1,
36                 "foruser" : {
37                     "fullname": "Oscar Olsen",
38                     "profileurl": "#"
39                 },
40                 "typenameshort" : "Export",
41                 "comments": "I would like to download all of my daughter's personal data",
42                 "statuslabelclass": "label-default",
43                 "statuslabel": "Pending",
44                 "timecreated" : 1517902435
45             },
46             {
47                 "id": 2,
48                 "foruser" : {
49                     "fullname": "Alexandre Denys",
50                     "profileurl": "#"
51                 },
52                 "typenameshort" : "Export",
53                 "comments": "Please give me all of the information you have about me...",
54                 "statuslabelclass": "label-warning",
55                 "statuslabel": "Awaiting completion",
56                 "timecreated" : 1517902435
57             },
58             {
59                 "id": 3,
60                 "foruser" : {
61                     "fullname": "Hirondino Moura",
62                     "profileurl": "#"
63                 },
64                 "typenameshort" : "Delete",
65                 "comments": "Please delete all of my son's personal data.",
66                 "statuslabelclass": "label-success",
67                 "statuslabel": "Complete",
68                 "timecreated" : 1517902435
69             },
70             {
71                 "id": 4,
72                 "foruser" : {
73                     "fullname": "Florian Krause",
74                     "profileurl": "#"
75                 },
76                 "typenameshort" : "Delete",
77                 "comments": "I would like to request for my personal data to be deleted from your site. Thanks!",
78                 "statuslabelclass": "label-danger",
79                 "statuslabel": "Rejected",
80                 "timecreated" : 1517902435
81             },
82             {
83                 "id": 5,
84                 "foruser" : {
85                     "fullname": "Nicklas Sørensen",
86                     "profileurl": "#"
87                 },
88                 "typenameshort" : "Export",
89                 "comments": "Please let me download my data",
90                 "statuslabelclass": "label-info",
91                 "statuslabel": "Processing",
92                 "timecreated" : 1517902435
93             }
94         ]
95     }
96 }}
98 {{#httpsite}}
99     {{> core/notification_warning}}
100 {{/httpsite}}
102 <div data-region="datarequests">
103     <div class="m-t-1 m-b-1">
104         <a href="{{newdatarequesturl}}" class="btn btn-primary" data-action="new-request">
105             {{#str}}newrequest, tool_dataprivacy{{/str}}
106         </a>
107     </div>
108     <table class="generaltable fullwidth">
109         <thead>
110             <tr>
111                 <th scope="col">{{#str}}requesttype, tool_dataprivacy{{/str}}</th>
112                 <th scope="col">{{#str}}user, tool_dataprivacy{{/str}}</th>
113                 <th scope="col">{{#str}}daterequested, tool_dataprivacy{{/str}}</th>
114                 <th scope="col">{{#str}}requeststatus, tool_dataprivacy{{/str}}</th>
115                 <th scope="col" colspan="2">{{#str}}message, tool_dataprivacy{{/str}}</th>
116             </tr>
117         </thead>
118         <tbody>
119             {{#requests}}
120             <tr {{!
121               }} data-region="request-node"{{!
122               }} data-id="{{id}}"{{!
123               }} data-type="{{type}}"{{!
124               }} data-status="{{status}}"{{!
125               }}>
126                 <td>{{typenameshort}}</td>
127                 <td><a href="{{foruser.profileurl}}" title="{{#str}}viewprofile{{/str}}">{{foruser.fullname}}</a></td>
128                 <td>{{#userdate}} {{timecreated}}, {{#str}} strftimedatetime {{/str}} {{/userdate}}</td>
129                 <td>
130                     <span class="label {{statuslabelclass}}">{{statuslabel}}</span>
131                 </td>
132                 <td>{{#shortentext}}60, {{comments}}{{/shortentext}}</td>
133                 <td>
134                     {{#actions}}
135                         {{> core/action_menu}}
136                     {{/actions}}
137                 </td>
138             </tr>
139             {{/requests}}
140             {{^requests}}
141             <tr>
142                 <td class="text-muted" colspan="6">
143                     {{#str}}nodatarequests, tool_dataprivacy{{/str}}
144                 </td>
145             </tr>
146             {{/requests}}
147         </tbody>
148     </table>
149 </div>
151 {{#js}}
152 // Initialise the JS.
153 require(['tool_dataprivacy/requestactions'], function(ActionsMod) {
154     new ActionsMod();
155 });
156 {{/js}}