{{!
    This file is part of mod_openbook for 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 mod_openbook/overview

    Openbook resource folder's overrides template.

    The purpose of this template is to the contents of the overrides.

    Example context (json):
    {
        "isteacher": true,
        "showapprovalrequired": true,
        "viewall_approvalneeded_url": "https://example.com/mod/openbook/approvalneeded.php",
        "myfilesform": "<form>...teacher files form...</form>",
        "filesarepersonal": "Yes",
        "obtainteacherapproval": "Yes",
        "obtainstudentapprovaltitle": "Student approval required",
        "obtainstudentapproval": "No",
        "studentcount": 25,
        "allfiles_empty": false,
        "allfiles_url": "https://example.com/mod/openbook/files.php",
        "studentfilescount": 17,
        "approvalrequiredcount": 3,
        "showteacherfiles": true,
        "teacherfilescount": 3
    }
}}
{{#isteacher}}
    {{#showapprovalrequired}}
        <a href="{{viewall_approvalneeded_url}}" class="btn btn-primary">{{#str}}giveapproval,openbook{{/str}}</a>
    {{/showapprovalrequired}}
{{/isteacher}}
{{^isteacher}}
    {{{myfilesform}}}
{{/isteacher}}
<div class="py-3">
    {{#isteacher}}
        <h3>{{#str}}overview,openbook{{/str}}</h3>

    {{/isteacher}}
    <table class="table table-striped w-100">
        {{#isteacher}}
            <tr>
                <th>{{#str}}filesarepersonal,openbook{{/str}}</th>
                <td>{{filesarepersonal}}</td>
            </tr>
            <tr>
                <th>{{#str}}obtainteacherapproval,openbook{{/str}}</th>
                <td>{{obtainteacherapproval}}</td>
            </tr>
            <tr>
                <th>{{obtainstudentapprovaltitle}}</th>
                <td>{{obtainstudentapproval}}</td>
            </tr>
            <tr>
                <th>{{#str}}participants{{/str}}</th>
                <td>{{studentcount}}</td>
            </tr>
            <tr>
                <th>{{#str}}submittedbystudents,openbook{{/str}}</th>
                <td>{{^allfiles_empty}}<a href="{{allfiles_url}}">{{studentfilescount}}</a>{{/allfiles_empty}}{{#allfiles_empty}}0{{/allfiles_empty}}</td>
            </tr>
            {{#showapprovalrequired}}
                <tr>
                    <th>{{#str}}approval_required,openbook{{/str}}</th>
                    <td><a href="{{viewall_approvalneeded_url}}">{{approvalrequiredcount}}</a></td>
                </tr>
            {{/showapprovalrequired}}
            {{#showteacherfiles}}
            <tr>
                <th>{{#str}}submittedbyteachers,openbook{{/str}}</th>
                <td>{{teacherfilescount}}</td>
            </tr>
            {{/showteacherfiles}}
        {{/isteacher}}
    </table>
</div>
{{#isteacher}}
    {{{myfilesform}}}
{{/isteacher}}