{{!
    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_remuiformat/list_sections


    Example context (json):
    {
      "sections": [
         {
            "index": "1",
            "title": "Section Title",
            "singlepageurl": "Single Page URL",
            "hiddenmessage": "Hidden message",
            "hidden": "1/0",
            "summary": "Summary",
            "activityinfostring": "2 Files, 2 Quizzes"
            "sectionactivities" [
               {
               }
            ]
         }
      ]
   }
}}

{{#addsection}}
<li id="{{divid}}" class="card clearfix mb-4 m-b-2" role="region" style="">
    <div class="content card-block px-15 px-3 py-10 py-2 remui-list-content-border d-flex align-items-center">
        {{#numsections}}
            <a href="{{{addurl}}}" class="{{addurlclass}}">{{{addicon}}} {{{straddsection}}}</a>

            {{#strremovesection}}
            <a href="{{{removeurl}}}" class="{{removeurlclass}}">{{{removeicon}}} {{{strremovesection}}}</a>
            {{/strremovesection}}
        {{/numsections}}

        {{^numsections}}
            <a href="{{{url}}}" data-add-sections="{{{straddsections}}}">{{{icon}}} {{{straddsections}}}</a>
        {{/numsections}}
    </div>
</li>
{{/addsection}}

{{^addsection}}
<li id="section-{{{index}}}" class="card section main {{#collapsed}}collapsed{{/collapsed}} clearfix mb-4 m-b-2" role="region" aria-labelledby="section-{{index}} .sectionname a:not(.quickeditlink)">
    <div class="content card-block px-15 px-3 py-10 py-2 remui-list-content-border" aria-labelledby="section-{{index}} .sectionname a:not(.quickeditlink)">
        {{#highlighted}}<div class="highlight bg-primary"></div>{{/highlighted}}
        <div class="d-block">
            <div class="left side">
                {{{ leftside }}}
            </div>
            <div class="right side d-flex">
                <button class="toggle-icon fa fa-angle-right"></button>
                {{{ addnewsection }}}
                {{{ optionmenu }}}
            </div>
            {{{leftside}}}
        </div>
        <h4 class="sectionname card-title">
            {{#editing}}
                {{{ title }}}
            {{/editing}}
            {{^editing}}
                <a class="panel-title p-0" href="#sectionwrapper-{{{index}}}" aria-controls="sectionwrapper-{{{index}}}">{{{ title }}}
            {{/editing}}
            {{^editing}}
                {{#progressinfo}}
                    {{#completed}}
                <!-- Default checked -->
                    <div class="float-right">
                        <i class="fa fas fa-check-square text-success"></i>
                        <!-- {{{ progress }}} -->
                    </div>
                    {{/completed}}
                {{/progressinfo}}
                </a>
            {{/editing}}
        </h4>
        {{{ hiddenmessage }}}
        <div class="summary card-text">{{{summary}}}</div>
        <div class="section_availability badge badge-pill badge-info mb-10">{{{availability}}}</div>
        <div class="section-summary-activities mdl-right mb-10">{{{activityinfostring}}}</div>
        <div class="px-15 px-3 py-10 py-2 card-footer text-muted border-top" aria-labelledby="section-{{index}} .sectionname a:not(.quickeditlink)" {{#collapsed}}style="display: none;"{{/collapsed}}>
            {{{sectionactivities}}}
        </div>
    </div>
</li>
{{/addsection}}
