{% extends '@CpCreationVitiCore/admin/base.html.twig' %}

{% block content %}
    <h1 class="page-header">Modifier le réseau social {{ item.network }}</h1>
    {% include '@CpCreationVitiCore/formFlow/stepList_content.html.twig' %}

    {{ form_start(form, { 'attr': {'class': 'smart-form'} }) }}
    {{ form_errors(form) }}

    {% if flow.getCurrentStepNumber() == 2 %}
        <fieldset>
        <div class="small-12">
            {% if form.vars.value.network != 'instagram' %}
            {{ form_row(form.configuration.id) }}
            {% endif %}

            {% if form.vars.value.network == 'facebook_facebook' %}
                {{ form_widget(form.configuration.accountFacebook, { 'attr' : { 'class': 'hidden' }}) }}
            {% endif %}
            {% if form.vars.value.network == 'facebook_instagram' %}
                {{ form_widget(form.configuration.accountInstagram, { 'attr' : { 'class': 'hidden' }}) }}
            {% endif %}
            </div>
            </fieldset>
        {% endif %}
        {% if flow.getCurrentStepNumber() == 3 %}
            <fieldset>
                <div class="small-12">
                    {% if form.vars.value.network != 'instagram' %}
                        {{ form_widget(form.configuration.id, { 'attr' : { 'class': 'hidden' }}) }}
                    {% endif %}
                    {% if form.vars.value.network == 'facebook_facebook' %}
                        {{ form_row(form.configuration.accountFacebook) }}
                    {% endif %}
                    {% if form.vars.value.network == 'facebook_instagram' %}
                        {{ form_row(form.configuration.accountInstagram) }}
                    {% endif %}
                </div>
            </fieldset>
        {% endif %}
        {{ form_rest(form) }}

        {% include '@CpCreationVitiCore/formFlow/buttons.html.twig' %}
        {{ form_end(form) }}
        {% endblock %}