templates/contact/default.html.twig line 1

Open in your IDE?
  1. {% extends "layout.html.twig" %}
  2. {% block content %}
  3. <!-- #main -->
  4. <main id="main" role="main">
  5.     {{ pimcore_areablock('contentTop') }}
  6.     <div class="apk-page-contact">
  7.         <div class="uk-container apk-container-800">
  8.             <div class="apk-contact-container">
  9.                 
  10.                 {# editmode pour le titre #}
  11.                 {% if editmode %}
  12.                 <p>
  13.                     {{ pimcore_textarea("infos-text",{
  14.                         "nl2br" : true,
  15.                         "placeholder" : 'Texte de la section infos'
  16.                     }) }}
  17.                 </p>   
  18.                 {% else %}
  19.                 <div>
  20.                     <h5>{{ pimcore_textarea("infos-text",{"nl2br" : true}) }}</h5>
  21.                 </div>
  22.                 {% endif %}
  23.                 
  24.                 <div>
  25.                     <div class="apk-contact-snippets-container">
  26.                         {% if formStatus == "required-empty" %}
  27.                         
  28.                         <div class="uk-alert-danger" uk-alert>
  29.                         <a class="uk-alert-close" uk-close></a>
  30.                         <p>{{ "Veuillez remplir tout les champs requis. (*)"|trans }}</p>
  31.                         </div>
  32.                         {% elseif formStatus == "invalid-email" %}
  33.                         <div class="uk-alert-danger" uk-alert>
  34.                         <a class="uk-alert-close" uk-close></a>
  35.                         <p>{{ "Votre adresse email est invalide. Merci de recommencer."|trans }}</p>
  36.                         </div>
  37.                         {% elseif formStatus == "robot" %}
  38.                         <div class="uk-alert-danger" uk-alert>
  39.                         <a class="uk-alert-close" uk-close></a>
  40.                         <p>{{ "Une erreur Recaptcha est survenue. Merci de recommencer."|trans }}</p>
  41.                         </div>
  42.                         {% endif %}
  43.                         {% if formStatus != "success" %}
  44.                         {{ form_start(form, {'action': '#contact', 'method': 'POST'}) }}
  45.                         <div uk-grid>
  46.                             <div class="uk-width-1-2@s uk-margin-small-top">
  47.                                 {{ form_row(form.lastname, { 'attr': {'class' : 'uk-input'}}) }}
  48.                             </div>
  49.                             <div class="uk-width-1-2@s uk-margin-small-top">
  50.                                 {{ form_row(form.firstname, { 'attr': {'class' : 'uk-input'}}) }}
  51.                             </div>
  52.                             <div class="uk-width-1-2@s uk-margin-top">
  53.                                 {{ form_row(form.email, { 'attr': {'class' : 'uk-input'}}) }}
  54.                             </div>
  55.                             <div class="uk-width-1-2@s uk-margin-top">
  56.                                 {{ form_row(form.phone, { 'attr': {'class' : 'uk-input'}}) }}
  57.                             </div>
  58.                             <div class="uk-width-1-1 uk-margin-top">
  59.                                 {{ form_row(form.message, { 'attr': {'class' : 'uk-textarea'}}) }}
  60.                             </div>
  61.                             <div class="uk-width-1-2@s">
  62.                                 <div class="form-group">
  63.                                     <div class="apk-birthday-date" data-apk-label-day="{{'Jour'|trans}}" data-apk-label-month="{{'Mois'|trans}}" data-apk-label-year="{{'Année'|trans}}">
  64.                                         {{ form_row(form.birthday) }}
  65.                                     </div>
  66.                                 </div>
  67.                             </div>
  68.                             <div class="uk-width-1-1 apk-choix uk-margin-top">
  69.                                 <div>
  70.                                     <div class="apk-sang">
  71.                                         <div class="uk-margin-top">
  72.                                             {{ form_row(form.sang) }}
  73.                                         </div>
  74.                                     </div>
  75.                                 </div>
  76.                                 <div>
  77.                                     <div class="apk-plasma">
  78.                                         <div class="uk-margin-top">
  79.                                             {{ form_row(form.plasma) }}
  80.                                         </div>
  81.                                     </div>
  82.                                 </div>
  83.                             </div>
  84.                             <div class="uk-width-1-1 apk-conscent uk-margin-top">
  85.                                 <div class="uk-grid-small" uk-grid>
  86.                                     <div class="uk-width-auto">{{ form_widget(form.gdpr, { 'attr': {'class' : 'uk-checkbox'}}) }}</div>
  87.                                     <div class="uk-width-expand"><label id="contact_form_gdpr_label" for="contact_form_gdpr">{{ "contact.conscent"|trans }}</label></div>
  88.                                 </div>
  89.                             </div>
  90.                             {{ form_widget(form.recaptcha) }}
  91.                             <div class="uk-width-1-1 uk-margin-small-top">
  92.                                 <div class="uk-margin-top uk-text-right">
  93.                                     {{ form_widget(form.submit) }}
  94.                                 </div>
  95.                             </div>
  96.                         </div>
  97.                         {{ form_end(form) }}
  98.                         {% else %}
  99.                         <div class="uk-alert-success" uk-alert>
  100.                         <a class="uk-alert-close" uk-close></a>
  101.                         <p>{{ "Message envoyé. Nous vous recontacterons dans les plus brefs délais."|trans }}</p>
  102.                         </div>
  103.                         {% endif %}
  104.                     </div>
  105.                 </div>
  106.                 
  107.             </div>
  108.         </div>
  109.     </div>
  110.     {{ pimcore_areablock('contentBottom') }}
  111. </main>
  112. {% endblock %}
  113. {% block inlinescripts %}
  114.         
  115. {% set recaptchaKeyPublic = pimcore_website_config('recaptchaKeyPublic') %}
  116. <script src="https://www.google.com/recaptcha/api.js?onload=onloadRecaptchaCallback&render={{ recaptchaKeyPublic }}"></script>
  117. <script>
  118.     function onloadRecaptchaCallback(){
  119.       grecaptcha.ready(function() {
  120.         grecaptcha.execute('{{ recaptchaKeyPublic }}', {action: 'contact'}).then(function(token) {
  121.           //alert('recaptcha is loaded');
  122.           var recaptcha = document.getElementById('contact_form_recaptcha');
  123.           recaptcha.value = token;
  124.         });
  125.       });
  126.     }
  127. </script>
  128. {% endblock inlinescripts %}