{% extends ajax-suffix ? "@gantry-admin/partials/ajax.html.twig" : "@gantry-admin/partials/base.html.twig" %}

{% block gantry %}
<form method="post" action="{{ gantry.route(action) }}">
    <div class="g-tabs" role="tablist">
        <ul>
            <li class="active">
                <a href="#" id="g-switcher-platforms-tab" role="presentation" aria-controls="g-switcher-platforms" role="tab" aria-expanded="true">{{ 'GANTRY5_PLATFORM_WIDGET'|trans }}</a>
            </li>
            {% if block %}
            <li>
                <a href="#" id="g-settings-block-tab" role="presentation" aria-controls="g-settings-block" role="tab" aria-expanded="false">{{ 'GANTRY5_PLATFORM_BLOCK'|trans }}</a>
            </li>
            {% endif %}
        </ul>
    </div>

    <div class="g-panes">
        <div class="g-pane active" role="tabpanel" id="g-settings-particle" aria-labelledby="g-settings-particle-tab" aria-expanded="true">
            <div class="card settings-block">
                <h4>
                    <span data-title-editable="{{ item.title }}" class="title">{{ item.title }}</span>
                    <i class="fa fa-pencil fa-pencil-alt font-small" aria-hidden="true" tabindex="0" aria-label="{{ 'GANTRY5_PLATFORM_EDIT_TITLE'|trans(item.title) }}" data-title-edit=""></i>
                    <span class="badge font-small">{{ item.options.type }}</span>
                </h4>

                <div class="wp-form-params">
                    {{ form|raw }}
                </div>
            </div>
        </div>

        {% if block %}
        <div class="g-pane" role="tabpanel" id="g-settings-block" aria-labelledby="g-settings-block-tab" aria-expanded="false">
            <div class="card settings-block">
                <h4>
                    {{ 'GANTRY5_PLATFORM_BLOCK'|trans }}
                </h4>
                <div class="inner-params">
                    {% include 'forms/fields.html.twig' with {'blueprints': block.form, 'data': item.options, 'scope': 'block.'} %}
                </div>
            </div>
        </div>
        {% endif %}
    </div>

    <div class="g-modal-actions">
        <button class="button button-primary" type="submit">{{ 'GANTRY5_PLATFORM_APPLY'|trans }}</button>
        <button class="button button-primary" data-apply-and-save="">{{ 'GANTRY5_PLATFORM_APPLY_SAVE'|trans }}</button>
        <button class="button g5-dialog-close">{{ 'GANTRY5_PLATFORM_CANCEL'|trans }}</button>
    </div>
</form>
{% endblock %}
