{{!
    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 details.

    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/summary

    Summary

    Classes required for JS:

    Data attributes required for JS:

    Context variables required for this template:

    Example context (json):
    {

        "contexts": [
            {
                "contextname": "Site",
                "category":
                {
                    "name": "Test category",
                    "description": "<p>Description for category</p>"
                },
                "purpose":
                {
                    "name": "Test purpose",
                    "description": "<p>Description for purpose</p>",
                    "lawfulbases": "gdpr_art_6_1_c",
                    "sensitivedatareasons": "gdpr_art_9_2_f",
                    "formattedlawfulbases": [
                        {
                            "name": "Lawful base 1(a)",
                            "description": "We need your information"
                        },
                        {
                            "name": "Lawful base 1(b)",
                            "description": "We really do need your information"
                        }
                    ],
                    "formattedsensitivedatareasons": [
                        {
                            "name": "Sensitive data reason number 1",
                            "description": "Number 1"
                        },
                        {
                            "name": "Sensitive data reason number 1",
                            "description": "Number 2"
                        }
                    ],
                    "formattedretentionperiod": "10 Years"
                }
            }
        ]
    }
}}
<h2>{{#str}}dataretentionsummary, tool_dataprivacy{{/str}}</h2>
<p>{{#str}}dataretentionexplanation, tool_dataprivacy{{/str}}</p>
<div>
    {{#contexts}}
        <div class="card mb-3">
            <div class="card-header"><h3>{{contextname}}</h3></div>
            <div class="card-body pl-5 pr-5">

                {{#category.name}}
                <h4>{{#str}}category, tool_dataprivacy{{/str}}</h4>
                <dl>
                    <dt>{{category.name}}</dt>
                    <dd>{{{category.description}}}</dd>
                </dl>
                <hr />
                {{/category.name}}
                <h4>{{#str}}purpose, tool_dataprivacy{{/str}}</h4>
                <dl>
                    <dt>{{purpose.name}}</dt>
                    <dd>{{{purpose.description}}}</dd>
                    <dt>{{#str}}retentionperiod, tool_dataprivacy{{/str}}</dt>
                    <dd>{{purpose.formattedretentionperiod}}</dd>
                </dl>
                {{#purpose.lawfulbases}}
                <table class="table table-bordered">
                    <thead><tr><th colspan="2">{{#str}}lawfulbases, tool_dataprivacy{{/str}}</th></tr></thead>
                    <tbody>
                    {{#purpose.formattedlawfulbases}}
                        <tr>
                            <td>{{name}}</td>
                            <td>{{description}}</td>
                        </tr>
                    {{/purpose.formattedlawfulbases}}
                    </tbody>
                </table>
                {{/purpose.lawfulbases}}
                {{#purpose.sensitivedatareasons}}
                <table class="table table-bordered">
                    <thead><tr><th colspan="2">{{#str}}sensitivedatareasons, tool_dataprivacy{{/str}}</th></tr></thead>
                    <tbody>
                    {{#purpose.formattedsensitivedatareasons}}
                        <tr>
                            <td>{{name}}</td>
                            <td>{{description}}</td>
                        </tr>
                    {{/purpose.formattedsensitivedatareasons}}
                    </tbody>
                </table>
                {{/purpose.sensitivedatareasons}}
            </div>
        </div>
    {{/contexts}}
</div>
