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/data_requests
19
20    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    * newdatarequesturl string The URL pointing to the data request creation page.
30    * datarequests string The HTML of the data requests table.
31
32    Example context (json):
33    {
34        "newdatarequesturl": "#",
35        "datarequests": "<table><tr><td>This is the table where the list of data requests will be rendered</td></tr></table>",
36        "filter": {
37            "action": "#",
38            "filteroptions": [
39                {
40                    "value": "1",
41                    "label": "Option 1"
42                },
43                {
44                    "value": "2",
45                    "label": "Option 2",
46                    "selected": true
47                },
48                {
49                    "value": "3",
50                    "label": "Option 3",
51                    "selected": true
52                }
53            ]
54        }
55    }
56}}
57
58{{#httpsite}}
59    {{> core/notification_warning}}
60{{/httpsite}}
61
62<div data-region="datarequests">
63    <div class="mt-1 mb-1">
64        <div class="float-right">
65            <a href="{{newdatarequesturl}}" class="btn btn-primary" data-action="new-request">
66                {{#str}}newrequest, tool_dataprivacy{{/str}}
67            </a>
68        </div>
69        {{#filter}}
70            {{>tool_dataprivacy/request_filter}}
71        {{/filter}}
72    </div>
73
74    <div class="mt-1 mb-1" data-region="data-requests-table">
75        {{{datarequests}}}
76    </div>
77</div>
78
79{{#js}}
80// Initialise the JS.
81require(['tool_dataprivacy/requestactions'], function(ActionsMod) {
82    new ActionsMod();
83});
84{{/js}}
85