{% import '@SyliusUi/Macro/headers.html.twig' as headers %}

{% extends '@SyliusShop/Account/AddressBook/layout.html.twig' %}

{% form_theme form '@SyliusShop/Form/theme.html.twig' %}

{% block subcontent %}
    <div class="account-address-create">
        {{ headers.shop('sylius.ui.address_book'|trans, null, 'sylius.ui.add_address'|trans) }}

        {{ sylius_template_event('sylius.shop.account.address_book.create.after_content_header', {'address': address}) }}

        {{ form_start(form, {'action': path('sylius_shop_account_address_book_create'), 'attr': {'class': 'ui loadable form', 'novalidate': 'novalidate'}}) }}
            {% include '@SyliusShop/Common/Form/_address.html.twig' with {'form': form} %}

            <div class="form-btn-wrapper">
                <a href="{{ path('sylius_shop_account_address_book_index') }}" class="btn btn-outline-primary">
                    &#139; {{ 'sylius.ui.cancel'|trans }}
                </a>

                <button type="submit" class="btn btn-primary" {{ sylius_test_html_attribute('add-address') }}>
                   {{ 'sylius.ui.add'|trans }} &#155;
                </button>
            </div>

        {{ sylius_template_event('sylius.shop.account.address_book.create.form', {'address': address}) }}

        {{ form_row(form._token) }}
        {{ form_end(form, {'render_rest': false}) }}
    </div>
{% endblock %}
