{% extends '@CoreShopFrontend/layout-full.html.twig' %}
{% form_theme form '@CoreShopFrontend/Common/theme.html.twig' %}

{% block center %}
    <div id="main-container" class="container p-0">

        <nav aria-label="breadcrumb">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="{{ path('coreshop_index') }}">{{ 'coreshop.ui.home'|trans }}</a>
                </li>
                <li class="breadcrumb-item active">{{ 'coreshop.ui.register'|trans }}</li>
            </ol>
        </nav>

        <h2 class="main-heading text-center">
            {{ 'coreshop.ui.register'|trans }} <br/>
        </h2>

        <section class="registration-area">
            <div class="row">
                <div class="col-sm-12">
                    <div class="card card-smart">
                        <div class="card-body">

                            {{ form_start(form, {'method': 'POST', attr: {'novalidate': 'novalidate'}}) }}
                                {{ form_row(form.salutation, coreshop_test_form_attribute('register-salutation')) }}
                                {{ form_row(form.gender, coreshop_test_form_attribute('register-gender')) }}
                                {{ form_row(form.firstname, coreshop_test_form_attribute('register-firstname')) }}
                                {{ form_row(form.lastname, coreshop_test_form_attribute('register-lastname')) }}

                                {% if form.user.loginIdentifier is defined %}
                                    {{ form_row(form.user.loginIdentifier, coreshop_test_form_attribute('register-user-username')) }}
                                {% endif %}

                                {{ form_row(form.email.first, coreshop_test_form_attribute('register-email-first')) }}
                                {{ form_row(form.email.second, coreshop_test_form_attribute('register-email-second')) }}
                                {{ form_row(form.user.plainPassword.first, coreshop_test_form_attribute('register-password-first')) }}
                                {{ form_row(form.user.plainPassword.second, coreshop_test_form_attribute('register-password-second')) }}
                                {{ form_row(form.newsletterActive, coreshop_test_form_attribute('register-newsletter-active')) }}

                                {{ form_label(form.address) }}

                                {{ form_row(form.address.company, coreshop_test_form_attribute('register-address-company')) }}
                                {{ form_row(form.address.salutation, coreshop_test_form_attribute('register-address-salutation')) }}
                                {{ form_row(form.address.firstname, coreshop_test_form_attribute('register-address-firstname')) }}
                                {{ form_row(form.address.lastname, coreshop_test_form_attribute('register-address-lastname')) }}
                                {{ form_row(form.address.street, coreshop_test_form_attribute('register-address-street')) }}
                                {{ form_row(form.address.number, coreshop_test_form_attribute('register-address-number')) }}
                                {{ form_row(form.address.postcode, coreshop_test_form_attribute('register-address-post-code')) }}
                                {{ form_row(form.address.city, coreshop_test_form_attribute('register-address-city')) }}
                                {{ form_row(form.address.country, coreshop_test_form_attribute('register-address-country')) }}
                                {{ form_row(form.address.phoneNumber, coreshop_test_form_attribute('register-address-phone-number')) }}

                                {{ form_row(form.termsAccepted, coreshop_test_form_attribute('register-terms')) }}

                                {{ form_row(form.submit, coreshop_test_form_attribute('register-button')) }}

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