{{!
    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_single_section

    Displays a single section of the course format.

    Example context (json):
    {
        "singlesection": {
            "num": 1,
            "id": 35,
            "header": {
                "name": "Section title",
                "url": "#"
            },
            "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"
        },
        "currentsection": 1,
        "singlesection": true,
        "hasnavigation": true,
        "sectionnavigation": {
            "hasprevious": true,
            "previousurl": "#",
            "larrow": "&#x25C4;",
            "previousname": "Section 0",
            "hasnext": true,
            "rarrow": "&#x25BA;",
            "nexturl": "#",
            "nextname": "Section 2"
        },
        "sectionselector": {
            "hasprevious": true,
            "previousurl": "#",
            "larrow": "&#x25C4;",
            "previousname": "Section 0",
            "hasnext": true,
            "rarrow": "&#x25BA;",
            "nexturl": "#",
            "nextname": "Section 2",
            "active": "Section 1"
        }
    }
}}

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

<div id="course-format-{{uniqid}}" class="edwiservideoformat-course-content">
    {{#hasmoremenu}}
        {{#moremenu}}
            {{> format_edwiservideoformat/local/moremenu }}
        {{/moremenu}}
    {{/hasmoremenu}}
    {{#showcoursedescription}}
        {{#course.description}}
        <div class="course-description">
            {{{course.description}}}
        </div>
        {{/course.description}}
    {{/showcoursedescription}}
    <h2 class="accesshide">{{{title}}}</h2>
    {{{completionhelp}}}

    {{#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" data-for="course_sectionlist">
        {{#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}}

    {{^hasnavigation}}
    <ul class="{{format}} section-list" data-for="course_sectionlist">
        {{#singlesection}}
            {{$ format_edwiservideoformat/local/content/section }}
                {{> format_edwiservideoformat/local/content/section }}
            {{/ format_edwiservideoformat/local/content/section }}
        {{/singlesection}}
    </ul>
    {{/hasnavigation}}
</div>

{{#js}}
require(['core_courseformat/local/content', 'format_edwiservideoformat/common'], function(component, Common) {
    component.init('page', {}, {{sectionreturn}});
    Common.init();
});
{{/js}}
