templates/segments/contact-us.html.twig line 1

Open in your IDE?
  1. <div id="contactUs">
  2.     {%  if editmode %}
  3.         {% do pimcore_head_link().appendStylesheet(asset('static/css/index.css')) %}
  4.         {{ pimcore_head_link() }}
  5.     {% endif %}
  6.         <script src="https://www.google.com/recaptcha/api.js?render={{ google_captcha_v3_site_key }}"></script>
  7.         <script>
  8.             function getReCaptcha() {
  9.                 grecaptcha.ready(function() {
  10.                     document.querySelectorAll('.form--contact').forEach(function(wrapper) {
  11.                         wrapper.addEventListener("submit", function(event) {
  12.                             event.preventDefault();
  13.                             grecaptcha.execute('{{ google_captcha_v3_site_key }}', { action: 'submit' }).then(function(token) {
  14.                                 wrapper.querySelectorAll(".contact-us-g-recaptcha-response").forEach(function(elem, index) {
  15.                                     elem.value = token;
  16.                                 })
  17.                             });
  18.                         });
  19.                         grecaptcha.execute('{{ google_captcha_v3_site_key }}', { action: 'submit' }).then(function(token) {
  20.                             wrapper.querySelectorAll(".contact-us-g-recaptcha-response").forEach(function(elem, index) {
  21.                                 elem.value = token;
  22.                             })
  23.                         });
  24.                     });
  25.                 });
  26.             }
  27.             getReCaptcha();
  28.         </script>
  29.     {{ form_start(form, { attr: { 'novalidate': 'novalidate', 'class': 'form form--contact'}} ) }}
  30.     <div class="form__group form__group--name">
  31.         {{ form_widget(form.name, {'attr': { 'class': 'form__input' }}) }}
  32.         {{ form_label(form.name, null, {'label_attr': { 'class': 'form__label' }}) }}
  33.         <div class="form__error form__error--name" data-error-message="{{ "contact-us.name.max"|trans }}">{{ form_errors(form.name) }}</div>
  34.     </div>
  35.     <div class="form__group">
  36.         {{ form_widget(form.email, {'attr': { 'class': 'form__input' }}) }}
  37.         {{ form_label(form.email, null, {'label_attr': { 'class': 'form__label' }}) }}
  38.         <div class="form__error form__error--email" data-error-message='["{{ "contact-us.email.required"|trans }}", "{{ "contact-us.email.valid"|trans }}"]'>{{ form_errors(form.email) }}</div>
  39.     </div>
  40.     <div class="form__group form__group--message">
  41.         {{ form_widget(form.message, {'attr': { 'rows': 4, 'class': 'form__textarea' }}) }}
  42.         {{ form_label(form.message, null, {'label_attr': { 'class': 'form__label' }}) }}
  43.         <div class="form__error form__error--message" data-error-message="{{ "meddox.message.message.blank"|trans }}">{{ form_errors(form.message) }}</div>
  44.     </div>
  45.     <div class="form__group form__group--inline">
  46.         {{ form_label( form.privacyConsent, null, {'label_attr': { 'class': 'form__label' }, 'label_html': true }) | raw }}
  47.         {{ form_widget(form.privacyConsent, {'attr': { 'class': 'form__checkbox' }}) }}
  48.         <div class="form__error form__error--checkbox" data-error-message="{{ "meddox.contact_us.checkbox.empty"|trans }}">{{ form_errors(form.privacyConsent) }}</div>
  49.     </div>
  50.     <div class="form__group form__group--inline form__group--invisible d-none">
  51.         {{ form_label(form.promotiveMaterialConsent, null, {'label_attr': { 'class': 'form__label' }, 'label_html': true }) | raw }}
  52.         {{ form_widget(form.promotiveMaterialConsent, {'attr': { 'class': 'form__checkbox' }}) }}
  53.         <div class="form__error form__error--checkbox" data-error-message="{{ "meddox.contact_us.checkbox.empty"|trans }}">{{ form_errors(form.promotiveMaterialConsent) }}</div>
  54.     </div>
  55.     <input type="hidden" id="contact-us-g-recaptcha-response" class="contact-us-g-recaptcha-response" name="contact-us-g-recaptcha-response">
  56.     <div class="form__group form__group--submit">
  57.         {{ form_widget(form.submit, {'attr': { 'class': 'btn btn-secondary align-self-end' }}) }}
  58.         <div class="form__error">{% if error is defined %}{{ error }}{% endif %}</div>
  59.     </div>
  60.     {{ form_end(form) }}
  61. </div>