{{!
    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 quiz_archiver/overview

    Template purpose and description.

    Example context (json):
    {
        "id":"60",
        "jobid":"32979c0a-2b97-11ee-b5db-0242ac150004",
        "status":"FINISHED",
        "status_display_args": {
            "color":"success",
            "text":"Finished"
        },
        "timecreated":"1690363888",
        "timemodified":"1690364031",
        "user":{
          "id":"2",
          "firstname":"Admin",
          "lastname":"User",
          "username":"admin"
        },
        "course":{
          "id":"31",
          "name":"Example Moodle Course for Quiz Archiver"
        },
        "quiz":{
          "id":"36",
          "cmid":"108",
          "name":"Example Quiz"
        },
        "archiveContentsTable": "{...}"
    }
}}

<h1>{{#str}} inspect_archive, quiz_archiver {{/str}}</h1>

<div style="max-width: 800px;">
    <table class="table">
        <tr>
            <td class="border-top-0">{{#str}} jobid, quiz_archiver {{/str}}</td>
            <td class="border-top-0">{{jobid}}</td>
        </tr>
        <tr>
            <td>{{#str}} status {{/str}}</td>
            <td>
                <span
                        class="badge badge-{{status_display_args.color}}"
                        {{! Remove data-toggle and data-placement after Moodle 4.5 (LTS) deprecation }}
                        data-toggle="tooltip"
                        data-placement="top"
                        data-bs-toggle="tooltip"
                        data-bs-placement="top"
                        title="{{status_display_args.help}}"
                >
                    {{status_display_args.text}}
                </span>
            </td>
        </tr>
        <tr>
            <td>{{#str}} course {{/str}}</td>
            <td>
                <a href="{{{courseurl}}}" target="_blank">
                    {{course.name}}
                </a>
            </td>
        </tr>
        <tr>
            <td>{{#str}} modulename, mod_quiz {{/str}}</td>
            <td>
                <a href="{{{quizurl}}}" target="_blank">
                    {{quiz.name}}
                </a>
            </td>
        </tr>
        <tr>
            <td>{{#str}} user {{/str}}</td>
            <td>
                <a href="{{{userurl}}}" target="_blank">
                    {{user.firstname}} {{user.lastname}} ({{user.username}})
                </a>
            </td>
        </tr>
        <tr>
            <td>{{#str}} timecreated {{/str}}</td>
            <td>{{#userdate}} {{timecreated}}, {{#str}} strftimedatetimeaccurate, core_langconfig {{/str}} {{/userdate}}</td>
        </tr>
        <tr>
            <td>{{#str}} timemodified, reportbuilder {{/str}} </td>
            <td>{{#userdate}} {{timemodified}}, {{#str}} strftimedatetimeaccurate, core_langconfig {{/str}} {{/userdate}}</td>
        </tr>
        <tr>
            <td style="border: none;"></td>
            <td style="border: none;">
                <a href="{{{backurl}}}" class="btn btn-primary" role="button">{{#str}} back_to_overview, quiz_archiver {{/str}}</a>
            </td>
        </tr>
    </table>
</div>

<h2>{{#str}} contents, quiz_archiver {{/str}}</h2>
<p>{{#str}} archive_contents_table_description, quiz_archiver {{/str}}</p>

<p>
    <a href="{{{attachmentstyleurl}}}" class="btn btn-outline-primary btn-sm" role="button">
        {{attachmentstyletext}}
    </a>
</p>
<div class="quiz_archiver-archive-contents-table">
    {{{archiveContentsTable}}}
</div>

<div class="text-center">
    <a href="{{{backurl}}}" class="btn btn-primary mt-2" role="button">{{#str}} back_to_overview, quiz_archiver {{/str}}</a>
</div>
