{#
/*
 * Copyright © ProgramCMS. All rights reserved.
 * See COPYING.txt for license details.
 *
 * Developed by Mohamed EL QUCHIRI <elquchiri@gmail.com>
 */
#}
<fieldset class="collapser" id="collapser-{{ block.getName() }}"
        {% if block.hasDisplay() and not block.getDisplay() %}
            style="display: none"
        {% endif %}
     data-controller="collapser">
    {% if block.hasLabel() and block.getLabel() is not empty %}
        <a class="collapser-label open"
           data-action="collapser#collapserClick"
           {% if block.hasCollapse() and block.getCollapse() %}data-bs-toggle="collapse"{% endif %}
           href="#{{ block.getName() }}"
           role="button"
           aria-expanded="false" aria-controls="{{ block.getName() }}">
            {{ block.getLabel() }}
        </a>
    {% endif %}
    <div class="collapse show"
         id="{{ block.getName() }}_panel">
        {% if block.hasLabel() %}
            <div class="collapser-container">
        {% endif %}

        {% for element in block.getChildBlocks() %}
            {{ element.toHtml()|raw }}
        {% endfor %}

        {% if block.hasLabel() %}
            </div>
        {% endif %}
    </div>
</fieldset>