templates/attestation/index.html.twig line 1

  1. {% extends 'base_footer.html.twig' %}
  2. {% block title %}{{ 'attestationp.titre'|trans }}{% endblock %}
  3. {% block body %}
  4. {% set faq_items = [
  5.     {
  6.         'question': 'attestationp.faq.question1',
  7.         'answer': 'attestationp.faq.reponse1'
  8.     },
  9.     {
  10.         'question': 'attestationp.faq.question2',
  11.         'answer': 'attestationp.faq.reponse2'
  12.     },
  13.     {
  14.         'question': 'attestationp.faq.question3',
  15.         'answer': 'attestationp.faq.reponse3'
  16.     },
  17.     {
  18.         'question': 'attestationp.faq.question4',
  19.         'answer': 'attestationp.faq.reponse4'
  20.     },
  21.     {
  22.         'question': 'attestationp.faq.question5',
  23.         'answer': 'attestationp.faq.reponse5'
  24.     }
  25. ] %}
  26. <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
  27.     <!-- En-tête -->
  28.     <div class="bg-gray-200 py-12 md:py-16 mb-8 text-center w-full">
  29.         <h1 class="text-2xl md:text-3xl font-bold px-4">{{ 'attestationp.titre'|trans }}</h1>
  30.     </div>
  31.     <!-- Section Trouver un logement -->
  32.     <div class="py-12 md:py-16 mb-8 text-center">
  33.         <h2 class="text-2xl md:text-3xl font-bold mb-6 max-w-4xl mx-auto px-4">{{ 'attestationp.trouver_logement'|trans }}</h2>
  34.         <div class="max-w-3xl mx-auto space-y-4 px-4">
  35.             <p>{{ 'attestationp.trouver_logement_description'|trans }}</p>
  36.             <p>{{ 'attestationp.trouver_logement_description1'|trans }} <strong>{{ 'attestationp.trouver_logement_description2'|trans }}</strong> {{ 'attestationp.trouver_logement_description3'|trans }} <strong>{{ 'attestationp.trouver_logement_description4'|trans }}</strong> {{ 'attestationp.trouver_logement_description5'|trans }}</p>
  37.         </div>
  38.     </div>
  39.     <!-- Section Réservation anticipée -->
  40.     <div class="bg-gray-200 py-12 md:py-16 mb-8 w-full">
  41.         <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
  42.             <div class="flex flex-col lg:flex-row gap-8">
  43.                 <div class="lg:w-1/2">
  44.                     <h2 class="text-2xl md:text-3xl font-bold mb-6">{{ 'attestationp.reservation_anticipee'|trans }}</h2>
  45.                     <div class="space-y-4">
  46.                         <p>{{ 'attestationp.early_reservation_1'|trans }} <strong>{{ 'attestationp.early_reservation_1_2'|trans }}</strong></p>
  47.                         <p>{{ 'attestationp.early_reservation_2'|trans }} <strong>{{ 'attestationp.early_reservation_2_2'|trans }}</strong> {{ 'attestationp.early_reservation_2_3'|trans }} <strong>{{ 'attestationp.early_reservation_2_4'|trans }}</strong></p>
  48.                         <p>{{ 'attestationp.early_reservation_3'|trans }} <strong>{{ 'attestationp.early_reservation_3_1'|trans }}</strong></p>
  49.                         <p>{{ 'attestationp.early_reservation_4'|trans }}</p>
  50.                     </div>
  51.                 </div>
  52.                 <div class="lg:w-1/2 flex justify-center lg:justify-end">
  53.                     <div class="bg-white p-6 md:p-8 rounded-lg shadow-md max-w-md w-full">
  54.                         <p>💡 {{ 'attestationp.reservation_anticipee_description_2'|trans }} <strong>{{ 'attestationp.reservation_anticipee_description_3'|trans }}</strong> {{ 'attestationp.reservation_anticipee_description_4'|trans }}</p>
  55.                     </div>
  56.                 </div>
  57.             </div>
  58.         </div>
  59.     </div>
  60.     <!-- Section Pourquoi Roomlers -->
  61.     <div class="py-12 md:py-16 mb-8">
  62.         <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
  63.             <h2 class="text-2xl md:text-3xl font-bold mb-6 text-center">{{ 'attestationp.pourquoi_roomlers'|trans }}</h2>
  64.             <p class="text-center max-w-3xl mx-auto mb-8 md:mb-12 px-4">
  65.                 {{ 'attestationp.pourquoi_roomlers_description'|trans }} <strong>{{ 'attestationp.pourquoi_roomlers_description1'|trans }}</strong> {{ 'attestationp.pourquoi_roomlers_description2'|trans }} <strong>{{ 'attestationp.pourquoi_roomlers_description3'|trans }}</strong> {{ 'attestationp.pourquoi_roomlers_description4'|trans }} <strong>{{ 'attestationp.pourquoi_roomlers_description5'|trans }}</strong>
  66.             </p>
  67.             <div class="grid grid-cols-1 md:grid-cols-3 gap-6 max-w-5xl mx-auto">
  68.                 <div class="bg-gray-100 p-6 rounded-lg">
  69.                     <p class="font-bold">{{ 'attestationp.etudiants_internationaux'|trans }}</p>
  70.                 </div>
  71.                 <div class="bg-gray-100 p-6 rounded-lg">
  72.                     <p class="font-bold">{{ 'attestationp.logements_verifies'|trans }}</p>
  73.                 </div>
  74.                 <div class="bg-gray-100 p-6 rounded-lg">
  75.                     <p class="font-bold">{{ 'attestationp.accompagnement_complet'|trans }}</p>
  76.                 </div>
  77.             </div>
  78.         </div>
  79.     </div>
  80.     <!-- Section Comment obtenir -->
  81.     <div class="bg-gray-200 py-12 md:py-16 mb-8 w-full">
  82.     <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
  83.         <div class="flex flex-col lg:flex-row gap-8">
  84.             <div class="lg:w-1/3 flex items-center"> <!-- Ajout de flex et items-center pour centrer verticalement -->
  85.                 <h2 class="text-2xl md:text-3xl font-bold mb-6">{{ 'attestationp.comment_obtenir'|trans }}</h2>
  86.             </div>
  87.             <div class="lg:w-2/3">
  88.                 <div class="space-y-6">
  89.                     <p>{{ 'attestationp.comment_obtenir_description'|trans }} <strong>{{ 'attestationp.comment_obtenir_description1'|trans }}</strong> {{ 'attestationp.comment_obtenir_description2'|trans }}</p>
  90.                     <div class="space-y-6">
  91.                         <div class="bg-white p-6 rounded-lg shadow-sm">
  92.                             <h3 class="font-bold text-lg mb-2">{{ 'attestationp.etapes.etape1'|trans }}</h3>
  93.                             <p>{{ 'attestationp.etapes.etape1_description'|trans }}</p>
  94.                         </div>
  95.                         <div class="bg-white p-6 rounded-lg shadow-sm">
  96.                             <h3 class="font-bold text-lg mb-2">{{ 'attestationp.etapes.etape2'|trans }}</h3>
  97.                             <p>{{ 'attestationp.etapes.etape2_description'|trans }}</p>
  98.                         </div>
  99.                         <div class="bg-white p-6 rounded-lg shadow-sm">
  100.                             <h3 class="font-bold text-lg mb-2">{{ 'attestationp.etapes.etape3'|trans }}</h3>
  101.                             <p>{{ 'attestationp.etapes.etape3_description'|trans }}</p>
  102.                         </div>
  103.                     </div>
  104.                     <div class="text-center mt-8 md:mt-12">
  105.                         {% if app.user %}
  106.                             {% if app.user.asRole('ROLE_TENANT') %}
  107.                                 <a href="{{ path('app_user_generateattestation') }}" class="inline-block bg-yellow-400 text-black font-semibold px-6 py-3 md:px-8 md:py-4 rounded-lg hover:bg-yellow-500 transition-colors">
  108.                                     {{ 'attestationp.demarrer_maintenant'|trans }}
  109.                                 </a>
  110.                             {% elseif app.user.asRole('ROLE_AGENT') or app.user.asRole('ROLE_SUPER_AGENT') %}
  111.                                 <a href="{{ path('app_user_generateattestation') }}" class="inline-block bg-yellow-400 text-black font-semibold px-6 py-3 md:px-8 md:py-4 rounded-lg hover:bg-yellow-500 transition-colors">
  112.                                     {{ 'attestationp.demarrer_maintenant'|trans }}
  113.                                 </a>
  114.                             {% elseif app.user.asRole('ROLE_LESSOR') or app.user.asRole('ROLE_LESSOR_RESIDENT') %}
  115.                                 <button id="openPopLink1" class="inline-block bg-yellow-400 text-black font-semibold px-6 py-3 md:px-8 md:py-4 rounded-lg hover:bg-yellow-500 transition-colors">
  116.                                     {{ 'attestationp.demarrer_prereservation'|trans }}
  117.                                 </button>
  118.                             {% else %}
  119.                                 <button id="openModalLink1" class="inline-block bg-yellow-400 text-black font-semibold px-6 py-3 md:px-8 md:py-4 rounded-lg hover:bg-yellow-500 transition-colors">
  120.                                     {{ 'attestationp.demarrer_maintenant'|trans }}
  121.                                 </button>
  122.                             {% endif %}
  123.                         {% else %}
  124.                             <button id="openModalLink1" class="inline-block bg-yellow-400 text-black font-semibold px-6 py-3 md:px-8 md:py-4 rounded-lg hover:bg-yellow-500 transition-colors">
  125.                                 {{ 'attestationp.demarrer_maintenant'|trans }}
  126.                             </button>
  127.                         {% endif %}
  128.                     </div>
  129.                 </div>
  130.             </div>
  131.         </div>
  132.     </div>
  133. </div>
  134.     <!-- Section FAQ -->
  135.     <div class="py-12 md:py-16 mb-8">
  136.         <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
  137.             <div class="flex flex-col lg:flex-row lg:items-center gap-8">
  138.                 <!-- Titre à gauche sur desktop, centré verticalement -->
  139.                 <div class="lg:w-1/3 lg:flex lg:items-center lg:justify-end">
  140.                     <h2 class="text-2xl md:text-3xl font-bold text-center lg:text-right lg:pr-8">
  141.                         {{ 'attestationp.rep'|trans }}<br/> {{ 'attestationp.question'|trans }}
  142.                     </h2>
  143.                 </div>
  144.                 <!-- Questions à droite sur desktop -->
  145.                 <div class="lg:w-2/3 space-y-4">
  146.                     {% for item in faq_items %}
  147.                         <div class="border border-gray-300 rounded-lg overflow-hidden shadow-md relative">
  148.                             <button class="faq-question flex items-center justify-between w-full p-4 font-semibold text-left transition duration-300 ease-in-out hover:bg-gray-100">
  149.                                 <span class="text-left">{{ item.question|trans }}</span>
  150.                                 <svg class="faq-icon w-5 h-5 text-gray-600 transition-transform transform" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
  151.                                     <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
  152.                                 </svg>
  153.                             </button>
  154.                             <div class="faq-answer max-h-0 overflow-hidden transition-all duration-300 ease-in-out">
  155.                                 <div class="p-4 text-gray-700">{{ item.answer|trans }}</div>
  156.                             </div>
  157.                         </div>
  158.                     {% endfor %}
  159.                 </div>
  160.             </div>
  161.         </div>
  162.     </div>
  163.     <!-- Section Prêt à commencer -->
  164.     <div class="bg-gray-200 py-12 md:py-16 w-full">
  165.         <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
  166.             <h2 class="text-2xl md:text-3xl font-bold mb-6">{{ 'attestationp.pret_commencer'|trans }}</h2>
  167.             <p class="max-w-3xl mx-auto mb-8 md:mb-12 px-4">
  168.                 {{ 'attestationp.pret_commencer_description'|trans }} <strong>{{ 'attestationp.pret_commencer_description1'|trans }}</strong> {{ 'attestationp.pret_commencer_description2'|trans }} <strong>{{ 'attestationp.pret_commencer_description3'|trans }}</strong>
  169.             </p>
  170.             {% if app.user %}
  171.                 {% if app.user.asRole('ROLE_TENANT') %}
  172.                     <a href="{{ path('app_user_generateattestation') }}" class="inline-block bg-yellow-400 text-black font-semibold px-6 py-3 md:px-8 md:py-4 rounded-lg hover:bg-yellow-500 transition-colors">
  173.                         {{ 'attestationp.demarrer_prereservation'|trans }}
  174.                     </a>
  175.                 {% elseif app.user.asRole('ROLE_AGENT') or app.user.asRole('ROLE_SUPER_AGENT') %}
  176.                     <a href="{{ path('app_user_generateattestation') }}" class="inline-block bg-yellow-400 text-black font-semibold px-6 py-3 md:px-8 md:py-4 rounded-lg hover:bg-yellow-500 transition-colors">
  177.                         {{ 'attestationp.demarrer_prereservation'|trans }}
  178.                     </a>
  179.                 {% elseif app.user.asRole('ROLE_LESSOR') or app.user.asRole('ROLE_LESSOR_RESIDENT') %}
  180.                     <button id="openPopLink2" class="inline-block bg-yellow-400 text-black font-semibold px-6 py-3 md:px-8 md:py-4 rounded-lg hover:bg-yellow-500 transition-colors">
  181.                         {{ 'attestationp.demarrer_prereservation'|trans }}
  182.                     </button>
  183.                 {% else %}
  184.                     <button id="openModalLink2" class="inline-block bg-yellow-400 text-black font-semibold px-6 py-3 md:px-8 md:py-4 rounded-lg hover:bg-yellow-500 transition-colors">
  185.                         {{ 'attestationp.demarrer_prereservation'|trans }}
  186.                     </button>
  187.                 {% endif %}
  188.             {% else %}
  189.                 <button id="openModalLink2" class="inline-block bg-yellow-400 text-black font-semibold px-6 py-3 md:px-8 md:py-4 rounded-lg hover:bg-yellow-500 transition-colors">
  190.                     {{ 'attestationp.demarrer_prereservation'|trans }}
  191.                 </button>
  192.             {% endif %}
  193.         </div>
  194.     </div>
  195. </div>
  196. <!-- Modal de connexion/inscription -->
  197. <div id="connectModal" class="fixed inset-0 bg-gray-500 bg-opacity-50 flex justify-center items-center hidden z-50">
  198.     <div class="bg-white p-6 rounded-lg shadow-lg max-w-sm w-full mx-4 text-center">
  199.         <p class="text-lg font-semibold mb-4">{{ 'attestationp.choisissez_option'|trans }}</p>
  200.         <button onclick="window.location.href='{{ path('app_login_site') }}'" class="bg-yellow-400 text-black px-4 py-2 rounded-lg font-semibold hover:bg-yellow-500 transition mb-2 w-full">
  201.             {{ 'attestationp.connexion'|trans }}
  202.         </button>
  203.         <button onclick="window.location.href='{{ path('app_register') }}'" class="bg-yellow-400 text-black px-4 py-2 rounded-lg font-semibold hover:bg-yellow-500 transition w-full">
  204.             {{ 'attestationp.inscription'|trans }}
  205.         </button>
  206.     </div>
  207. </div>
  208. <!-- Modal2-->
  209. <div id="connectPop" class="fixed inset-0 bg-gray-500 bg-opacity-50 flex justify-center items-center hidden z-50">
  210.     <div class="bg-white p-6 rounded-lg shadow-lg max-w-sm w-full mx-4 text-center">
  211.         <p class="text-lg font-semibold mb-4">{{ 'attestationp.veuillez_connexion'|trans }}</p>
  212.         <button onclick="window.location.href='{{ path('app_login_site') }}'" class="bg-yellow-400 text-black px-4 py-2 rounded-lg font-semibold hover:bg-yellow-500 transition mb-2 w-full">
  213.             {{ 'attestationp.connexion'|trans }}
  214.         </button>
  215.     </div>
  216. </div> <br> <br>
  217. {% endblock %}
  218. {% block javascripts %}
  219. <script>
  220. document.addEventListener('DOMContentLoaded', function () {
  221.     // Gestion du modal de connexion/inscription
  222.     const openModalElements = document.querySelectorAll('#openModalLink1, #openModalLink2');
  223.     const connectModal = document.getElementById('connectModal');
  224.     if (openModalElements.length > 0 && connectModal) {
  225.         openModalElements.forEach(element => {
  226.             element.addEventListener('click', function (event) {
  227.                 event.preventDefault();
  228.                 connectModal.classList.remove('hidden');
  229.             });
  230.         });
  231.         connectModal.addEventListener('click', function (event) {
  232.             if (event.target === connectModal) {
  233.                 connectModal.classList.add('hidden');
  234.             }
  235.         });
  236.         connectModal.querySelector('.bg-white').addEventListener('click', function (event) {
  237.             event.stopPropagation();
  238.         });
  239.     }
  240.     const openPopElements = document.querySelectorAll('#openPopLink1, #openPopLink2');
  241.     const connectPop = document.getElementById('connectPop');
  242.     if (openPopElements.length > 0 && connectPop) {
  243.         openPopElements.forEach(element => {
  244.             element.addEventListener('click', function (event) {
  245.                 event.preventDefault();
  246.                 connectPop.classList.remove('hidden');
  247.             });
  248.         });
  249.         connectPop.addEventListener('click', function (event) {
  250.             if (event.target === connectPop) {
  251.                 connectPop.classList.add('hidden');
  252.             }
  253.         });
  254.         connectPop.querySelector('.bg-white').addEventListener('click', function (event) {
  255.             event.stopPropagation();
  256.         });
  257.     }
  258.     // Gestion de l'accordéon FAQ
  259.     const faqQuestions = document.querySelectorAll('.faq-question');
  260.     faqQuestions.forEach(question => {
  261.         question.addEventListener('click', () => {
  262.             const answer = question.parentElement.querySelector('.faq-answer');
  263.             const icon = question.querySelector('.faq-icon');
  264.             // Fermer toutes les autres réponses
  265.             document.querySelectorAll('.faq-answer').forEach(item => {
  266.                 if (item !== answer) {
  267.                     item.classList.remove('max-h-[500px]');
  268.                     item.previousElementSibling.querySelector('.faq-icon').classList.remove('rotate-180');
  269.                     item.previousElementSibling.classList.remove('bg-gray-100');
  270.                 }
  271.             });
  272.             // Basculer l'état de la réponse cliquée
  273.             if (answer.classList.contains('max-h-[500px]')) {
  274.                 answer.classList.remove('max-h-[500px]');
  275.                 icon.classList.remove('rotate-180');
  276.                 question.classList.remove('bg-gray-100');
  277.             } else {
  278.                 answer.classList.add('max-h-[500px]');
  279.                 icon.classList.add('rotate-180');
  280.                 question.classList.add('bg-gray-100');
  281.             }
  282.         });
  283.     });
  284. });
  285. </script>
  286. <style>
  287. .faq-answer {
  288.     transition: max-height 0.3s ease-out;
  289.     overflow: hidden;
  290. }
  291. .faq-icon {
  292.     transition: transform 0.3s ease;
  293. }
  294. .rotate-180 {
  295.     transform: rotate(180deg);
  296. }
  297. @media (max-width: 1023px) {
  298.     .lg\:flex-row {
  299.         flex-direction: column;
  300.     }
  301.     .lg\:w-1\/3, .lg\:w-2\/3, .lg\:w-1\/2 {
  302.         width: 100%;
  303.     }
  304. }
  305. </style>
  306. {% endblock %}