{{!
    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_topcoll/section

    Collapsed Topics section template.

    Context variables required for this template:
    * contentaria - Add ARIA attribute to section.
    * cscml - Course section course module list.
    * heading - The heading.
    * horizontalclass - Additional classes used when the format has a horizontal layout.
    * horizontalwidth - Horizontal layout width.
    * leftcontent - Right column content.
    * nomtore - No mobile / tablet or editing.
    * rightcontent - Right column content.
    * rtl - Right to left?
    * sectionavailability - Section availability.
    * sectionid - Section identification.
    * sectionno - Section number.
    * sectionpage - On a section page.
    * sectionreturn - Section return.
    * sectionstyle - Section style.
    * sectionsummary - Section summary.
    * sectionsummarywhencollapsed - Show the section summary when collapsed.
    * toggleiconset - Toggle icon set.
    * toggleiconsize - Toggle icon size.
    * toggleopen - Toggle is open.
    * usereditingicon - User editing icon.
    * usereditingtitle - User editing title.
    * usereditingurl - User editing URL.

    Example context (json):
    {
        "contentaria": true,
        "cscml": "",
        "heading": '<h3 id="sectionid-124-title" class="section-title">Section 1</h3>',
        "horizontalclass": "col-lg-3",
        "horizontalwidth": "100",
        "leftcontent": "",
        "nomtore": true,
        "rightcontent": "",
        "rtl": false,
        "sectionavailability": '<div class="section_availability"><div class="availabilityinfo ishidden"><span class="badge badge-info">Not available</span></div></div>',
        "sectionid": "124",
        "sectionno": "1",
        "sectionpage": false,
        "sectionreturn": "1",
        "sectionstyle": "",
        "sectionsummary": "",
        "sectionsummarywhencollapsed": false,
        "toggleiconset": "arrow",
        "toggleiconsize": "tc-medium",
        "toggleopen": true,
        "usereditingicon": "",
        "usereditingtitle": "",
        "usereditingurl": ""
    }
}}


<li id="section-{{sectionno}}" class="section main clearfix{{#sectionstyle}} {{sectionstyle}}{{/sectionstyle}}{{#horizontalclass}} {{horizontalclass}}{{/horizontalclass}}"{{#horizontalwidth}} style="width: {{horizontalwidth}}%;"{{/horizontalwidth}} role="region" aria-labeled-by="sectionid-{{sectionid}}-title" data-sectionid="{{sectionno}}"{{#sectionreturn}} data-sectionreturnid="{{sectionreturn}}"{{/sectionreturn}}>
{{#nomtore}}
    {{^rtl}}
    <div class="left side">{{{leftcontent}}}</div>
    {{/rtl}}
    {{#rtl}}
    <div class="right side">{{{rightcontent}}}</div>
    {{/rtl}}
{{/nomtore}}
    <div class="content"{{#contentaria}} aria-live="polite"{{/contentaria}}>
        {{^sectionpage}}
        <div id="toggle-{{sectionno}}" class="sectionhead toggle toggle-{{toggleiconset}}" tabindex="0">
            <span class="the_toggle {{#toggleopen}}toggle_open{{/toggleopen}}{{^toggleopen}}toggle_closed{{/toggleopen}} {{toggleiconsize}}" role="button" aria-expanded="{{#toggleopen}}true{{/toggleopen}}{{^toggleopen}}false{{/toggleopen}}" aria-controls="toggledsection-{{sectionno}}">
                {{{heading}}}
                {{{sectionavailability}}}
            </span>
        </div>
        {{#sectionsummarywhencollapsed}}
        {{{sectionsummary}}}
        {{/sectionsummarywhencollapsed}}
        <div id="toggledsection-{{sectionno}}" class="sectionbody toggledsection{{#toggleopen}} sectionopen{{/toggleopen}}">
            {{^sectionsummarywhencollapsed}}
            {{{sectionsummary}}}
            {{/sectionsummarywhencollapsed}}
            {{#usereditingtitle}}<span class="hidden" aria-hidden="true">{{usereditingtitle}}</span>{{/usereditingtitle}}
            {{#usereditingurl}}<a href="{{{usereditingurl}}}" title="{{#str}}editsection, format_topcoll{{/str}}">{{{usereditingicon}}}</a>{{/usereditingurl}}
            {{{cscml}}}
        </div>
        {{/sectionpage}}
        {{#sectionpage}}
            {{{heading}}}
            {{{sectionavailability}}}
            <div class="summary">
                {{{summary}}}
                {{#usereditingurl}}<a href="{{{usereditingurl}}}" title="{{#str}}editsection, format_topcoll{{/str}}">{{{usereditingicon}}}</a>{{/usereditingurl}}
            </div>
            {{{cscml}}}
        {{/sectionpage}}
    </div>
{{#nomtore}}
    {{^rtl}}
    <div class="right side">{{{rightcontent}}}</div>
    {{/rtl}}
    {{#rtl}}
    <div class="left side">{{{leftcontent}}}</div>
    {{/rtl}}
{{/nomtore}}
</li>
