{{!
    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 format_ludilearn/filename

    Example context (json):
    {}
}}

<div class="ludilearn-content ludilearn-world-{{ world }} card mb-3">
    <div class="card-header">
        <ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
            <li class="nav-item mr-1" role="presentation">
                <a href="{{config.wwwroot}}/course/view.php?id={{ course.id }}">
                <button class="btn btn-primary"
                        id="pills-settings-tab"
                        type="button"
                        role="tab"
                        aria-selected="false">
                    <i class="fa fa-home" style="font-size: 1.5em"></i>
                </button>
                </a>
            </li>
            <li class="nav-item mr-1" role="presentation">
                <button class="btn btn-primary {{^cm }}{{^section}}active{{/section}}{{/ cm }}"
                        id="pills-course-tab"
                        data-bs-toggle="pill"
                        data-bs-target="#pills-course"
                        type="button"
                        role="tab"
                        aria-controls="pills-course"
                        aria-selected="true">
                    {{#str}}course, core{{/str}}
                </button>
            </li>
            {{# section}}
                <li class="nav-item mr-1" role="presentation">
                    <button class="btn btn-primary {{# section}}{{^cm }}active{{/ cm }}{{/section}}"
                            id="pills-lesson-tab"
                            data-bs-toggle="pill"
                            data-bs-target="#pills-lesson"
                            type="button"
                            role="tab"
                            aria-controls="pills-lesson"
                            aria-selected="false">
                        {{#str}}lesson, format_ludilearn{{/str}}
                    </button>
                </li>
            {{/section}}
            {{# cm }}
                <li class="nav-item" role="presentation">
                    <button class="btn btn-primary  {{# cm }} active {{/ cm }}"
                            id="pills-activity-tab"
                            data-bs-toggle="pill"
                            data-bs-target="#pills-activity"
                            type="button"
                            role="tab"
                            aria-controls="pills-activity"
                            aria-selected="false">
                        {{#str}}activity, core{{/str}}
                    </button>
                </li>
            {{/cm}}
            {{# report}}
                <li class="nav-item float-right" role="presentation">
                    <a href="{{config.wwwroot}}/course/format/ludilearn/report.php?id={{ course.id }}&hideheader=true">
                    <button class="btn btn-primary"
                            id="pills-editgameeleements-tab"
                            type="button"
                            role="tab"
                            aria-selected="false">
                        {{#str}}report, format_ludilearn{{/str}}
                    </button>
                    </a>
                </li>
            {{/report}}
            <li class="nav-item ml-auto float-right explanation-li" role="presentation">
                <div class="explanation-button">
                    <img
                         class="explanation"
                         src="{{config.wwwroot}}/course/format/ludilearn/pix/explanation-icon.svg"
                         alt="Button reset user tour">
                </div>
            </li>
        </ul>
        <div class="card-body">
            <div class="tab-content" id="pills-tabContent">
                <div class="tab-pane fade {{^cm }}{{^section}}show active{{/section}}{{/ cm }}" id="pills-course" role="tabpanel" aria-labelledby="pills-course-tab">
                    <div class="row">
                        {{#sections}}
                            <div class="col-6 col-lg-6">
                                {{# score}} {{> format_ludilearn/score/course }} {{/score}}
                                {{# badge}} {{> format_ludilearn/badge/course }} {{/badge}}
                                {{# progress}} {{> format_ludilearn/progress/course }} {{/progress}}
                                {{# avatar}} {{> format_ludilearn/avatar/course }} {{/avatar}}
                                {{# timer}} {{> format_ludilearn/timer/course }} {{/timer}}
                                {{# ranking}} {{> format_ludilearn/ranking/course }} {{/ranking}}
                                {{# nogamified}} {{> format_ludilearn/nogamified/course }} {{/nogamified}}
                            </div>
                        {{/sections}}
                    </div>
                </div>
                {{# section}}
                    <div class="tab-pane fade {{# section}}{{^cm }}show active{{/ cm }}{{/section}}" id="pills-lesson" role="tabpanel" aria-labelledby="pills-lesson-tab">
                        {{# score}} {{> format_ludilearn/score/section }} {{/score}}
                        {{# badge}} {{> format_ludilearn/badge/section }} {{/badge}}
                        {{# progress}} {{> format_ludilearn/progress/section }} {{/progress}}
                        {{# avatar}} {{> format_ludilearn/avatar/section }} {{/avatar}}
                        {{# timer}} {{> format_ludilearn/timer/section }} {{/timer}}
                        {{# ranking}} {{> format_ludilearn/ranking/section }} {{/ranking}}
                        {{# nogamified}} {{> format_ludilearn/nogamified/section }} {{/nogamified}}
                    </div>
                {{/section}}
                {{# cm}}
                    <div class="tab-pane fade {{# cm }}show active{{/cm}}" id="pills-activity" role="tabpanel" aria-labelledby="pills-activity-tab">
                        {{# score}} {{> format_ludilearn/score/cm }} {{/score}}
                        {{# badge}} {{> format_ludilearn/badge/cm }} {{/badge}}
                        {{# progress}} {{> format_ludilearn/progress/cm }} {{/progress}}
                        {{# avatar}} {{> format_ludilearn/avatar/cm }} {{/avatar}}
                        {{# timer}} {{> format_ludilearn/timer/cm }} {{/timer}}
                        {{# ranking}} {{> format_ludilearn/ranking/cm }} {{/ranking}}
                        {{# nogamified}} {{> format_ludilearn/nogamified/cm }} {{/nogamified}}
                    </div>
                {{/cm}}
            </div>
        </div>
    </div>
</div>
