MDL-64506 templates: BS2 pull-x -> BS4 float-x
[moodle.git] / admin / tool / dataprivacy / templates / data_deletion.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_deletion
20     Data deletion page.
22     Classes required for JS:
23     * none
25     Data attributes required for JS:
26     * none
28     Context variables required for this template:
29     * filter - The context data for single_select element that has the options for the table filter.
30     * expiredcontexts - The HTML for the table of expired contexts.
32     Example context (json):
33     {
34         "filter": {
35             "name": "filter",
36             "method": "get",
37             "action": "#",
38             "classes": "singleselect",
39             "label": "",
40             "disabled": false,
41             "title": null,
42             "formid": "single_select_f5ac5e42bb035319",
43             "id": "single_select5ac5e42bb035320",
44             "params":[],
45             "options":[
46                 {"value": 50, "name": "Course", "selected": true, "optgroup": false},
47                 {"value": 70, "name": "Activities and resources", "selected":false, "optgroup": false},
48                 {"value": 80, "name": "Blocks", "selected": false, "optgroup": false}
49             ],
50             "labelattributes": [],
51             "helpicon": false
52         },
53         "expiredcontexts": "<table class='table'><tbody><tr><td>This is the table that will contain the list of expired contexts</td></tr></tbody></table>"
54     }
55 }}
56 <div class="container-fluid" data-region="data-deletion">
57     <div class="row" data-region="top-nav">
58         <div class="alert alert-info">
59             {{#str}}datadeletionpagehelp, tool_dataprivacy{{/str}}
60         </div>
61         <div class="float-left">
62             {{#filter}}
63                 {{> core/single_select}}
64             {{/filter}}
65         </div>
66         {{#existingcontexts}}
67             <div class="float-right">
68                 <button data-action="markfordeletion" class="btn btn-secondary">{{#str}}deleteselected, moodle{{/str}}</button>
69             </div>
70         {{/existingcontexts}}
71     </div>
72     <div class="row mt-1 mb-1" data-region="expired-contexts-table">
73         {{{expiredcontexts}}}
74     </div>
75     <div class="row" data-region="bottom-nav">
76         {{#existingcontexts}}
77             <div class="float-right">
78                 <button data-action="markfordeletion" class="btn btn-secondary">{{#str}}deleteselected, moodle{{/str}}</button>
79             </div>
80         {{/existingcontexts}}
81     </div>
82 </div>
83 {{#js}}
84 // Initialise the JS.
85 require(['tool_dataprivacy/data_deletion'], function(DataDeletion) {
86     new DataDeletion();
87 });
88 {{/js}}