{{ form_errors(form) }}
<div class="ui two column stackable grid">
<div class="column">
<h4 class="ui dividing header">{{ 'app.ui.form.contact_data'|trans }}</h4>
<div class="two fields">
{{ form_row(form.firstName, sylius_test_form_attribute('first-name')|sylius_merge_recursive({'attr': {'placeholder': 'app.ui.form.placeholders.first_name'|trans}})) }}
{{ form_row(form.lastName, sylius_test_form_attribute('last-name')|sylius_merge_recursive({'attr': {'placeholder': 'app.ui.form.placeholders.last_name'|trans}})) }}
</div>
{{ form_row(form.email, sylius_test_form_attribute('email')|sylius_merge_recursive({'attr': {'placeholder': 'app.ui.form.placeholders.email'|trans}})) }}
{{ form_row(form.phoneNumber, sylius_test_form_attribute('phone-number')|sylius_merge_recursive({'attr': {'placeholder': 'app.ui.form.placeholders.phone_number'|trans}})) }}
<h4 class="ui dividing header form-subheader" style="margin-top:43px">{{ 'sylius.ui.account_credentials'|trans }}</h4>
<div class="two fields">
{{ form_row(form.user.plainPassword.first, sylius_test_form_attribute('password-first')|sylius_merge_recursive({'attr': {'placeholder': 'app.ui.form.placeholders.password'|trans}})) }}
{{ form_row(form.user.plainPassword.second, sylius_test_form_attribute('password-second')|sylius_merge_recursive({'label': 'app.ui.form.password_verification'|trans, 'attr': {'placeholder': 'app.ui.form.placeholders.password'|trans}})) }}
</div>
<span style="display:none">{{ form_row(form.organization.billingData.company, sylius_test_form_attribute('organization-billing-data-company')|sylius_merge_recursive({'attr': {'placeholder': 'app.ui.form.placeholders.company'|trans}})) }}</span>
</div>
<div class="column">
<h4 class="ui dividing header">{{ 'app.ui.form.company_organisation_data'|trans }}</h4>
{% if type == 'customer' %}<div style="display:none">{% endif %}
{{ form_row(form.organization.email, sylius_test_form_attribute('organization-email')|sylius_merge_recursive({'label': 'app.ui.form.email_for_leads'|trans, 'attr': {'placeholder': 'app.ui.form.placeholders.email_for_leads'|trans}})) }}
{% if type == 'customer' %}</div>{% endif %}
{{ form_row(form.organization.name, sylius_test_form_attribute('organization-name')|sylius_merge_recursive({'label': 'app.ui.form.legal_name_of_company'|trans, 'attr': {'placeholder': 'app.ui.form.placeholders.company'|trans}})) }}
{{ form_row(form.organization.billingData.street, sylius_test_form_attribute('organization-billing-data-street')|sylius_merge_recursive({'label': 'app.ui.form.registered_address'|trans, 'attr': {'placeholder': 'app.ui.form.placeholders.registered_address'|trans}})) }}
<div class="two fields">
{{ form_row(form.organization.billingData.postcode, sylius_test_form_attribute('organization-billing-data-postcode')|sylius_merge_recursive({'attr': {'placeholder': 'app.ui.form.placeholders.postcode'|trans}})) }}
{{ form_row(form.organization.billingData.city, sylius_test_form_attribute('organization-billing-data-city')|sylius_merge_recursive({'attr': {'placeholder': 'app.ui.form.placeholders.city'|trans}})) }}
</div>
{{ form_row(form.organization.billingData.country, sylius_test_form_attribute('organization-billing-data-country')) }}
{{ form_row(form.organization.billingData.taxId, sylius_test_form_attribute('organization-billing-data-tax-id')|sylius_merge_recursive({'label': 'app.ui.form.vat_id_number'|trans, 'label_html': true, 'attr': {'placeholder': 'app.ui.form.placeholders.vat_id'|trans}})) }}
{% include('Context/Common/ReCaptcha/_field.html.twig') %}
<div class="field">
<div class="ui toggle checkbox">
<input type="checkbox" id="terms_and_conditions" required>
<label for="terms_and_conditions" class="checkbox-label">
{% if type == 'customer' %}
{{ 'app.ui.form.terms_of_service_label'|trans({'%terms_link%': hyf_get_url_for_code_with_suffix('general_terms', 'legal'), '%privacy_link%': hyf_get_url_for_code_with_suffix('privacy_policy', 'legal')})|raw }}
{% else %}
{{ 'app.ui.form.vendor_terms_of_service_label'|trans({'%terms_link%': hyf_get_url_for_code_with_suffix('vendor_terms', 'legal'), '%privacy_link%': hyf_get_url_for_code_with_suffix('privacy_policy', 'legal')})|raw }}
{% endif %}
</label>
</div>
</div>
<div class="field terms-field">
<label class="recaptcha-label">
{{ 'app.ui.newsletter_page.this_site_is_protected'|trans|raw }}
</label>
</div>
</div>
</div>
<script>
{% if type == 'customer' %}
const buyerCompany = document.getElementById('bitbag_sylius_organization_plugin_organization_registration_organization_billingData_company');
const buyerOrganization = document.getElementById('bitbag_sylius_organization_plugin_organization_registration_organization_name');
const buyerLeadsEmail = document.getElementById('bitbag_sylius_organization_plugin_organization_registration_organization_email');
const buyerEmail = document.getElementById('bitbag_sylius_organization_plugin_organization_registration_email');
buyerOrganization.addEventListener('blur', populateBuyer);
buyerOrganization.addEventListener('change', populateBuyer);
function populateBuyer(e) {
buyerCompany.value = e.target.value;
}
buyerEmail.addEventListener('blur', populateBuyerEmail);
buyerEmail.addEventListener('change', populateBuyerEmail);
function populateBuyerEmail(e) {
buyerLeadsEmail.value = e.target.value;
}
{% else %}
var vendorCompany = document.getElementById('bitbag_sylius_organization_plugin_organization_vendor_registration_organization_billingData_company');
var vendorOrganization = document.getElementById('bitbag_sylius_organization_plugin_organization_vendor_registration_organization_name');
vendorOrganization.addEventListener('blur', populateVendor);
vendorOrganization.addEventListener('change', populateVendor);
function populateVendor(e) {
vendorCompany.value = e.target.value;
}
{% endif %}
</script>