{#
    MetaTagPreset form Macro

    @author Elze Kool <info@visualmedia.nl>
#}
{% macro meta_tag_preset_widget(meta_tag_preset_form, data_fields) %}

    <div class="meta-tag-preset max-width">

        <fieldset>
            <legend data-validation-result="{{ meta_tag_preset_form.vars.id }}accordion">
                <button data-confirm="{{ 'meta_tag_preset.verwijder.confirm'|trans({}, 'forms') }}" type="button" class="btn btn-link pull-right js-meta-tag-preset-del"><i class="icon-trash"></i></button>
                {{ 'meta_tag_preset.legend_title'|trans({}, 'forms') }} "<span data-text-from="{{ meta_tag_preset_form.titel.vars.id }}">{{ meta_tag_preset_form.titel.vars.data }}</span>"                
            </legend>

            <div class="panel-group" id="{{ meta_tag_preset_form.vars.id }}accordion" role="tablist" aria-multiselectable="true">
                <div class="panel panel-default">
                    <div class="panel-heading" role="tab" id="{{ meta_tag_preset_form.vars.id }}headingAlgemeen">
                        <a data-validation-result="{{ meta_tag_preset_form.vars.id }}collapseAlgemeen" class="panel-title {% if meta_tag_preset_form.titel.vars.data is not empty %}collapsed{% endif %}" data-toggle="collapse" data-parent="#{{ meta_tag_preset_form.vars.id }}accordion" href="#{{ meta_tag_preset_form.vars.id }}collapseAlgemeen" aria-expanded="true" aria-controls="{{ meta_tag_preset_form.vars.id }}collapseAlgemeen">
                            {{ 'meta_tag_preset.algemeen'|trans({}, 'forms') }}
                            <i class="icon-arrow-up"></i>
                            <i class="icon-arrow-down"></i>
                        </a>
                    </div>
                    <div id="{{ meta_tag_preset_form.vars.id }}collapseAlgemeen" class="panel-collapse collapse {% if meta_tag_preset_form.titel.vars.data is empty %}in{% endif %}" role="tabpanel" aria-labelledby="{{ meta_tag_preset_form.vars.id }}headingAlgemeen">
                        <div class="panel-body">
                            {{ form_row(meta_tag_preset_form.titel) }}
                            {{ form_row(meta_tag_preset_form.type) }}
                            <div data-select-update="{{ meta_tag_preset_form.type.vars.id }}" data-select-value="meta-tag">
                                {{ form_row(meta_tag_preset_form.naam) }}
                            </div>
                        </div>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading" role="tab" id="{{ meta_tag_preset_form.vars.id }}headingInhoud">
                        <a data-validation-result="{{ meta_tag_preset_form.vars.id }}collapseInhoud" class="panel-title collapsed"  data-toggle="collapse" data-parent="#{{ meta_tag_preset_form.vars.id }}accordion" href="#{{ meta_tag_preset_form.vars.id }}collapseInhoud" aria-expanded="true" aria-controls="{{ meta_tag_preset_form.vars.id }}collapseInhoud">
                            {{ 'meta_tag_preset.inhoud'|trans({}, 'forms') }}
                            <i class="icon-arrow-up"></i>
                            <i class="icon-arrow-down"></i>
                        </a>
                    </div>
                    <div id="{{ meta_tag_preset_form.vars.id }}collapseInhoud" class="panel-collapse collapse" role="tabpanel" aria-labelledby="{{ meta_tag_preset_form.vars.id }}headingInhoud">
                        <div class="panel-body">
                            {{ form_row(meta_tag_preset_form.inhoudIsExpression, { 'container_cls' : 'col-xs-12 col-sm-8 control-label', attr : { 'data-toggle-codemirror' : meta_tag_preset_form.inhoud.vars.id } }) }}
                            <div class="form-group row max-width clearfix ">
                                {{ form_label(meta_tag_preset_form.inhoud) }}
                                <div class="col-xs-12 col-sm-8">
                                    {{ form_widget(meta_tag_preset_form.inhoud) }}
                                    <div class="help-block" data-show-on="{{ meta_tag_preset_form.inhoudIsExpression.vars.id }}">
                                        {{ render(url('manage_meta_tag_available_fields')) }}
                                    </div>
                                </div>
                                {{ form_errors(meta_tag_preset_form.inhoud) }}
                            </div>
                            {{ form_row(meta_tag_preset_form.inhoudWijzigbaar) }}
                        </div>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading" role="tab" id="{{ meta_tag_preset_form.vars.id }}headingZichtbaar">
                        <a data-validation-result="{{ meta_tag_preset_form.vars.id }}collapseZichtbaar" class="panel-title collapsed" data-toggle="collapse" data-parent="#{{ meta_tag_preset_form.vars.id }}accordion" href="#{{ meta_tag_preset_form.vars.id }}collapseZichtbaar" aria-expanded="true" aria-controls="{{ meta_tag_preset_form.vars.id }}collapseZichtbaar">
                            {{ 'meta_tag_preset.zichtbaarheid'|trans({}, 'forms') }}
                            <i class="icon-arrow-up"></i>
                            <i class="icon-arrow-down"></i>
                        </a>
                    </div>
                    <div id="{{ meta_tag_preset_form.vars.id }}collapseZichtbaar" class="panel-collapse collapse" role="tabpanel" aria-labelledby="{{ meta_tag_preset_form.vars.id }}headingZichtbaar">
                        <div class="panel-body">

                            {{ form_row(meta_tag_preset_form.zichtbaarIsExpression, {  'container_cls' : 'col-xs-12 col-sm-8 control-label', attr : { 'data-toggle-codemirror' : meta_tag_preset_form.zichtbaar.vars.id } }) }}
                            
                            <div data-show-on="{{ meta_tag_preset_form.zichtbaarIsExpression.vars.id }}">
                                <div class="col-xs-12 col-sm-8">
                                    {{ form_widget(meta_tag_preset_form.zichtbaar) }}
                                    <div class="help-block">
                                        {{ render(url('manage_meta_tag_available_fields')) }}
                                    </div>
                                </div>
                            </div>

                            <div data-hide-on="{{ meta_tag_preset_form.zichtbaarIsExpression.vars.id }}">
                                {{ form_row(meta_tag_preset_form.zichtbaarSelect) }}
                            </div>

                            {{ form_row(meta_tag_preset_form.zichtbaarWijzigbaar) }}
                        </div>
                    </div>
                </div>
            </div>

        </fieldset>

    </div>
{% endmacro %}