{% import 'VisualMTagManagerBundle:ManageMetaTagPreset:form.html.twig' as _meta_tag_preset_form %}

{{ form_start(meta_tag_set_form, { attr : { class : '!vm-change-tracking' } }) }}

<div class="row">

    <fieldset>
        <div class="col-sm-12">
            <legend>{{ 'meta_tag_set.header_algemeen'|trans({}, 'forms') }}</legend>
        </div>
        <div class="col-lg-6">
            <div class="row">
                <div class="col-sm-10">
                    {{ form_row(meta_tag_set_form.naam) }}
                </div>
            </div>
            <p>&nbsp;</p>
            <div class="row">
                <div class="col-sm-10">
                    {{ form_row(meta_tag_set_form.kiesbaar) }}
                </div>
            </div>
        </div>
        <div class="col-lg-6">

            <div class="row">
                <div class="col-sm-10">
                    {{ form_label(meta_tag_set_form.contentTypes) }}
                    <p class="help-block">{{ 'meta_tag_set.content_types.info'|trans({}, 'forms') }}</p>
                    {{ form_widget(meta_tag_set_form.contentTypes) }}
                    {{ form_errors(meta_tag_set_form.contentTypes) }}
                </div>
            </div>

        </div>
    </fieldset>
                
</div>

<p>&nbsp;</p>

<div class="row">

    <fieldset>

        <div class="col-sm-12">
            <legend>{{ 'meta_tag_set.header_meta_tag_presets'|trans({}, 'forms') }}</legend>
            <p>{{ 'meta_tag_set.meta_tag_presets_info'|trans({}, 'forms') }}</p>
        </div>

        <div class="col-sm-12">
            <div class="js-meta-tag-preset-container" data-prototype="{{ _meta_tag_preset_form.meta_tag_preset_widget(meta_tag_set_form.metaTagPresets.vars.prototype, data_fields) | e }}">
                {% for meta_tag_preset_form in meta_tag_set_form.metaTagPresets %}
                    {{ _meta_tag_preset_form.meta_tag_preset_widget(meta_tag_preset_form, data_fields) }}
                    {{ form_errors(meta_tag_preset_form) }}
                {% endfor %}
                {{ form_errors(meta_tag_set_form.metaTagPresets) }}
                {% do meta_tag_set_form.metaTagPresets.setRendered %}
            </div>


            <div class="text-center">
                <button type="button" class="btn btn-extra js-meta-tag-preset-add"><i class="glyphicon glyphicon-plus-sign"></i> {{ 'meta_tag_preset.toevoegen'|trans({}, 'forms') }}</button>
            </div>

        </div>

    </fieldset>
            
</div>



<div class="row">
    <div class="col-sm-12">

        <br />
        <hr />

        {% if (meta_tag_set.id is not null and is_granted('ROLE_PERM_DELETE_META_TAG_SET')) %}
            <a href="{{ path('manage_meta_tag_set_delete', { id : meta_tag_set.Id }) }}" data-confirm="{{ 'meta_tag_set.action.delete.confirm'|trans({}, 'backend') }}" data-method="POST" class="btn btn-lg btn-link pull-right"><span class="text-danger">{{ 'meta_tag_set.action.delete.label'|trans({}, 'backend') }}</span></a>
        {% endif %}


        <a href="{{ path('manage_meta_tag_set_index', {}) }}" class="btn btn-lg btn-link pull-right">{{ 'meta_tag_set.action.to_index'|trans({}, 'backend') }}</a>

        {{ form_widget(meta_tag_set_form.saveAndClose, { attr: { class : 'btn btn-lg btn-primary' } }) }}
        {{ form_widget(meta_tag_set_form.save, { attr: { class : 'btn btn-lg btn-link' } }) }}


    </div>
</div>
{{ form_end(meta_tag_set_form) }}
<p>&nbsp;</p>


{% stylesheets
    'bundles/visualmtagmanager/codemirror-4.5/lib/codemirror.css'
    'bundles/visualmtagmanager/codemirror-4.5/theme/monokai.css'
    'bundles/visualmtagmanager/css/meta_tag_set/form.css'
%}
    <link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}

{% set js %}
    {% javascripts
        'bundles/visualmtagmanager/codemirror-4.5/lib/codemirror.js'
        'bundles/visualmtagmanager/codemirror-4.5/mode/javascript/javascript.js'
        'bundles/visualmtagmanager/js/meta_tag_set/form.js'
    %}
        <script type="text/javascript" src="{{ asset_url }}"></script>
    {% endjavascripts %}
{% endset %}
{{ append_javascript(js, 'meta_tag_set_form') }}
