{{!
    This file is part of 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 format_edwiservideoformat/local/content

    Displays the complete course format.

    Example context (json):
    {
        "initialsection": {
            "num": 0,
            "id": 34,
            "cmlist": {
                "cms": [
                    {
                        "cmitem": {
                            "cmformat": {
                                "cmname": "<a class=\"aalink\" href=\"#\"><span class=\"instancename\">Forum example</span></a>",
                                "hasname": "true"
                            },
                            "id": 3,
                            "module": "forum",
                            "extraclasses": "newmessages"
                        }
                    }
                ],
                "hascms": true
            },
            "iscurrent": true,
            "section": 1,
            "summary": {
                "summarytext": "Summary text!"
            }
        },
        "course": {
            "id": 2,
            "fullname": "Course name example",
            "shortname": "Course shortname example",
            "description": "Course description text"
        },
        "numsections": 5,
        "format": "edwiservideoformat",
        "title": "Edwiser Video Format",
        "hasnavigation": true,
        "sectionnavigation": {
            "hasprevious": true,
            "previousurl": "#",
            "larrow": "&#x25C4;",
            "previousname": "Section 3",
            "hasnext": true,
            "rarrow": "&#x25BA;",
            "nexturl": "#",
            "nextname": "Section 5"
        },
        "sectionselector": {
            "hasprevious": true,
            "previousurl": "#",
            "larrow": "&#x25C4;",
            "previousname": "Section 3",
            "hasnext": true,
            "rarrow": "&#x25BA;",
            "nexturl": "#",
            "nextname": "Section 5",
            "active": "Section 4"
        },
        "sectionreturn": 1,
        "singlesection": {
            "num": 1,
            "id": 35,
            "header": {
                "name": "Section title",
                "url": "#"
            },
            "cmlist": {
                "cms": [
                    {
                        "cmitem": {
                            "cmformat": {
                                "cmname": "<a class=\"aalink\" href=\"#\"><span class=\"instancename\">Another forum</span></a>",
                                "hasname": "true"
                            },
                            "id": 3,
                            "module": "forum",
                            "extraclasses": "newmessages"
                        }
                    }
                ],
                "hascms": true
            },
            "iscurrent": true,
            "section": 1,
            "summary": {
                "summarytext": "Summary text!"
            }
        }
    }
}}

{{#header}}
{{> format_edwiservideoformat/local/optional_secheader }}
{{/header}}

{{^mod_edwVAct}}
    <div class="alert alert-info alert-dismissible fade show alerthandler alert-danger" role="alert">
    {{#str}} modactivitynotfound, format_edwiservideoformat {{/str}}
    </div>
{{/mod_edwVAct}}

{{#licensenotice}}
    {{{licensenotice}}}
{{/licensenotice}}
<div id="course-format-{{uniqid}}" class="edwiservideoformat-course-content">
    {{#hasmoremenu}}
        {{#moremenu}}
            {{> format_edwiservideoformat/local/moremenu }}
        {{/moremenu}}
    {{/hasmoremenu}}
    {{#showcoursedescription}}
        {{#course.description}}
        <div class="course-description generalsectioninfo">
            <div class="read-more-target coursesummary">{{{course.description}}}</div>
            <a id="readmorebtn" class="d-none readbtn">{{#str}} showmore, format_edwiservideoformat {{/str}}</a>
            <a id="readlessbtn" class="d-none readbtn">{{#str}} showless, format_edwiservideoformat {{/str}}</a>
        </div>
        {{/course.description}}
    {{/showcoursedescription}}
    <h2 class="accesshide">{{{title}}}</h2>
    {{{completionhelp}}}
    <ul class="{{format}} section-list" data-for="course_sectionlist">
        {{#initialsection}}
            {{$ format_edwiservideoformat/local/content/section }}
                {{> format_edwiservideoformat/local/content/section }}
            {{/ format_edwiservideoformat/local/content/section }}
        {{/initialsection}}
        {{#sections}}
            {{$ format_edwiservideoformat/local/content/section }}
                {{> format_edwiservideoformat/local/content/section }}
            {{/ format_edwiservideoformat/local/content/section }}
        {{/sections}}
    </ul>
    {{#hasnavigation}}
    <div class="single-section">
        {{#sectionnavigation}}
            {{$ core_courseformat/local/content/sectionnavigation }}
                {{> core_courseformat/local/content/sectionnavigation }}
            {{/ core_courseformat/local/content/sectionnavigation }}
        {{/sectionnavigation}}
        <ul class="{{format}} section-list">
        {{#singlesection}}
            {{$ format_edwiservideoformat/local/content/section }}
                {{> format_edwiservideoformat/local/content/section }}
            {{/ format_edwiservideoformat/local/content/section }}
        {{/singlesection}}
        </ul>
        {{#sectionselector}}
            {{$ core_courseformat/local/content/sectionselector }}
                {{> core_courseformat/local/content/sectionselector }}
            {{/ core_courseformat/local/content/sectionselector }}
        {{/sectionselector}}
    </div>
    {{/hasnavigation}}
    {{#numsections}}
        {{^singlesection}}
            {{$ core_courseformat/local/content/addsection}}
                {{> core_courseformat/local/content/addsection}}
            {{/ core_courseformat/local/content/addsection}}
        {{/singlesection}}
    {{/numsections}}
    {{#bulkedittools}}
        {{$ core_courseformat/local/content/bulkedittools}}
            {{> core_courseformat/local/content/bulkedittools}}
        {{/ core_courseformat/local/content/bulkedittools}}
    {{/bulkedittools}}
</div>
{{#js}}
    require(['core_courseformat/local/content', 'format_edwiservideoformat/common'], function(component, Common) {
        component.init('page', {}, {{sectionreturn}});
        Common.init();
    });
{{/js}}
{{#showtypeform}}
    {{> format_edwiservideoformat/typeform_integration }}
{{/showtypeform}}
