{{!
    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 koperedashboard_contracts/profile_section

    Example context (json):
    {
        "items": [
            {
                "name": "Monthly Tuition Contract (2026)",
                "courseid": 12,
                "courseurl": "https://moodle.example.com/course/view.php?id=12",
                "timeaccepted": "2026-03-01 09:14",
                "readseconds": 47
            },
            {
                "name": "Student Conduct Agreement",
                "courseid": 34,
                "courseurl": "https://moodle.example.com/course/view.php?id=34",
                "timeaccepted": "2026-02-20 18:02",
                "readseconds": 92
            }
        ]
    }
}}

<div class="kopere_dashboard-card" style="margin-top: 16px;">
    {{#items}}
        <div style="padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,.06);">
            <div><strong>{{{name}}}</strong></div>
            <div class="muted">
                <a href="{{{courseurl}}}">Curso #{{{courseid}}}</a> - Assinado em {{{timeaccepted}}} - {{{readseconds}}}
                s
            </div>
            <div style="margin-top: 6px;">
                <a class="btn btn-secondary btn-sm" href="{{{pdfurl}}}" target="_blank">{{#str}}
                    opencontract, koperedashboard_contracts{{/str}}</a>
            </div>
        </div>
    {{/items}}

    {{^items}}
        <div class="muted">{{#str}}nocontracts, koperedashboard_contracts{{/str}}</div>
    {{/items}}
</div>
