{{!
    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_flexsections/local/content/movesection_one

    Displays the target for section moving.

    Example context (json):
    {
        "title": "General",
        "id": 42,
        "number": 1,
        "sectionurl": "#",
        "indexcollapsed": 0,
        "testingonly-make-mustache-lint-happy": 1
    }

}}
{{#testingonly-make-mustache-lint-happy}}
<ul>
{{/testingonly-make-mustache-lint-happy}}

{{#number}}
    {{^singlesection}}
        <li>
            <a href="#{{id}}"
               class="collapse-list-link text-truncate"
               data-for="section"
               data-before="{{id}}"
               data-number="{{number}}"
               data-parentid="{{parentid}}"
               data-parents="{{parents}}"
               data-after="{{aftersectionid}}"
            >
                {{#str}} movebeforesection, format_flexsections, {{{title}}} {{/str}}
            </a>
        </li>
    {{/singlesection}}
    <li class="collapse-list-item d-flex p-0" id="movemodalsection{{number}}">
        {{^singlesection}}
        <a data-toggle="collapse"
           href="#movemodalcollapse{{number}}"
           aria-expanded="{{#contentcollapsed}}false{{/contentcollapsed}}{{^contentcollapsed}}true{{/contentcollapsed}}"
           aria-controls="movemodalcollapse{{number}}"
           class="collapse-list-link icons-collapse-expand {{#contentcollapsed}}collapsed{{/contentcollapsed}}"
        >
                <span class="collapsed-icon icon-no-margin mr-1"
                      data-toggle="tooltip" title="{{#str}} expand, core {{/str}}">
                    {{#pix}} t/collapsed, core {{/pix}}
                    <span class="sr-only">{{#str}} expand, core {{/str}}</span>
                </span>
            <span class="expanded-icon icon-no-margin mr-1"
                  data-toggle="tooltip" title="{{#str}} collapse, core {{/str}}">
                    {{#pix}} t/expanded, core {{/pix}}
                <span class="sr-only">{{#str}} collapse, core {{/str}}</span>
                </span>
        </a>
        {{/singlesection}}
        {{{title}}}
    </li>
    <li id="movemodalcollapse{{number}}"
         class="collapse-list-item-content collapse {{^contentcollapsed}}show{{/contentcollapsed}} pl-3"
         aria-labelledby="movemodalsection{{number}}"
    >
        <ul class="unlist">
            {{#haschildren}}
                {{#children}}
                        {{> format_flexsections/local/content/movesection_one }}
                {{/children}}
            {{/haschildren}}
            <li>
                <a href="#-{{id}}"
                   class="collapse-list-link text-truncate"
                   data-for="section"
                   data-before="0"
                   data-number="{{number}}"
                   data-parentid="{{id}}"
                   data-parents="{{parents}},{{id}}"
                   data-after="{{lastchildid}}"
                >
                    {{#haschildren}}
                        {{#str}} moveendofsection, format_flexsections, {{{title}}} {{/str}}
                    {{/haschildren}}
                    {{^haschildren}}
                        {{#str}} moveassubsection, format_flexsections, {{{title}}} {{/str}}
                    {{/haschildren}}
                </a>
            </li>
        </ul>
    </li>
{{/number}}

{{#testingonly-make-mustache-lint-happy}}
</ul>
{{/testingonly-make-mustache-lint-happy}}
