templates/contact/index.html.twig line 1

  1. {% extends 'base.html.twig' %}
  2. {% block title %}
  3.     {{ 'contact.title'|trans }}
  4. {% endblock %}
  5. {% block body %}
  6.     <div class="container px-4 sm:px-8 md:px-16 lg:px-32 xl:px-48 3xl:px-96 flex flex-wrap mx-auto justify-center items-center text-black">
  7.         <div>
  8.             <div class="content-center">
  9.                 <a href="{{ app.request.headers.get('referer') }}"
  10.                    class="bg-gray-300 text-nowrap hover:bg-gray-400 focus:ring-4 focus:outline-none focus:ring-gray-300 text-black w-full font-medium rounded-md text-sm px-3 py-2.5">
  11.                     <i class="fa-solid fa-arrow-left text-black"></i>
  12.                     <span>{{ 'button.back'|trans }}</span>
  13.                 </a>
  14.             </div>
  15.             <form method="post">
  16.                 <div class="flex items-center justify-center">
  17.                     <div class="max-w-md w-full my-54 space-y-8">
  18.                         <div>
  19.                             <h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900">{{ 'allform.contact.contactus'|trans }}</h2>
  20.                         </div>
  21.                         {{ form_start(form) }}
  22.                         {{ form_row(form.firstName) }}
  23.                         {{ form_row(form.lastName) }}
  24.                         {{ form_row(form.email) }}
  25.                         {{ form_row(form.phone) }}
  26.                         {{ form_row(form.requestType) }}
  27.                         <div id="problemType-container" style="display: none;">
  28.                             {{ form_row(form.problemType) }}
  29.                         </div>
  30.                         {{ form_row(form.message) }}
  31.                         <div>
  32.                             <button type="submit"
  33.                                     class="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
  34.                                 {{ 'allform.contact.envoyer'|trans }}
  35.                             </button>
  36.                         </div> <br/>
  37.                         {{ form_end(form) }}
  38.                     </div> <br/>
  39.                 </div>
  40.                 <p>{{ 'contact.info'|trans }} <a href="{{ path('privacy') }}"><strong>{{ 'register.privacy'|trans }}</strong></a> {{ 'contact.info2'|trans }}</p>
  41.             </form>
  42.         </div> <br/>
  43.     </div>
  44.     <script>
  45.         document.addEventListener("DOMContentLoaded", function () {
  46.             const requestType = document.getElementById("contact_form_requestType");
  47.             const problemTypeContainer = document.getElementById("problemType-container");
  48.             function toggleProblemType() {
  49.                 if (requestType.value === "problem") {
  50.                     problemTypeContainer.style.display = "block";
  51.                 } else {
  52.                     problemTypeContainer.style.display = "none";
  53.                 }
  54.             }
  55.             // Initial check
  56.             toggleProblemType();
  57.             // When value changes
  58.             requestType.addEventListener("change", toggleProblemType);
  59.         });
  60.     </script>
  61. {% endblock %}