{% if type is defined %}
    {% set type = type ~ '-' %}
{% else %}
    {% set type = null %}
{% endif %}

<div class="row">
    <div class="col-sm-6">
        {{ form_row(form.firstName, sylius_test_form_attribute(type ~ 'first-name')) }}
    </div>

    <div class="col-sm-6">
        {{ form_row(form.lastName, sylius_test_form_attribute(type ~ 'last-name')) }}
    </div>
</div>

{{ form_row(form.company, sylius_test_form_attribute(type ~ 'company')) }}
{{ form_row(form.street, sylius_test_form_attribute(type ~ 'street')) }}

<div class="row">
    <div class="col-sm-6">
        {% include '@SyliusShop/Common/Form/_countryCode.html.twig' with {'form': form.countryCode} %}
    </div>

    <div class="col-sm-6">
        <div class="form-group province-container" data-url="{{ path('sylius_shop_ajax_render_province_form') }}">
            {% if form.provinceCode is defined %}
                {{ form_row(form.provinceCode, sylius_test_form_attribute('province-code')|sylius_merge_recursive( {'attr': {'class': 'ui dropdown'}})) }}
            {% elseif form.provinceName is defined %}
                {{ form_row(form.provinceName, sylius_test_form_attribute('province-name')) }}
            {% endif %}
        </div>

        {% if form.provinceCode is defined %}
            {{ form_errors(form) }}
        {% endif %}
    </div>
</div>

<div class="row">
    <div class="col-sm-6">
        {{ form_row(form.city, sylius_test_form_attribute(type ~ 'city')) }}
    </div>

    <div class="col-sm-6">
        {{ form_row(form.postcode, sylius_test_form_attribute(type ~ 'postcode')) }}
    </div>
</div>

{{ form_row(form.phoneNumber, {'help': 'app.ui.cart.phone_help'|trans}) }}

<p class="required-fields">{{ 'app.ui.form.required_field'|trans }}</p>
