{{!
    This file is part of Moodle - https://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 local_kopere_dashboard/permissions_list

    Example context (json):
    {
        "groups": [
            {
                "pluginname": "Kopere Dashboard",
                "items": [
                    {
                        "name": "Manage permissions",
                        "description": "Allows users to manage who can access each Kopere Dashboard area.",
                        "manageurl": "https://moodle.example.com/local/kopere_dashboard/permissions.php?actionform=edit&capability=local%2Fkopere_dashboard%3Amanagepermissions"
                    },
                    {
                        "name": "View audit log",
                        "description": "Allows users to view dashboard audit records.",
                        "manageurl": "https://moodle.example.com/local/kopere_dashboard/permissions.php?actionform=edit&capability=local%2Fkopere_dashboard%3Aviewaudit"
                    }
                ]
            },
            {
                "pluginname": "Recurring payments",
                "items": [
                    {
                        "name": "Manage plans",
                        "description": "Allows users to create plans, assign students and override installment rules.",
                        "manageurl": "https://moodle.example.com/local/kopere_dashboard/permissions.php?actionform=edit&capability=kopere_dashboard%2Frecurringpayments%3Amanageplans"
                    }
                ]
            }
        ]
    }
}}

<div class="alert alert-info" style="margin-bottom: 16px;">
    <div style="margin-top: 8px;">
        {{#str}}permissions_desc, local_kopere_dashboard{{/str}}
    </div>
</div>
{{#groups}}

    <div class="kopere_dashboard-card">

        <h2 class="kopere_dashboard-card-title">{{{pluginname}}}</h2>

        {{#items}}
            <div class="kopere_dashboard-card">
                <h3>{{{name}}}</h3>
                <div class="muted">{{{description}}}</div>

                <div class="mt-4">
                    <a class="btn btn-primary" href="{{{manageurl}}}">
                        {{#str}}permissions_manage, local_kopere_dashboard{{/str}}</a>
                </div>
            </div>
        {{/items}}
    </div>
{{/groups}}
