{% if editmode %}
{% do pimcore_head_link().appendStylesheet(asset('static/css/index.css')) %}
{{ pimcore_head_link() }}
{% endif %}
{% if not isMobile|default() %}
<script src="https://www.google.com/recaptcha/api.js?render={{ google_captcha_v3_site_key }}"></script>
<script>
function getReCaptcha() {
grecaptcha.ready(function() {
document.querySelectorAll('.newsletter-input-wrapper').forEach(function(wrapper) {
wrapper.addEventListener("submit", function(event) {
event.preventDefault();
grecaptcha.execute('{{ google_captcha_v3_site_key }}', { action: 'submit' }).then(function(token) {
wrapper.querySelectorAll(".newsletter-g-recaptcha-response").forEach(function(elem, index) {
elem.value = token;
})
});
});
grecaptcha.execute('{{ google_captcha_v3_site_key }}', { action: 'submit' }).then(function(token) {
wrapper.querySelectorAll(".newsletter-g-recaptcha-response").forEach(function(elem, index) {
elem.value = token;
})
});
});
});
}
getReCaptcha();
</script>
{% endif %}
{{ form_start(form, { attr: { 'novalidate': 'novalidate', 'class': 'newsletter-input-wrapper', 'data-generic-error-message': 'newsletter.generic_email_message'|trans }}) }}
<div class="position-relative">
{{ form_widget(form.email) }}
{{ form_label(form.email, null, {'label_attr': { 'class': 'form__label', 'style': 'top: 50%; transform: translateY(-50%)' }}) }}
<div class="newsletter-input-wrapper_error-box" data-error-message='["{{ "newsletter.email.required"|trans }}", "{{ "newsletter.email.valid"|trans }}", "{{ "newsletter.email.max"|trans }}"]'>{{ form_errors(form.email) }}{% if error is defined %}{{ error }}{% endif %}</div>
{% if fixedVersion is defined and fixedVersion %}
{{ form_widget(form.submit, {'attr': { 'class': 'btn btn-secondary' }}) }}
{% endif %}
</div>
<div class="position-relative d-flex align-items-flex-start my-2">
{{ form_widget(form.privacyConsent) }}
{{ form_label( form.privacyConsent, null, {'label_attr': { 'class': 'position-relative w-100 ml-2' }, 'label_html': true }) | raw }}
<div class="newsletter-input-wrapper_error-box form__error--checkbox checkbox-error" data-error-message="{{ "meddox.contact_us.checkbox.empty"|trans }}">{{ form_errors(form.privacyConsent) }}</div>
</div>
{% if fixedVersion is not defined or not fixedVersion %}
<div class="button-wrapper">
{{ form_widget(form.submit, {'attr': { 'class': 'btn btn-secondary' }}) }}
</div>
{% endif %}
<input type="hidden" id="newsletter-g-recaptcha-response" class="newsletter-g-recaptcha-response" name="newsletter-g-recaptcha-response">
{{ form_end(form) }}