{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more comments.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
}}
{{!
    @template tool_dataprivacy/data_deletion

    Data deletion page.

    Classes required for JS:
    * none

    Data attributes required for JS:
    * none

    Context variables required for this template:
    * filter - The context data for single_select element that has the options for the table filter.
    * expiredcontexts - The HTML for the table of expired contexts.

    Example context (json):
    {
        "filter": {
            "name": "filter",
            "method": "get",
            "action": "#",
            "classes": "singleselect",
            "label": "",
            "disabled": false,
            "title": null,
            "formid": "single_select_f5ac5e42bb035319",
            "id": "single_select5ac5e42bb035320",
            "params":[],
            "options":[
                {"value": 50, "name": "Course", "selected": true, "optgroup": false},
                {"value": 70, "name": "Activities and resources", "selected":false, "optgroup": false},
                {"value": 80, "name": "Blocks", "selected": false, "optgroup": false}
            ],
            "labelattributes": [],
            "helpicon": false
        },
        "expiredcontexts": "<table class='table'><thead><tr><th class='header c0' scope='col'>Name<div class='commands'><a title='Hide Name' aria-expanded='true' aria-controls='expired-contexts-table_r0_c0 expired-contexts-table_r1_c0 expired-contexts-table_r2_c0 expired-contexts-table_r3_c0 expired-contexts-table_r4_c0 expired-contexts-table_r5_c0 expired-contexts-table_r6_c0 expired-contexts-table_r7_c0 expired-contexts-table_r8_c0 expired-contexts-table_r9_c0 expired-contexts-table_r10_c0 expired-contexts-table_r11_c0 expired-contexts-table_r12_c0 expired-contexts-table_r13_c0 expired-contexts-table_r14_c0 expired-contexts-table_r15_c0 expired-contexts-table_r16_c0 expired-contexts-table_r17_c0 expired-contexts-table_r18_c0 expired-contexts-table_r19_c0' href='#?thide=name'><i class='icon fa fa-minus fa-fw ' aria-hidden='true' title='Hide' aria-label='Hide'></i></a></div>                    </th>                    <th class='header c1' scope='col'>Information<div class='commands'><a title='Hide Information' aria-expanded='true' aria-controls='expired-contexts-table_r0_c1 expired-contexts-table_r1_c1 expired-contexts-table_r2_c1 expired-contexts-table_r3_c1 expired-contexts-table_r4_c1 expired-contexts-table_r5_c1 expired-contexts-table_r6_c1 expired-contexts-table_r7_c1 expired-contexts-table_r8_c1 expired-contexts-table_r9_c1 expired-contexts-table_r10_c1 expired-contexts-table_r11_c1 expired-contexts-table_r12_c1 expired-contexts-table_r13_c1 expired-contexts-table_r14_c1 expired-contexts-table_r15_c1 expired-contexts-table_r16_c1 expired-contexts-table_r17_c1 expired-contexts-table_r18_c1 expired-contexts-table_r19_c1'    href='#?thide=info'><i class='icon fa fa-minus fa-fw ' aria-hidden='true' title='Hide' aria-label='Hide'></i></a></div>                    </th>                    <th class='header c2' scope='col'>Purpose<div class='commands'><a title='Hide Purpose' aria-expanded='true' aria-controls='expired-contexts-table_r0_c2 expired-contexts-table_r1_c2 expired-contexts-table_r2_c2 expired-contexts-table_r3_c2 expired-contexts-table_r4_c2 expired-contexts-table_r5_c2 expired-contexts-table_r6_c2 expired-contexts-table_r7_c2 expired-contexts-table_r8_c2 expired-contexts-table_r9_c2 expired-contexts-table_r10_c2 expired-contexts-table_r11_c2 expired-contexts-table_r12_c2 expired-contexts-table_r13_c2 expired-contexts-table_r14_c2 expired-contexts-table_r15_c2 expired-contexts-table_r16_c2 expired-contexts-table_r17_c2 expired-contexts-table_r18_c2 expired-contexts-table_r19_c2'    href='#?thide=purpose'><i class='icon fa fa-minus fa-fw ' aria-hidden='true' title='Hide' aria-label='Hide'></i></a></div>                    </th>                    <th class='header c3' scope='col'>Category<div class='commands'><a title='Hide Category' aria-expanded='true' aria-controls='expired-contexts-table_r0_c3 expired-contexts-table_r1_c3 expired-contexts-table_r2_c3 expired-contexts-table_r3_c3 expired-contexts-table_r4_c3 expired-contexts-table_r5_c3 expired-contexts-table_r6_c3 expired-contexts-table_r7_c3 expired-contexts-table_r8_c3 expired-contexts-table_r9_c3 expired-contexts-table_r10_c3 expired-contexts-table_r11_c3 expired-contexts-table_r12_c3 expired-contexts-table_r13_c3 expired-contexts-table_r14_c3 expired-contexts-table_r15_c3 expired-contexts-table_r16_c3 expired-contexts-table_r17_c3 expired-contexts-table_r18_c3 expired-contexts-table_r19_c3'    href='#?thide=category'><i class='icon fa fa-minus fa-fw ' aria-hidden='true' title='Hide' aria-label='Hide'></i></a></div>                    </th>                    <th class='header c4' scope='col'>Retention period<div class='commands'><a title='Hide Retention period' aria-expanded='true' aria-controls='expired-contexts-table_r0_c4 expired-contexts-table_r1_c4 expired-contexts-table_r2_c4 expired-contexts-table_r3_c4 expired-contexts-table_r4_c4 expired-contexts-table_r5_c4 expired-contexts-table_r6_c4 expired-contexts-table_r7_c4 expired-contexts-table_r8_c4 expired-contexts-table_r9_c4 expired-contexts-table_r10_c4 expired-contexts-table_r11_c4 expired-contexts-table_r12_c4 expired-contexts-table_r13_c4 expired-contexts-table_r14_c4 expired-contexts-table_r15_c4 expired-contexts-table_r16_c4 expired-contexts-table_r17_c4 expired-contexts-table_r18_c4 expired-contexts-table_r19_c4'    href='#?thide=retentionperiod'><i class='icon fa fa-minus fa-fw ' aria-hidden='true' title='Hide' aria-label='Hide'></i></a></div>                    </th>                    <th class='header c5' scope='col'><a href='#?tsort=timecreated'>Expiry<span class='accesshide '>Sort by Expiry Ascending</span></a>  <i class='icon fa fa-sort-asc fa-fw ' aria-hidden='true' title='Ascending'aria-label='Ascending'></i><div class='commands'><a title='Hide Expiry' aria-expanded='true' aria-controls='expired-contexts-table_r0_c5 expired-contexts-table_r1_c5 expired-contexts-table_r2_c5 expired-contexts-table_r3_c5 expired-contexts-table_r4_c5 expired-contexts-table_r5_c5 expired-contexts-table_r6_c5 expired-contexts-table_r7_c5 expired-contexts-table_r8_c5 expired-contexts-table_r9_c5 expired-contexts-table_r10_c5 expired-contexts-table_r11_c5 expired-contexts-table_r12_c5 expired-contexts-table_r13_c5 expired-contexts-table_r14_c5 expired-contexts-table_r15_c5 expired-contexts-table_r16_c5 expired-contexts-table_r17_c5 expired-contexts-table_r18_c5 expired-contexts-table_r19_c5'    href='#?thide=timecreated'><i class='icon fa fa-minus fa-fw ' aria-hidden='true' title='Hide' aria-label='Hide'></i></a></div>                    </th>                    <th class='header c6' scope='col'><input title='Select all' type='checkbox' value='1' name='selectall' checked='checked'><div class='commands'></div>                    </th>                </tr>            </thead>            <tbody>                <tr class='' id='expired-contexts-table_r0'>                    <td class='cell c0' id='expired-contexts-table_r0_c0'><span class='m-r-1'>Miscellaneous / TC 1</span><i class='icon fa fa-info fa-fw ' aria-hidden='true' title='Miscellaneous / System' aria-label='Miscellaneous / System'></i></td>                    <td class='cell c1' id='expired-contexts-table_r0_c1'><span class='m-r-1'>7 children</span><i class='icon fa fa-info fa-fw ' aria-hidden='true' title='Test book, Glossary 1, Assignment 1, Page 1, Small files, Big file 0, Forum' aria-label='Test book, Glossary 1, Assignment 1, Page 1, Small files, Big file 0, Forum'></i></td>                    <td class='cell c2' id='expired-contexts-table_r0_c2'>Default purpose</td>                    <td class='cell c3' id='expired-contexts-table_r0_c3'>Default category</td>                    <td class='cell c4' id='expired-contexts-table_r0_c4'>1 days</td>                    <td class='cell c5' id='expired-contexts-table_r0_c5'>Thursday, 5 April 2018, 10:29 AM</td>                    <td class='cell c6' id='expired-contexts-table_r0_c6'><input type='checkbox' class='usercheckbox' name='expiredcontext_3' checked='true'></td></tr></tbody></table>"
    }
}}
<div class="container-fluid" data-region="data-deletion">
    <div class="row" data-region="top-nav">
        <div class="alert alert-info">
            {{#str}}datadeletionpagehelp, tool_dataprivacy{{/str}}
        </div>
        <div class="pull-left">
            {{#filter}}
                {{> core/single_select}}
            {{/filter}}
        </div>
        {{#existingcontexts}}
            <div class="pull-right">
                <button data-action="markfordeletion" class="btn btn-default">{{#str}}deleteselected, moodle{{/str}}</button>
            </div>
        {{/existingcontexts}}
    </div>
    <div class="row m-t-1 m-b-1" data-region="expired-contexts-table">
        {{{expiredcontexts}}}
    </div>
    <div class="row" data-region="bottom-nav">
        {{#existingcontexts}}
            <div class="pull-right">
                <button data-action="markfordeletion" class="btn btn-default">{{#str}}deleteselected, moodle{{/str}}</button>
            </div>
        {{/existingcontexts}}
    </div>
</div>
{{#js}}
// Initialise the JS.
require(['tool_dataprivacy/data_deletion'], function(DataDeletion) {
    new DataDeletion();
});
{{/js}}
