{{!
    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/profile_list_courses

    Example context (json):
    {
        "url": "https://example.com/course/view.php?id=2",
        "course": {
            "fullname": "Introduction to Programming"
        },
        "matriculastatus": "<span class=\"badge badge-success\">Enrolled</span>",
        "rolehtml": "<span class=\"badge badge-secondary\">Student</span>",
        "date": "Enrolled on 18 June 2026",
        "expirationend": "Enrollment expires on 31 December 2026"
    }
}}

<div class="kopere-profile-course-item mb-3 p-2 border rounded">
    <div class="d-flex justify-content-between align-items-center flex-wrap">
        <div class="course-name font-weight-bold">
            <a href="{{{url}}}">{{course.fullname}}</a>
        </div>
        <div class="course-status">
            {{{matriculastatus}}}
        </div>
    </div>
    <div class="d-flex justify-content-between align-items-center flex-wrap mt-1">
        <div class="course-roles small">
            {{{rolehtml}}}
        </div>
        <div class="course-date small text-muted">
            {{date}}
        </div>
    </div>
    <div class="course-expiry small text-muted mt-1">
        {{{expirationend}}}
    </div>
</div>
