{{!
    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 core_courseformat/local/content/section/header

    Displays a course section header.

    Example context (json):
    {
        "id": 123,
        "name": "Section title",
        "title": "<a href=\"http://moodle/course/view.php?id=5#section-0\">Section title</a>",
        "url": "#",
        "headerdisplaymultipage": true,
        "editing": 0
    }
}}
{{#sitehome}}
    <h2 class="sectionid-{{id}}-title sectionname">
        {{{title}}}
    </h2>
{{/sitehome}}
{{^sitehome}}
    <div class="d-flex align-items-center justify-content-start position-relative w-100">
        <a role="button" data-toggle="collapse"
           href="#coursecontentcollapse{{num}}"
           id="collapssesection{{num}}"
           aria-expanded="{{^contentcollapsed}}true{{/contentcollapsed}}{{#contentcollapsed}}false{{/contentcollapsed}}"
           aria-controls="coursecontentcollapse{{num}}"
           class="btn btn-icon m-0 icons-collapse-expand justify-content-center
               {{^editing}} stretched-link {{/editing}}
               {{#contentcollapsed}} collapsed {{/contentcollapsed}}"
           aria-label="{{title}}">
        <span class="expanded-icon rui-icon-no-margin p-2" title="{{#str}} collapse, core {{/str}}">
            {{#pix}} t/expandedchevron, core {{/pix}}
        </span>
            <span class="collapsed-icon rui-icon-no-margin m-0" title="{{#str}} expand, core {{/str}}">
            <span class="dir-rtl-hide">{{#pix}} t/collapsedchevron, core {{/pix}}</span>
            <span class="dir-ltr-hide">{{#pix}} t/collapsedchevron_rtl, core {{/pix}}</span>
        </span>
        </a>
        <h3 class="sectionid-{{id}}-title sectionname course-content-item d-flex align-self-center align-items-center mb-0"
            id="coursecontentsection{{num}}" data-for="section_title" data-id="{{id}}" data-number="{{num}}">
            {{^issectionzero}}
                {{>format_tiles/local/content/section-tiles-image}}
            {{/issectionzero}}
            <span>{{{title}}}</span>
        </h3>
    </div>
{{/sitehome}}
