{% import '@bolt/_macro/_buic.twig' as buic %}

{#=== INIT ===========================================================================================================#}

{% set attributes_fieldset = {
    'class':            'form-group',
    'data-bolt-field':  block('fieldset_type'),
    'data-bolt-fconf':  fieldset_conf|default() is iterable ? fieldset_conf|json_encode : null,
    'id':               buid(),
} %}

{% set attributes_label = {
    class:  'main ' ~ block('fieldset_label_class') ~ (block('fieldset_label_class') == 'col-xs-12' ? '' : ' control-label'),
    for:    block('fieldset_label_for'),
} %}

{% if block('fieldset_label_info') %}
    {% set field_info = buic.info(block('fieldset_label_text'), block('fieldset_label_info')) %}
{% endif %}

{#=== OUTPUT =========================================================================================================#}

<fieldset{{ macro.attr(attributes_fieldset) }}>
    <legend class="sr-only">{% block fieldset_label_text %}{% endblock fieldset_label_text %}</legend>
    <label{{ macro.attr(attributes_label) }}>{{ block('fieldset_label_text') }}: {{ field_info|default('') }}</label>
    {% block fieldset_controls %}{% endblock fieldset_controls %}
</fieldset>

{% import '@bolt/_macro/_buic.twig' as buic %}

{#=== INIT ===========================================================================================================#}

{% set attributes_fieldset = {
    'class':            'form-group',
    'data-bolt-field':  block('fieldset_type'),
    'data-bolt-fconf':  fieldset_conf|default() is iterable ? fieldset_conf|json_encode : null,
    'id':               block('fieldset_uid')|default(buid()),
} %}

{% set attributes_label = {
    class:  'main ' ~ block('fieldset_label_class') ~ (block('fieldset_label_class') == 'col-xs-12' ? '' : ' control-label'),
    for:    block('fieldset_label_for'),
} %}

{% if block('fieldset_label_info') %}
    {% set field_info = buic.info(block('fieldset_label_text'), block('fieldset_label_info')) %}
{% endif %}

{#=== OUTPUT =========================================================================================================#}

<fieldset{{ macro.attr(attributes_fieldset) }}>
    <legend class="sr-only">{% block fieldset_label_text %}{% endblock fieldset_label_text %}</legend>
    <label{{ macro.attr(attributes_label) }}>{{ block('fieldset_label_text') }}: {{ field_info|default('') }}</label>
    {% block fieldset_controls %}{% endblock fieldset_controls %}
</fieldset>

Allow to inject a fieldset uid
Allow to inject a fieldset uid