{% sw_extends '@Storefront/storefront/component/address/address-form.html.twig' %}
{% block component_address_form_street %}
<div class="form-group col-md-6">
{% if formViolations.getViolations("/street") is not empty %}
{% set violationPath = "/street" %}
{% elseif formViolations.getViolations("/#{prefix}/street") is not empty %}
{% set violationPath = "/#{prefix}/street" %}
{% else %}
{% set requiredMessage = "error.VIOLATION::IS_BLANK_ERROR"|trans({ '%field%': "address.streetLabel"|trans|sw_sanitize }) %}
{% endif %}
{% block component_address_form_street_label %}
<label class="form-label"
for="{{ idPrefix ~ prefix }}AddressStreet">
{{ "address.streetLabel"|trans|sw_sanitize }}{{ "general.required"|trans|sw_sanitize }}
</label>
{% endblock %}
{% block component_address_form_street_input %}
<input type="text"
class="form-control{% if violationPath %} is-invalid{% endif %}"
id="{{ idPrefix ~ prefix }}AddressStreet"
placeholder="{{ "address.streetPlaceholder"|trans|striptags }}"
name="{{ prefix }}[street]"
value="{% if data.extensions.nomsExtension.street %}{{ data.extensions.nomsExtension.street }}{% else %}{{ data.street }}{% endif %}"
data-form-validation-required
{% if requiredMessage is defined %}data-form-validation-required-message="{{ requiredMessage }}"{% endif %}
required="required"
maxlength="35"
>
{# BODYMED-1033 Maxlength für einzelne Felder, da NOMS längenbeschränkungen hat #}
{% endblock %}
{% block component_address_form_street_input_error %}
{% if violationPath %}
{% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
{% endif %}
{% endblock %}
</div>
<div class="form-group col-md-6">
{% if formViolations.getViolations("/streetnumber") is not empty %}
{% set violationPath = "/streetnumber" %}
{% elseif formViolations.getViolations("/#{prefix}/streetnumber") is not empty %}
{% set violationPath = "/#{prefix}/streetnumber" %}
{% else %}
{% set requiredMessage = "error.VIOLATION::IS_BLANK_ERROR"|trans({ '%field%': "address.streetnumberLabel"|trans|sw_sanitize }) %}
{% endif %}
{% block component_address_form_streetnumber_label %}
<label class="form-label"
for="{{ idPrefix ~ prefix }}AddressStreetnumber">
{{ "address.streetnumberLabel"|trans|sw_sanitize }}{{ "general.required"|trans|sw_sanitize }}
</label>
{% endblock %}
{% block component_address_form_streetnumber_input %}
<input type="text"
class="form-control{% if violationPath %} is-invalid{% endif %}"
id="{{ idPrefix ~ prefix }}AddressStreet"
placeholder="{{ "address.streetnumberPlaceholder"|trans|striptags }}{{ "general.required"|trans|sw_sanitize }}"
name="{{ prefix }}[streetnumber]"
value="{% if data.extensions.nomsExtension.streetnumber %}{{ data.extensions.nomsExtension.streetnumber }}{% endif %}"
data-form-validation-required
{% if requiredMessage is defined %}data-form-validation-required-message="{{ requiredMessage }}"{% endif %}
required="required"
maxlength="10"
>
{# BODYMED-1033 Maxlength für einzelne Felder, da NOMS längenbeschränkungen hat #}
{% endblock %}
{% block component_address_form_streetnumber_input_error %}
{% if violationPath %}
{% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
{% endif %}
{% endblock %}
{% if context.customer.id %}
<input type="hidden" name="{{ prefix }}[nomsId]" value="{{ context.customer.id }}" />
{% endif %}
</div>
{% endblock %}