templates/defaut/contact.html.twig line 1

  1. {% extends 'base.html.twig' %}
  2. {% block title %} {% endblock %}
  3.  {% block head_css %}
  4.      {{ parent() }}
  5. <style>
  6.     .image {
  7.         opacity: 1;
  8.         display: block;
  9.         width: 100%;
  10.         height: auto;
  11.         transition: .5s ease;
  12.         backface-visibility: hidden;
  13.     }
  14.     .middle {
  15.         transition: .5s ease;
  16.         opacity: 0;
  17.         position: absolute;
  18.         top: 50%;
  19.         left: 50%;
  20.         transform: translate(-50%, -50%);
  21.         -ms-transform: translate(-50%, -50%);
  22.         text-align: center;
  23.     }
  24.     .shadow:hover .image {
  25.         opacity: 0.3;
  26.     }
  27.     .shadow:hover .middle {
  28.         opacity: 1;
  29.     }
  30.     .text {
  31.         background-color: #04AA6D;
  32.         color: white;
  33.         font-size: 16px;
  34.         padding: 16px 32px;
  35.     }
  36. </style>
  37.  {% endblock %}
  38. {% block body %}
  39.     <!-- =======================
  40. Page Banner START -->
  41.     <section class="pt-5 pb-0" style="background-image:url(assets/images/element/map.svg); background-position: center left; background-size: cover;">
  42.         <div class="container">
  43.             <div class="row">
  44.                 <div class="col-lg-8 col-xl-6 text-center mx-auto">
  45.                     <!-- Title -->
  46.                     <h6 class="text-primary">Nous contacter</h6>
  47.                     <h1 class="mb-4"></h1>
  48.                 </div>
  49.                 {% include 'message_flash.html.twig' %}
  50.             </div>
  51.             <!-- Contact info box -->
  52.             <div class="row g-4 g-md-5 mt-0 mt-lg-3">
  53.             </div>
  54.         </div>
  55.     </section>
  56.     <!-- =======================
  57.     Page Banner END -->
  58.     <!-- =======================
  59. Image and contact form START -->
  60.     <section >
  61.         <div class="container">
  62.             <div class="row g-4 g-lg-0 align-items-center">
  63.                 <div class="col-md-6 align-items-center text-center">
  64.                     <!-- Image -->
  65.                     <img src="assets/images/element/contact.svg" class="h-400px" alt="">
  66.                     <!-- Contact form END -->
  67.                 </div>
  68.                 <!-- Contact form START -->
  69.                 <div class="col-md-6">
  70.                     <!-- Title -->
  71.                     <h2 class="mt-4 mt-md-0">Nous contacter</h2>
  72.                     <p> Veuillez utiliser ce formulaire pour nous contacter. N'oubliez pas de consulter l'aide avant toute demande. </p>
  73.                     {{ form_start(formulaire, {'attr': {'id': 'form_contact'}}) }}
  74.                     <div id="liste_erreurs" class="my-custom-class-for-errors">
  75.                         {{ form_errors(formulaire) }}
  76.                     </div>
  77.                     <input type="hidden" name="token" value="{{ csrf_token('delete-item') }}"/>
  78.                         <!-- Name -->
  79.                         <div class="mb-4 bg-light-input">
  80.                             {{ form_label(formulaire.objet) }} :  <br>
  81.                             <div class="form-error">
  82.                                 {{ form_errors(formulaire.objet) }}
  83.                             </div>
  84.                             {{ form_widget(formulaire.objet, {'attr': {'class': 'form-control'} }) }}
  85.                         </div>
  86.                         <!-- Email -->
  87.                         <div class="mb-4 bg-light-input">
  88.                             {{ form_label(formulaire.email) }} * :  <br>
  89.                             <div class="form-error">
  90.                                 {{ form_errors(formulaire.email) }}
  91.                             </div>
  92.                             {{ form_widget(formulaire.email, {'attr': {'class': 'form-control'} }) }}
  93.                         </div>
  94.                         <!-- Message -->
  95.                         <div class="mb-4 bg-light-input">
  96.                              {{ form_label(formulaire.content) }} * :  <br>
  97.                             <div class="form-error">
  98.                                 {{ form_errors(formulaire.content) }}
  99.                             </div>
  100.                             {{ form_widget(formulaire.content, {'attr': {'class': 'form-control', 'rows': 10} }) }}
  101.                         </div>
  102.                         <!-- Button -->
  103.                         <div class="d-grid">
  104.                             <button class="btn btn-lg btn-primary mb-0" type="submit" id="envoyer-contact">Envoyer le message</button>
  105.                         </div>
  106.                         {{ form_rest(formulaire) }}
  107.                         {{ form_end(formulaire) }}
  108.                 </div>
  109.             </div>
  110.         </div>
  111.     </section>
  112.     <!-- =======================
  113.     Image and contact form END -->
  114. {% endblock %}
  115. {% block head_js %}
  116.     {{ parent() }}
  117.     <script src="https://www.google.com/recaptcha/api.js?render=6LcE0wgkAAAAAHHujAJRKPpFPszzofFDmunk4bcm"></script>
  118.     <script>
  119.         $('#envoyer-contact').click(function (e) {
  120.             e.preventDefault();
  121.             alert(e);
  122.             grecaptcha.ready(function () {
  123.                 grecaptcha.execute('6LcE0wgkAAAAAHHujAJRKPpFPszzofFDmunk4bcm', { action: 'contact' }).then(function (token) {
  124.                     var recaptchaResponse = document.getElementById('contact_jeton');
  125.                     recaptchaResponse.value = token;
  126.                     $('#form_contact').unbind('submit').submit();
  127.                 });
  128.             });
  129.         });
  130.     </script>
  131.     <script type="text/javascript">
  132.         $(document).ready(function () {
  133.             $('body').addClass('bd-contact');
  134.             {% if erreurs %}
  135.             location.hash = "#" + 'liste_erreurs';
  136.             {% endif %}
  137.         });
  138.     </script>
  139. {% endblock %}