{% form_theme form _self %}

{%- if false -%}{# predefine blocks without immediately rendering them #}
    {% block _form_configuration_dimensionsets_entry_rows %}
        {{ form_row(form.title) }}
        {{ form_row(form.group) }}
        <div class="row">
            <div class="col-xs-3" style="width:auto; padding-right:0;">
                {{ form_label(form.extent) }}
            </div>
            <div class="col-xs-9" style="width:70%; padding-left:0;">
                <input data-name="extentDisplay" type="text" readonly="readonly" disabled="disabled" class="input" />
                <div class="mb-slider" style="margin: 0.5em 0;"></div>
                {{ form_widget(form.extent) }}
            </div>
        </div>
    {% endblock %}

    {% block _form_configuration_dimensionsets_entry_row %}
        <div class="collectionItem">
          {% if form.parent and 'allow_delete' in form.parent.vars | keys and form.parent.vars['allow_delete'] %}
            <a href="#delete" class="collectionRemove hover-highlight-effect iconRemove"></a>
          {% endif %}
          {{ block('_form_configuration_dimensionsets_entry_rows') }}
        </div>
    {% endblock %}
{%- endif -%}

<div class="elementForm">
    {{ form_row(form.title) }}
    {{ form_rest(form.configuration) }}
    {% if form.configuration.dimensionsets.vars.prototype is not defined or (not form.configuration.dimensionsets.vars.prototype.group.vars.choices | length) %}
        <p>{{ "mb.wms.dimensionsets.no_dimension" | trans }}</p>
    {% endif %}
</div>
<script type="text/javascript" src="{{ asset('bundles/mapbenderwms/mapbender.wms.dimension.js') }}"></script>
<script type="text/javascript" src="{{ asset('bundles/mapbenderwms/backend/dimensionshandler.js') }}"></script>
