MDL-64506 templates: Move BS2 labels to BS4 badges
[moodle.git] / admin / tool / dataprivacy / templates / my_data_requests.mustache
CommitLineData
5efc1f9e
DM
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 comments.
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/my_data_requests
19
20 A user's data requests page.
21
22 Classes required for JS:
23 * requestactions
24
25 Data attributes required for JS:
26 * none
27
28 Context variables required for this template:
29 * requests - Array of data requests.
30
31 Example context (json):
32 {
33 "requests": [
34 {
35 "id": 1,
36 "typename" : "Data export",
37 "comments": "I would like to download all of my daughter's personal data",
3f2c68f1 38 "statuslabelclass": "badge-secondary",
5efc1f9e 39 "statuslabel": "Pending",
373a09a8
AG
40 "timecreated" : 1517902087,
41 "requestedbyuser" : {
42 "fullname": "Martha Smith",
43 "profileurl": "#"
44 }
5efc1f9e
DM
45 },
46 {
47 "id": 2,
48 "typename" : "Data export",
49 "comments": "Give me all of the information you have about me, or else...",
3f2c68f1 50 "statuslabelclass": "badge-warning",
5efc1f9e 51 "statuslabel": "Awaiting completion",
373a09a8
AG
52 "timecreated" : 1517902087,
53 "requestedbyuser" : {
54 "fullname": "Martha Smith",
55 "profileurl": "#"
56 }
5efc1f9e
DM
57 },
58 {
59 "id": 3,
60 "typename" : "Data deletion",
61 "comments": "Please delete all of my son's personal data.",
3f2c68f1 62 "statuslabelclass": "badge-success",
693f690c 63 "statuslabel": "Deleted",
373a09a8
AG
64 "timecreated" : 1517902087,
65 "requestedbyuser" : {
66 "fullname": "Martha Smith",
67 "profileurl": "#"
68 }
5efc1f9e
DM
69 },
70 {
71 "id": 4,
72 "typename" : "Data deletion",
73 "comments": "Delete my data or I'm coming for you...",
74 "statuslabelclass": "label-danger",
75 "statuslabel": "Rejected",
373a09a8
AG
76 "timecreated" : 1517902087,
77 "requestedbyuser" : {
78 "fullname": "Martha Smith",
79 "profileurl": "#"
80 }
5efc1f9e
DM
81 },
82 {
83 "id": 5,
84 "typename" : "Data export",
85 "comments": "Please let me download my data",
3f2c68f1 86 "statuslabelclass": "badge-info",
5efc1f9e 87 "statuslabel": "Processing",
373a09a8
AG
88 "timecreated" : 1517902087,
89 "requestedbyuser" : {
90 "fullname": "Martha Smith",
91 "profileurl": "#"
92 }
693f690c
MH
93 },
94 {
95 "id": 6,
96 "typename" : "Data export",
97 "comments": "Please let me download my data",
98 "statuslabelclass": "label",
99 "statuslabel": "Expired",
100 "statuslabeltitle": "Download has expired. Submit a new request if you wish to export your personal data.",
101 "timecreated" : 1517902087,
102 "requestedbyuser" : {
103 "fullname": "Martha Smith",
104 "profileurl": "#"
105 }
5efc1f9e
DM
106 }
107 ]
108 }
109}}
110
be5cc0ba
MH
111{{#httpsite}}
112 {{> core/notification_warning}}
113{{/httpsite}}
114
5efc1f9e
DM
115<div data-region="datarequests">
116 <div class="m-t-1 m-b-1">
117 <a href="{{newdatarequesturl}}" class="btn btn-primary" data-action="new-request">
118 {{#str}}newrequest, tool_dataprivacy{{/str}}
119 </a>
120 </div>
121 <table class="generaltable fullwidth">
122 <thead>
123 <tr>
124 <th scope="col">{{#str}}requesttype, tool_dataprivacy{{/str}}</th>
125 <th scope="col">{{#str}}daterequested, tool_dataprivacy{{/str}}</th>
373a09a8 126 <th scope="col">{{#str}}requestby, tool_dataprivacy{{/str}}</th>
5efc1f9e
DM
127 <th scope="col">{{#str}}requeststatus, tool_dataprivacy{{/str}}</th>
128 <th scope="col" colspan="2">{{#str}}message, tool_dataprivacy{{/str}}</th>
129 </tr>
130 </thead>
131 <tbody>
132 {{#requests}}
133 <tr {{!
134 }} data-region="request-node"{{!
135 }} data-id="{{id}}"{{!
136 }} data-type="{{type}}"{{!
137 }} data-status="{{status}}"{{!
138 }}>
139 <td>{{typename}}</td>
430241eb 140 <td>{{#userdate}} {{timecreated}}, {{#str}} strftimedatetime {{/str}} {{/userdate}}</td>
373a09a8 141 <td><a href="{{requestedbyuser.profileurl}}" title="{{#str}}viewprofile{{/str}}">{{requestedbyuser.fullname}}</a></td>
5efc1f9e 142 <td>
3f2c68f1 143 <span class="badge {{statuslabelclass}}" title="{{statuslabeltitle}}">{{statuslabel}}</span>
5efc1f9e
DM
144 </td>
145 <td>{{comments}}</td>
146 <td>
147 {{#actions}}
148 {{> core/action_menu}}
149 {{/actions}}
150 </td>
151 </tr>
152 {{/requests}}
153 {{^requests}}
154 <tr>
155 <td class="text-muted" colspan="5">
156 {{#str}}nopersonaldatarequests, tool_dataprivacy{{/str}}
157 </td>
158 </tr>
159 {{/requests}}
160 </tbody>
161 </table>
162</div>
163
164{{#js}}
165// Initialise the JS.
166require(['tool_dataprivacy/myrequestactions'], function(ActionsMod) {
167 ActionsMod.init();
168});
169{{/js}}