templates/building/index.html.twig line 1

  1. {% extends 'base.html.twig' %}
  2. {% block title %}Fiche
  3. {% endblock %}
  4. {% block body %}
  5.     <style>
  6.         .image-size {
  7.             width: 100%;
  8.             height: auto;
  9.             object-fit: cover;
  10.         }
  11.         .icon {
  12.             background-color: #ffcc00;
  13.             padding: 10px;
  14.             z-index: 0;
  15.             border-radius: 60px;
  16.             height: min-content;
  17.             width: min-content;
  18.         }
  19.         #map {
  20.             height: 400px;
  21.             width: 95%;
  22.             filter: blur(5px);
  23.             transition: filter 0.3s ease-in-out;
  24.         }
  25.         .bar {
  26.             padding: 5px;
  27.             padding-left: 50%;
  28.             border-radius: 60px;
  29.             font-weight: 700;
  30.             padding-right: 50%;
  31.         }
  32.         .GES-bar-A {
  33.             background-color: #a3dbfc;
  34.         }
  35.         .GES-bar-B {
  36.             background-color: #8ab5d2;
  37.         }
  38.         .GES-bar-C {
  39.             background-color: #7692b1; 
  40.         }
  41.         .GES-bar-D {
  42.             background-color: #5e708d;
  43.         }
  44.         .GES-bar-E {
  45.             background-color: #4d5272;
  46.         }
  47.         .GES-bar-F {
  48.             background-color: #393550; 
  49.         }
  50.         .GES-bar-G {
  51.             background-color: #291b35; 
  52.         }
  53.         
  54.         .GES-bar-V {
  55.             background-color:rgb(214, 210, 216); 
  56.             color: white;
  57.         }
  58.         
  59.         .DPE-bar-A {
  60.             background-color: #4caf50;
  61.         }
  62.         .DPE-bar-B {
  63.             background-color: #8bc34a;
  64.         }
  65.         .DPE-bar-C {
  66.             background-color: #ffeb3b;
  67.         }
  68.         .DPE-bar-D {
  69.             background-color: #ffc107;
  70.         }
  71.         .DPE-bar-E {
  72.             background-color: #ff5722;
  73.         }
  74.         .DPE-bar-F {
  75.             background-color: #f44336;
  76.         }
  77.         .DPE-bar-G {
  78.             background-color: #b71c1c;
  79.         }
  80.         
  81.         .DPE-bar-V {
  82.             background-color:rgb(214, 210, 216); 
  83.             color: white;
  84.         }
  85.         .slick-prev, .slick-next {
  86.             background-color: transparent;
  87.             border-radius: 0;
  88.             padding: 5;
  89.         }
  90.         .slick-prev:before {
  91.             content: '←';
  92.             font-size: 30px;
  93.             color: black;
  94.             margin-right: 15px;
  95.         }
  96.         .slick-next:before {
  97.             content: '→';
  98.             font-size: 30px;
  99.             color: black;
  100.         }
  101.         .slick-carousel .slick-slide img {
  102.             width: 100%;
  103.             height: 500px;
  104.             object-fit: cover;
  105.             display: block;
  106.             margin: 0 auto;
  107.         }
  108.         #zoomContainer {
  109.             position: fixed;
  110.             top: 0;
  111.             left: 0;
  112.             width: 100vw;
  113.             height: 100vh;
  114.             background-size: cover;
  115.             background-position: center;
  116.             background-repeat: no-repeat;
  117.             z-index: 9999;
  118.             display: none;
  119.             justify-content: center;
  120.             align-items: center;
  121.             background-color: rgba(0, 0, 0, 0.8);
  122.         }
  123.         .close-button {
  124.             position: absolute;
  125.             top: 0px;
  126.             right: 175px;
  127.             background: transparent;
  128.             border: none;
  129.             font-size: 4rem;
  130.             font-weight: bold;
  131.             color: white;
  132.             cursor: pointer;
  133.             z-index: 10000;
  134.         }
  135.         .close-button:hover {
  136.             color: red;
  137.         }
  138.     </style>
  139.     <script src="https://unpkg.com/flowbite@1.4.0/dist/flowbite.js"></script>
  140.     <div id='firstDiv' class="">
  141.         <hr class="hidden md:block my-6 border-gray-300">
  142.         <div class="relative flex items-center justify-between w-full px-4">
  143.             <div class="md:w-fit">
  144.                 <a href="{{ app.request.headers.get('referer') ?: path('home') }}"
  145.                    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">
  146.                     <i class="fa-solid fa-arrow-left text-black"></i>
  147.                     <span>{{ 'button.back'|trans }}</span>
  148.                 </a>
  149.             </div>
  150.             <div class="md:w-fit">
  151.                 {% if allow %}
  152.                     <a href="{{ path('building_edit',{id : building.id}) }}" class="bg-[#FFFFFF] md:bg-[#ffcc00] md:font-medium items-center flex rounded-full md:rounded-md text-sm p-2 md:p-3">
  153.                         <i class="fa-solid fa-pencil text-black" aria-hidden="true"></i>
  154.                         <span class="hidden md:block ml-2">{{ 'button.modif'|trans }}</span>
  155.                     </a>
  156.                 {% endif %}
  157.             </div>
  158.         </div>
  159.         <div class="md:hidden  dropdown z-[100000] absolute top-2 right-2 content-center">
  160.             <button class="dropdown-toggle d-block d-sm-none" type="button" data-bs-toggle="dropdown" aria-expanded="false">
  161.                     <i class="fa-solid fa-flag"></i>
  162.             </button>
  163.             <ul style='text-align: -webkit-center; --bs-dropdown-min-width: 3rem !important;' class="  dropdown-menu content-center">
  164.             {% if app.request.attributes.get('_route') is not null %}
  165.                     <li class=''>
  166.                         <a class="w-[20px] h-[20px] dropdown-item bg-[url({{ asset('images/site/en.svg') }})] bg-auto bg-no-repeat bg-center" href="{{ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')|merge({'_locale': 'en'})) }}">
  167.                         {# &#x1F1EC;&#x1F1E7; #}
  168.                         </a>
  169.                     </li>
  170.                     <li  class="mt-[2px]">
  171.                         <a class="w-[20px] h-[20px] dropdown-item bg-[url({{ asset('images/site/fr.svg') }})] bg-auto bg-no-repeat bg-center" href="{{ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')|merge({'_locale': 'fr'})) }}">
  172.                         {# &#x1F1EB;&#x1F1F7; #}
  173.                         </a>
  174.                     </li>
  175.             {% endif %}
  176.             </ul>
  177.         </div>
  178.         <hr class="hidden md:block my-6 border-gray-300">
  179.         
  180.         {% if building.hasReservation %}
  181.             <p style="background-color:rgb(147, 173, 218); color: #0064ff; padding: 10px; display: inline-block; border-radius: 8px; margin-bottom: 10px;">
  182.                 {{ 'building.listingOnHold'|trans }}
  183.             </p>
  184.         {% endif %}
  185.         {# Image Mobile #}
  186.             <div class="slideshow-container">
  187.                 <div class="slideshow block md:hidden">
  188.                     {% if building.buildingDocuments %}
  189.                             <div id="default-carousel" class="relative z-0" data-carousel="static">
  190.                                 {# Carousel wrapper #} 
  191.                                 <div  class="overflow-hidden relative h-[14rem] md:h-[10rem] lg:h-[14rem]">
  192.                                     <!-- Item 1 -->
  193.                                     
  194.                                     {% for bd in building.buildingDocuments  %}
  195.                                             <a class="building-link ">
  196.                                                 <div onclick="zoomImage('{{ bd.imageFile }}')" class=" max-h-[300px] bg-[url({{ asset('images/files/' ~ bd.imageFile) }})] bg-cover bg-no-repeat bg-center hidden duration-700 ease-in-out {% if loop.first %}active{% endif %} " data-carousel-item></div>
  197.                                             </a>
  198.                                     {% endfor %}
  199.                                 </div>
  200.                                 {# Slider indicators #} 
  201.                                 <div class="flex absolute border-black bottom-5 left-1/2 z-30 space-x-3 -translate-x-1/2">
  202.                                     {% for document in building.buildingDocuments %}
  203.                                             <button type="button" style="border: 1px grey solid;" class="w-3 h-3 rounded-full border-black" aria-current="false" aria-label="Slide {{building.id}}" data-carousel-slide-to= "{{building.id}}"></button>
  204.                                     {% endfor %}
  205.                                 </div>
  206.                                 {# Slider controls #} 
  207.                                 {% if building.buildingDocuments|length > 1 %}
  208.                                         <button type="button" class="flex absolute top-0 left-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none" data-carousel-prev>
  209.                                             <span class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30  group-hover:bg-white/50  group-focus:ring-4 group-focus:ring-white  group-focus:outline-none">
  210.                                                 <svg class="w-5 h-5 text-white sm:w-6 sm:h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path></svg>
  211.                                                 <span class="hidden">Previous</span>
  212.                                             </span>
  213.                                         </button>
  214.                                         <button type="button" class="flex absolute top-0 right-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none" data-carousel-next>
  215.                                             <span class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30  group-hover:bg-white/50  group-focus:ring-4 group-focus:ring-white  group-focus:outline-none">
  216.                                                 <svg class="w-5 h-5 text-white sm:w-6 sm:h-6 " fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg>
  217.                                                 <span class="hidden">Next</span>
  218.                                             </span>
  219.                                         </button>
  220.                                 {% endif %}
  221.                                 
  222.                             </div>
  223.                     {% endif %}
  224.                 </div>
  225.             </div>
  226.         {# end #}
  227.         <div class='container '>
  228.             <div class="flex justify-between items-center">
  229.                 <div >
  230.                     <h2 class="text-2xl font-bold md:text-nowrap">{{  building.title}}</h2>
  231.                     <h2 class="text-2xl font-bold md:text-nowrap">{{  building.cityEntity.city}}, {{  building.cityEntity.country}}</h2>
  232.                 </div>
  233.                 <div class="flex items-center">
  234.                     <a class="flex items-center justify-center p-3 cursor-pointer rounded-lg">
  235.                         {% if liked %}
  236.                             <h2 class="hidden md:block">{{ 'accueil.retirerfav'|trans }}</h2>
  237.                             <i class="text-[#ffcc00] fa-solid fa-heart md:pl-3 fa-2x like-button" data-image-id="{{ building.id }}"></i>
  238.                         {% else %}
  239.                             <h2 class="hidden md:block">{{ 'accueil.addfav'|trans }}</h2>
  240.                             <i class="text-[#ffcc00] fa-regular fa-heart md:pl-3 fa-2x like-button" data-image-id="{{ building.id }}"></i>
  241.                         {% endif %}
  242.                     </a>
  243.                     <a class="flex items-center justify-center p-3 cursor-pointer rounded-lg" onclick="toggleSharePopup()">
  244.                         <h2 class="hidden md:block">{{ 'accueil.share'|trans }}</h2>
  245.                         <img src="{{ asset('/images/partager-jaune.png') }}" alt="Partager" class="md:pl-3 w-10 h-8">
  246.                     </a>
  247.                 </div>
  248.             </div>
  249.             
  250.             <div class="relative mt-6 hidden md:block">
  251.                 <button type="button" class="flex absolute top-0 left-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none slick-custom-prev">
  252.                     <span class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30 group-hover:bg-white/50 group-focus:ring-4 group-focus:ring-white group-focus:outline-none">
  253.                         <svg class="w-5 h-5 text-white sm:w-6 sm:h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  254.                             <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path>
  255.                         </svg>
  256.                         <span class="hidden">Previous</span>
  257.                     </span>
  258.                 </button>
  259.                 <div class="slick-carousel">
  260.                     {% if building.buildingDocuments %}
  261.                         {% if building.complexProperty %}
  262.                             {% for document in building.buildingDocuments %}
  263.                                 {% if document.name starts with 'imagesComplexe' %}
  264.                                     <div>
  265.                                         <img onclick="zoomImage('{{ document.imageFile }}')" src="{{ asset('/images/files/') }}{{ document.imageFile }}" alt="">
  266.                                     </div>
  267.                                 {% endif %}
  268.                             {% endfor %}
  269.                         {% else %}
  270.                             {% for document in building.buildingDocuments %}
  271.                                 {% if document.name == "base" %}
  272.                                     <div>
  273.                                         <img onclick="zoomImage('{{ document.imageFile }}')" class="rounded-tl-lg image-size" src="{{ asset('/images/files/') }}{{ document.imageFile }}" alt="">
  274.                                     </div>
  275.                                 {% endif %}
  276.                             {% endfor %}
  277.                             {% for document in building.buildingDocuments %}
  278.                                 {% if document.name != "base" and document.name in ["file0","file1","file2", "file3", "file4", "file5", "file6", "file7", "file8"] %}
  279.                                     <div>
  280.                                         <img onclick="zoomImage('{{ document.imageFile }}')" class="sm:h-28 md:h-36 lg:h-56 sm:w-36 md:w-56 lg:w-80" src="{{ asset('/images/files/') }}{{ document.imageFile }}" alt="">
  281.                                     </div>
  282.                                 {% endif %}
  283.                             {% endfor %}
  284.                         {% endif %}
  285.                     {% endif %}
  286.                 </div>
  287.                 <button type="button" class="flex absolute top-0 right-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none slick-custom-next">
  288.                     <span class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30 group-hover:bg-white/50 group-focus:ring-4 group-focus:ring-white group-focus:outline-none">
  289.                         <svg class="w-5 h-5 text-white sm:w-6 sm:h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  290.                             <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
  291.                         </svg>
  292.                         <span class="hidden">Next</span>
  293.                     </span>
  294.                 </button>
  295.             </div>
  296.                 <br>
  297.                 <div id="fileShow" class="hidden grid grid-cols-4 gap-4">
  298.                     {% if building.buildingDocuments|length > 4 %}    
  299.                         {%  for  i in  5..8 %}
  300.                             {% for document in building.buildingDocuments %}
  301.                                 
  302.                                 {% if ("file" ~ i) == document.name  %}
  303.                                     <div class="hidden md:block ">
  304.                                         <img class="sm:h-28 md:h-36 lg:h-56 sm:w-36 md:w-56 lg:w-80 " src="{{ asset('/images/files/') }}{{ document.imageFile }}" alt="">
  305.                                     </div>
  306.                                 {% endif %}
  307.                             {% endfor %}
  308.                             
  309.                         {% endfor %}
  310.                     {% else %}
  311.                         <div class="md-5">
  312.                             <hr class="my-6 border-gray-300">
  313.                             <h2 class="text-2xl font-bold"> {{ 'building.noImage'|trans }}</h2>
  314.                             <hr class="my-6 border-gray-300">
  315.                         </div>
  316.                     {% endif %}
  317.                 </div>
  318.             </div>
  319.             {% if building.complexProperty %}
  320.                 <h2 class="hidden md:block text-2xl font-bold md:text-nowrap">{{ building.type|trans|capitalize  }}, {{buildingsInComplex|length}} {{buildingsInComplex|length > 1 ? 'accueil.rooms'|trans : 'accueil.rooms'|trans }}</h2>
  321.             {% else %}
  322.                 <h2 class="hidden md:block text-2xl font-bold md:text-nowrap">{{ building.type|trans|capitalize  }}</h2>
  323.             {% endif %}
  324.             {% if building.complexProperty %}
  325.                 <h2 class="hidden md:block text-2xl font-bold md:text-nowrap">{{ 'accueil.loyer'|trans }} {{lowestRent /100}} euros</h2>
  326.             {% else %}
  327.                 <h2 class="hidden md:block text-2xl font-bold md:text-nowrap">{{ 'accueil.loyer'|trans }} {{ building.rent /100 }} euros</h2>    
  328.             {% endif %}
  329.             <div class="md:mt-10">
  330.                 <div class="md:grid md:grid-cols-4 md:gap-4 items-start">
  331.                     <div class="col-span-3">
  332.                         <div class="flex flex-col mb-6">
  333.                             <div class="mt-3 md:text-center">
  334.                                 <h3 class="  md:hidden text-lg text-gray-500">{{ building.cityEntity.city ~ ", " ~ building.cityEntity.country }}</h3>
  335.                                 {# <h3 class="hidden md:block text-lg text-gray-500">{{ 'accueil.add'|trans }}{{ building.createdAt|date('d/m/y H:i') }}</h3> #}
  336.                             </div>
  337.                             
  338.                         </div>
  339.                         <hr class="my-6 border-gray-300">
  340.                         <h1 class="text-2xl font-bold">{{ 'accueil.description'|trans }}</h1>
  341.                         <div style="width: 95%" class="my-6">
  342.                             <p id="description" class="text-sm line-clamp-[5]">
  343.                                 {{ building.description|nl2br }}
  344.                             </p> <br>
  345.                             {% if building.description|length > 800 %}
  346.                                 <button id="showMoreDescription"
  347.                                     class="underline font-bold cursor-pointer"
  348.                                     data-more="{{ 'building.savoirplus'|trans }}"
  349.                                     data-less="{{ 'building.savoirmoins'|trans }}">
  350.                                     {{ 'building.savoirplus'|trans }}
  351.                                 </button>
  352.                             {% endif %}            
  353.                             <div class="mt-6">                            
  354.                                 {% for document in building.buildingDocuments %}
  355.                                     {% if document.name == "houseRules" %}
  356.                                             <h1 class="mb-3 text-2xl font-bold">{{ 'building.houseRules'|trans }}</h1>
  357.                                             {% if document.imageFile|split('.')[1] == "pdf" %}
  358.                                                 <a class="" target="_blank" href="{{ asset('/images/files/' ~ document.imageFile) }}">
  359.                                                                 <img class="img-fluid mx-auto justify-center" style="max-width: 50px; max-height: 50px"
  360.                                                                 src="{{ asset('/images/site/pdf.png') }}" alt="">
  361.                                                             </a>
  362.                                             {% else %}
  363.                                                 <a class="" target="_blank" href="{{ asset('/images/files/' ~ document.imageFile) }}">
  364.                                                 <img class="w-25 rounded" src="{{ asset('images/files/') }}{{ document.imageFile }}" alt="">
  365.                                                 </a>
  366.                                             {% endif %}
  367.                                     {% endif %}
  368.                                 {% endfor %}
  369.                             </div>
  370.                         </div>
  371.                         <hr class="my-6 border-gray-300">
  372.                         {# {% if building.buildingEquipment is not empty %}
  373.                             <div class="my-10">
  374.                                 <h1 class="text-2xl font-bold">{{ 'accueil.equipement'|trans }}</h1>
  375.                                 <div class="grid grid-cols-2 gap-2 my-6 text-sm">
  376.                                     {% for equipment in building.buildingEquipment %}
  377.                                         <div class="flex items-center">
  378.                                             <div>
  379.                                                 <i class="mr-2 p-2 fa-solid fa-arrow-right text-black z-30 justify-center items-center h-full icon focus:outline-none"></i>
  380.                                             </div>
  381.                                             <div>
  382.                                                 <span>{{ equipment.name|trans }}</span>
  383.                                             </div>
  384.                                         </div>
  385.                                     {% endfor %}
  386.                                 </div>
  387.                             </div>
  388.                         {% endif %} #}
  389.                         {% if building.interior is not empty %}
  390.                             <div class="my-10">
  391.                                 <h1 class="text-2xl font-bold">{{ 'accueil.equipementInterior'|trans }}</h1>
  392.                                 <div class="grid grid-cols-2 gap-2 my-6 text-sm">
  393.                                     {% for equipment in building.interior %}
  394.                                         <div class="flex items-center">
  395.                                             <div>
  396.                                                 <i class="mr-2 p-2 fa-solid fa-arrow-right text-black z-30 justify-center items-center h-full icon focus:outline-none"></i>
  397.                                             </div>
  398.                                             <div>
  399.                                                 <span>{{equipment|trans }}</span>
  400.                                             </div>
  401.                                         </div>
  402.                                     {% endfor %}
  403.                                 </div>
  404.                             </div>
  405.                         {% endif %}
  406.                         {% if building.exterior is not empty %}
  407.                             <div class="my-10">
  408.                                 <h1 class="text-2xl font-bold">{{ 'accueil.equipementExterior'|trans }}</h1>
  409.                                 <div class="grid grid-cols-2 gap-2 my-6 text-sm">
  410.                                     {% for equipment in building.exterior %}
  411.                                         <div class="flex items-center">
  412.                                             <div>
  413.                                                 <i class="mr-2 p-2 fa-solid fa-arrow-right text-black z-30 justify-center items-center h-full icon focus:outline-none"></i>
  414.                                             </div>
  415.                                             <div>
  416.                                                 <span>{{ equipment|trans }}</span>
  417.                                             </div>
  418.                                         </div>
  419.                                     {% endfor %}
  420.                                 </div>
  421.                             </div>
  422.                         {% endif %}
  423.                         <hr class=" md:hidden my-6 border-gray-300">
  424.                         <div class=" md:hidden my-10">
  425.                             <div class="grid grid-cols-2 gap-2 text-sm">
  426.                                 
  427.                                 <div class="justify-center items-center h-full content-center">
  428.                                     <h3 class="text-2xl mb-2 text-base"><b>{{ building.rent / 100 }}
  429.                                         € </b>{{ 'accueil.parmois'|trans }}</h3>
  430.                                         <span class="text-sm">({{ 'building.dont'|trans }}{{ building.expenses / 100 }}{{ 'building.charges'|trans }})</span>
  431.                                     
  432.                                     {% if building.dateStartAt is not null %}
  433.                                         <p class="mt-6 ">{{'building.dispo'|trans}}
  434.                                             <span id="dateStartAt">{{ building.dateStartAt|date('d/m/Y') }}</span></p>
  435.                                     {% else %}
  436.                                         <p>{{'building.nodispo'|trans}}</p>
  437.                                     {% endif %}
  438.                                     {% if building.isAidEligible %}
  439.                                         <div class="mt-6 ">
  440.                                             <span class="font-bold text-xs leading-[1] ">{{ 'building.cafeligible'|trans }}</span>
  441.                                         </div>
  442.                                     {% endif %}
  443.                                 </div>
  444.                                 <div class="justify-center items-center h-full content-center">
  445.                                     {% if app.user %}
  446.                                         {% if "ROLE_TENANT" in app.user.roles %}
  447.                                             {% if app.user.isRegistrationFinalized %}
  448.                                                 {% if building.isActive %}
  449.                                                     <div class="d-flex justify-content-center flex flex-wrap justify-between items-center">
  450.                                                         <a href="{{ path('edit-user', {id: app.user.id}) }}{{ building is defined and building|length > 0 ? '?buildingId=' ~ building.id : '' }}" style="background-color: #ffcc00; align-self: center; padding-right: 10px;" type="button" class="text-black w-full font-medium rounded-md text-sm pr-5 pl-2.5 md:pr-5 pl-2 py-2 text-center mb-3 md:mb-0 md:mr-3">
  451.                                                             <i class="fa-solid fa-file text-white"></i>
  452.                                                             <span class="inline">{{ 'building.deposerdemande'|trans }}</span>
  453.                                                         </a>
  454.                                                     </div>
  455.                                                     
  456.                                                 {% else %}
  457.                                                     <div class="d-flex justify-content-center flex flex-wrap justify-between items-center">
  458.                                                         <a style="background-color:rgb(149 148 144); align-self: center; padding-right: 10px; cursor: default;" type="button" class="text-black w-full font-medium rounded-md text-sm pr-5 pl-2.5 md:pr-5 pl-2 py-2 text-center mb-3 md:mb-0 md:mr-3">
  459.                                                             <i class="fa-solid fa-xmark text-white"></i>
  460.                                                             <span class="inline">{{ 'building.nondispo'|trans }}</span>
  461.                                                         </a>
  462.                                                     </div>
  463.                                                 {% endif %}
  464.                                                     <div class="mt-6">
  465.                                                         
  466.                                                         {# <a href="{{ path('building_reporting',{id : building.id}) }}" class="text-gray-400 w-full font-medium rounded-md text-sm text-center">
  467.                                                             <p class="inline-block">
  468.                                                                 <img src="{{ asset('/images/icons/Signaler.png') }}" height="30px" width="30px" class="fa-sharp fa-solid fa-door-open p-1 rounded-lg"/>
  469.                                                                 <span class="underline">{{ 'accueil.signalernannonce'|trans }}</span>
  470.                                                             </p>
  471.                                                         </a> #}
  472.                                                     </div>
  473.                                             {% else %}
  474.                                                 <div class="d-flex justify-content-center flex flex-wrap justify-between items-center">
  475.                                                     <a href="{{ path('edit-user', {id: app.user.id}) }}?buildingId={{ building.id }}" class="bg-[#ffcc00] d-flex justify-content-center inline-block text-black  w-full  font-medium rounded-md text-md px-3 py-2 text-center mb-3">
  476.                                                         <span class="inline">{{ 'building.deposerdemande'|trans }}</span>
  477.                                                     </a>
  478.                                                 </div>
  479.                                             {% endif %}
  480.                                         {% endif %}
  481.                                     {% else %}
  482.                                         <div class="d-flex justify-content-center flex flex-wrap justify-between items-center">
  483.                                                 <button onclick="window.location.href='{{ path('app_login_site') }}?before=' + encodeURIComponent(window.location.href)" class="bg-[#ffcc00] d-flex justify-content-center inline-block text-black w-full font-medium rounded-md text-md sm:px-5 sm:py-3 px-3 py-2 text-center mb-3 md:mb-0 md:mr-3">
  484.                                                     <span class="inline">{{ 'building.deposerdemande'|trans }}</span>
  485.                                                 </button>
  486.                                             </div>
  487.                                     {% endif %}
  488.                                     <a href="{{ path('building_reporting',{id : building.id}) }}" class=" text-gray-400 w-full font-medium rounded-md text-sm text-center">
  489.                                         <p>
  490.                                             <span class="underline">{{ 'accueil.signalernannonce'|trans }}</span>
  491.                                         </p>
  492.                                     </a>
  493.                                 </div>
  494.                             </div>
  495.                         </div>
  496.                     {#    <hr class="my-6 border-gray-300">
  497.                         <p class="container my-10">
  498.                             <img class="h-12" src="{{ asset('/images/site/garantme.png') }}" alt="">
  499.                         </p>
  500.                         <p>
  501.                             {{ 'accueil.garantme1'|trans }}<br>
  502.                             {{ 'accueil.garantme2'|trans }}
  503.                             <br> <br>
  504.                             <div class="mt-6">
  505.                                 <button type="button" onclick="changeState()" class="text-gray-800 font-bold w-full underline font-medium rounded-md text-sm py-2.5 text-center mr-3 md:mr-0">
  506.                                     <span>{{ 'accueil.more'|trans }}</span>
  507.                                 </button>
  508.                             </div>
  509.                             <div id="garant-me-text" class="hidden">
  510.                                 <span class="font-bold">{{ 'accueil.aquoicasert'|trans }}</span>
  511.                                 <br>
  512.                                 <ul>
  513.                                     <li>
  514.                                         {{ 'accueil.gracea'|trans }}<br>
  515.                                     </li>
  516.                                     <li>
  517.                                         {{ 'accueil.gracea2'|trans }}<br>
  518.                                     </li>
  519.                                 </ul>
  520.                                 <br>
  521.                                 <span class="font-bold">{{ 'accueil.commentfaire'|trans }}</span>
  522.                                 <br>
  523.                                 {{ 'accueil.inscription'|trans }}
  524.                                 <br>
  525.                                 <br>
  526.                                 <span class="font-bold">{{ 'accueil.howmuch'|trans }}</span>
  527.                                 <br>
  528.                                 <br>
  529.                                 {{ 'accueil.explication1'|trans }}<br>
  530.                                 <br>
  531.                                 {{ 'accueil.explication2'|trans }}<br>
  532.                                 <br>
  533.                                 {{ 'accueil.explication3'|trans }}<br><br>
  534.                             </div>
  535.                         </p>
  536.                         #}                        
  537.                         <div id="zoomContainer" style="display: none;">
  538.                             <img id="zoomImg" src"" class="" alt="ImageZoom" style="max-width: 100%; max-height: 100%;">
  539.                             <button onclick="closeZoomImage()" id="closeButton" class="close-button">&times;</button>
  540.                         </div>
  541.                         {% if building.complexProperty %}
  542.                         <p class="text-2xl m-2">
  543.     <strong>
  544.         {{ buildingsInComplex|length > 1 
  545.             ? 'accueil.rooms'|trans 
  546.             : 'accueil.room'|trans 
  547.         }}
  548.     </strong>
  549. </p>
  550.                         <div style="width: 95%" class="relative border border-gray-300 hover:border-blue-500 shadow-2xl rounded p-6">
  551.                             <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
  552.                                 {% for loopIndex, building in buildingsInComplex %}
  553.                                 {% if loopIndex % 4 == 0 and loopIndex != 0 %}
  554.                             </div>
  555.                             <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
  556.                                 {% endif %}
  557.                                 <div class="w-full text-center">
  558.                                     {% if building.buildingDocuments is not empty %}
  559.                                     {% set filteredDocuments = building.buildingDocuments|filter(document => document.name starts with 'file') %}
  560.                                     {% if filteredDocuments is not empty %}
  561.                                     <div id="carousel-{{ building.id }}" class="relative z-0 w-full" data-carousel="static">
  562.                                         <div class="overflow-hidden relative h-[20rem] md:h-[10rem] lg:h-[20rem] flex mt-10">
  563.                                             {% for document in filteredDocuments %}
  564.                                             {% if document.imageFile %}
  565.                                             <div onclick="zoomImage('{{ document.imageFile }}')" class="rounded-xl max-h-[800px] bg-[url({{ asset('images/files/' ~ document.imageFile) }})] bg-cover bg-no-repeat bg-center w-full duration-700 ease-in-out {% if loop.first %}active{% endif %}" data-carousel-item></div>
  566.                                             {% endif %}
  567.                                             {% endfor %}
  568.                                         </div>
  569.                                         <button type="button" class="flex absolute top-0 left-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none" data-carousel-prev>
  570.                                             <span class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30  group-hover:bg-white/50  group-focus:ring-4 group-focus:ring-white  group-focus:outline-none">
  571.                                                 <svg class="w-5 h-5 text-white sm:w-6 sm:h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path></svg>
  572.                                                 <span class="hidden">Previous</span>
  573.                                             </span>
  574.                                         </button>
  575.                                         <button type="button" class="flex absolute top-0 right-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none" data-carousel-next>
  576.                                             <span class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30  group-hover:bg-white/50  group-focus:ring-4 group-focus:ring-white  group-focus:outline-none">
  577.                                                 <svg class="w-5 h-5 text-white sm:w-6 sm:h-6 " fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg>
  578.                                                 <span class="hidden">Next</span>
  579.                                             </span>
  580.                                         </button>
  581.                                         <div class="flex absolute bottom-5 left-1/2 z-30 space-x-3 -translate-x-1/2">
  582.                                             {% for document in filteredDocuments %}
  583.                                             {% if document.imageFile %}
  584.                                             <button type="button" style="border: 1px grey solid;" class="w-3 h-3 rounded-full border-black" aria-current="false" aria-label="Slide {{ building.id }}" data-carousel-slide-to="{{ loop.index0 }}"></button>
  585.                                             {% endif %}
  586.                                             {% endfor %}
  587.                                         </div>
  588.                                     </div>
  589.                                     {% else %}
  590.                                     <p>No images</p>
  591.                                     {% endif %}
  592.                                     {% else %}
  593.                                     <p>No documents available for this building.</p>
  594.                                     {% endif %}
  595.                                     <div class="mb-4">
  596.                                         <p class="text-2xl m-2">
  597.                                             <strong>{{ 'accueil.room'|trans }} {{ loop.index }}</strong>
  598.                                         </p>
  599.                                         <p>
  600.                                             <strong>{{ 'accueil.superfi'|trans }}</strong> {{ building.surfaceBedroom }} m²
  601.                                         </p>
  602.                                         <p>
  603.                                             <strong>{{ 'accueil.loyermen'|trans }}</strong> {{ building.rent / 100 }} euros
  604.                                         </p>
  605.                                         <p>
  606.                                             <strong>{{ 'accueil.privbath'|trans }}</strong> {{ building.privateBathroom ? 'Oui'|trans : 'Non'|trans }}
  607.                                         </p>
  608.                                         <p>
  609.                                             <strong>{{ 'accueil.bed'|trans }}</strong> {{ building.typeBed }}
  610.                                         </p>
  611.                                         <p>
  612.                                             {% if building.isActive %}
  613.                                                 <strong>{{ 'accueil.startloc'|trans }}</strong> {{ building.dateStartAt|date('d/m/Y') }}
  614.                                             {% else %}
  615.                                                 &nbsp;
  616.                                             {% endif %}
  617.                                         </p>
  618.                                     </div>
  619.                                     {% if app.user %}
  620.                                     {% if "ROLE_TENANT" in app.user.roles %}
  621.                                     {% if app.user.isRegistrationFinalized %}
  622.                                     {% if building.isActive %}
  623.                                     <div class="d-flex justify-content-center flex flex-wrap justify-between items-center m-3.1">
  624.                                         <a href="{{ path('edit-user', {id: app.user.id}) }}{{ building is defined and building|length > 0 ? '?buildingId=' ~ building.id : '' }}" style="background-color: #ffcc00; align-self: center; padding-right: 10px; " type="button" class="text-black w-full font-medium rounded-md text-sm pr-5 pl-2.5 md:pr-5 pl-2 py-2 text-center mb-3 md:mb-0 md:mr-3">
  625.                                             <span class="inline">{{ 'building.deposerdemandeChambre'|trans }}</span>
  626.                                         </a>
  627.                                     </div>
  628.                                     {% else %}
  629.                                     <div class="d-flex justify-content-center flex flex-wrap justify-between items-center  mt-4">
  630.                                         <a style="background-color:rgb(149 148 144); align-self: center; padding-right: 10px;" type="button" class="text-black w-full font-medium rounded-md text-sm pr-5 pl-2.5 md:pr-5 pl-2 py-2 text-center mb-3 md:mb-0 md:mr-3">
  631.                                             <i class="fa-solid fa-xmark text-white"></i>
  632.                                             <span class="inline">{{ 'building.nondispo'|trans }}</span>
  633.                                         </a>
  634.                                     </div>
  635.                                     {% endif %}
  636.                                     {% else %}
  637.                                     <div class="d-flex justify-content-center flex flex-wrap justify-between items-center m-3.1">
  638.                                         <a href="{{ path('edit-user', {id: app.user.id}) }}?buildingId={{ building.id }}" class="bg-[#ffcc00] d-flex justify-content-center inline-block text-black  w-full font-medium rounded-md text-md px-3 py-2 text-center mb-3">
  639.                                             <span class="inline">{{ 'building.deposerdemande'|trans }}</span>
  640.                                         </a>
  641.                                     </div>
  642.                                     {% endif %}
  643.                                     {% endif %}
  644.                                     {% else %}
  645.                                     <div class="d-flex justify-content-center flex flex-wrap justify-between items-center m-3.1">
  646.                                         <button onclick="window.location.href='{{ path('app_login_site') }}?before=' + encodeURIComponent(window.location.href)" class="bg-[#ffcc00] d-flex justify-content-center inline-block text-black w-full font-medium rounded-md text-md sm:px-5 sm:py-3 px-3 py-2 text-center mb-3 md:mb-0 md:mr-3">
  647.                                             <span class="inline">{{ 'building.deposerdemande'|trans }}</span>
  648.                                         </button>
  649.                                     </div>
  650.                                     {% endif %}
  651.                                 </div>
  652.                                 {% endfor %}
  653.                             </div>
  654.                             {% if buildingsInComplex|length % 4 != 0 %}
  655.                             <div class="grid grid-cols-1 sm:grid-cols-2 gap-4"></div>
  656.                             {% endif %}
  657.                         </div>
  658.                         {% endif %}
  659.                             {% if building and not building.hideAddress == true %}
  660.                                 <div class="my-10">
  661.                                     <h1 class="text-2xl font-bold">{{ 'accueil.whereis'|trans }}</h1>
  662.                                     <h3 class="text-sm text-gray-500 mt-2">{{ building.streetNumber }} {{ building.street }} {{ building.cityEntity.city }} {{ building.cityEntity.postalCode }},{{ building.cityEntity.country }}</h3>
  663.                                     
  664.                                     <input placeholder="{{ 'building.inputAddressDistance'|trans({}, 'messages') }}" type="text" id="addressDistanceInput" name="addressDistanceInput" style="padding: 10px; width: 95%; border: 1px solid #ccc; border-radius: 5px; margin-top: 10px">
  665.                                     <div id="addressDistance" style="display: none; margin-top: 15px"></div>
  666.                                     
  667.                                     <div class=" relative flex mx-auto text-center justify-center mt-5" style="width: 95%">
  668.                                         {% if  building.lat !=null or building.lng !=null %}
  669.                                             <button id="mapGoogle" onclick="showMap()" type="button" class="absolute z-[1000000000] text-white top-[48%] bg-gray-900 w-[200] hover:bg-gray-800 font-medium rounded-full text-sm px-4 py-2.5 text-center mr-3 md:mr-0">
  670.                                                 <i class="fa-solid fa-map-pin"></i>
  671.                                                 {{ 'accueil.affichercarte'|trans }}
  672.                                             </button>
  673.                                             <div id="map"></div>
  674.                                         {% else %}
  675.                                                 <button  type="button" class=" z-[1000000000]  absolute text-white top-1/3 bg-gray-900 hover:bg-gray-800 font-medium rounded-full text-sm p-2 text-center">
  676.                                                 <i class="fa-solid fa-map-pin"></i>
  677.                                                 {{ 'accueil.mapNotFound'|trans }}
  678.                                             </button>
  679.                                         {% endif %}
  680.                                     </div>
  681.                                 </div>
  682.                             {% endif %}
  683.                     </div>
  684.                     
  685.                     <div class="hidden md:block col-span-4 sm:col-span-1 shadow-2xl rounded p-6 h-auto w-full">
  686.                         <span class="text-2xl font-bold">{{ 'accueil.detail'|trans }}</span>
  687.                         <div class="flex flex-col justify-between">
  688.                             <div class="mt-2">
  689.                                 <span><strong>{{ 'accueil.ref'|trans }}:</strong> {{building.RefBuilding}}</span>
  690.                             </div>
  691.                             <div class="mt-2">
  692.                                 <span><strong>{{ 'accueil.city'|trans }}:</strong> {{  building.cityEntity.city}}, {{  building.cityEntity.country}}</span>
  693.                             </div>
  694.                             {# {% if building.complexProperty %}
  695.                             <div class="mt-2">
  696.                                 <span><strong>{{ "Chambre n°" }}{{  building.bedroomNumber}}</strong></span>
  697.                             </div>
  698.                             {% endif %} #}
  699.                             {% if building.complexProperty %}
  700.                                 <div class="mt-2">
  701.                                     <span><strong>{{ 'accueil.loyer'|trans }}</strong> {{lowestRent /100}}€</span>
  702.                                 </div>
  703.                                 
  704.                                 <div class="mt-2">
  705.                                     <span><strong>{{ 'accueil.charge'|trans }}</strong> </br> <span>{{ building.expenses / 100 }}€</span></span>
  706.                                 </div>
  707.                                 
  708.                                 
  709.                             {% else %}
  710.                                 <div>
  711.                                     <div class="mt-2">
  712.                                         <h3 class="text-2xl text-base"><b>{{ building.rent / 100 }}€ </b>{{ 'accueil.parmois'|trans }}</h3>
  713.                                         <span class="text-sm">({{ 'building.dont'|trans }}{{ building.expenses / 100 }}{{ 'building.charges'|trans }})</span>
  714.                                     </div>                                    
  715.                                     {# {% if building.expenses != null %}
  716.                                         <div>
  717.                                             <div class="grid grid-cols-2 gap-2 my-6">
  718.                                                 {% if building.expensesDescription is not empty %}
  719.                                                     <span class="text-sm">{{ 'building.comprennent'|trans }}</span>
  720.                                                     <br>
  721.                                                     {% for expense in building.expensesDescription|split(',') %}
  722.                                                         <div class="flex items-center">
  723.                                                             <div>
  724.                                                                 <i class="mr-2 p-2 fa-solid fa-arrow-right text-black z-30 justify-center items-center h-full icon focus:outline-none"></i>
  725.                                                             </div>
  726.                                                             <div>
  727.                                                                 <span>{{ expense|trans }}</span>
  728.                                                             </div>
  729.                                                         </div>
  730.                                                     {% endfor %}
  731.                                                 {% endif %}
  732.                                             </div>
  733.                                         </div>
  734.                                     {% endif %} #}
  735.                                 </div>
  736.                             {% endif %}
  737.                             
  738.                             <div class="mt-2">
  739.                                 <span><strong>{{ 'admin.surface'|trans }}:</strong> {{building.surface}} m²</span>
  740.                             </div>
  741.                             
  742.                                 {% if building.isFurniture %}
  743.                                     <div class="mt-2">
  744.                                         <span><strong>{{ 'building.FurnishedAccommodation'|trans }}</strong></span>
  745.                                     </div>
  746.                                 {% endif %}
  747.                                 
  748.                                 {% if building.isFloor %}
  749.                                     <div class="mt-2">
  750.                                         <span><strong>{{ 'building.floor'|trans }}</strong> {{ building.floor}}</span>
  751.                                     </div>
  752.                                 {% else %}
  753.                                     <div class="mt-2">
  754.                                         <span><strong>{{ 'building.notFloor'|trans }}</strong></span>
  755.                                     </div>
  756.                                 {% endif %}
  757.                                 
  758.                                 {% if building.complexProperty %}
  759.                                     {% if building.privateBathroom %}
  760.                                         <div class="mt-2">
  761.                                             <span><strong>{{ 'building.privateBathroom'|trans }}</strong></span>
  762.                                         </div>
  763.                                     {% else %}
  764.                                         <div class="mt-2">
  765.                                             <span><strong>{{ 'building.notPrivateBathroom'|trans }}</strong></span>
  766.                                         </div>
  767.                                     {% endif %}
  768.                                 {% else %}
  769.                                     {% if building.bathrooms >0 %}
  770.                                         <div class="mt-2">
  771.                                             <span><strong>{{ building.bathrooms }} {{ 'building.sdb'|trans }}</strong></span>
  772.                                         </div>
  773.                                     {% endif %}
  774.                                 {% endif %}
  775.                                 {% if building.complexProperty %}
  776.                                     <div class="mt-2">
  777.                                         <span><strong>{{'building.dispo'|trans}} </strong> </br> <span> {% if earlyLocation %}{{'building.dateStartAt'|trans}} {{ earlyLocation|date('d/m/Y') }}{% endif %}</span></span>
  778.                                     </div>
  779.                                 {% else %}
  780.                                     {% if building.dateStartAt is not null %}
  781.                                     <div class="mt-2">
  782.                                         <span><strong>{{'building.dispo'|trans}}</strong> {{ building.dateStartAt|date('d/m/Y') }}</span>
  783.                                     </div>
  784.                                     {% else %}
  785.                                         <p>{{'building.nodispo'|trans}}</p>
  786.                                     {% endif %}
  787.                                 {% endif %}
  788.                                 
  789.                                 {% if building.isAidEligible %}
  790.                                     <div class="mt-2">
  791.                                         <span><strong>{{ 'building.cafeligible'|trans }}</strong></span>
  792.                                     </div>
  793.                                 {% endif %}
  794.                                 {% if building.charges is not empty %}
  795.                                     <div class="my-5">
  796.                                         <h1 class="text-2xl font-bold">{{ 'accueil.Fees'|trans }}</h1>
  797.                                         <div class="grid grid-cols-2 gap-2 my-2 text-sm">
  798.                                             {% for fees in building.charges %}
  799.                                                 <div class="flex items-center">
  800.                                                     <div>
  801.                                                         <span><i class="fa-solid fa-check"></i> {{ fees|trans }}</span>
  802.                                                     </div>
  803.                                                 </div>
  804.                                             {% endfor %}
  805.                                         </div>
  806.                                     </div>
  807.                                 {% endif %}
  808.                                 {% if building.houseRules is not empty %}
  809.                                     <div class="my-5">
  810.                                         <h1 class="text-2xl font-bold">{{ 'accueil.houseRules'|trans }}</h1>
  811.                                         <div class="grid grid-cols-2 gap-2 my-2 text-sm">
  812.                                             {% for rule in building.houseRules %}
  813.                                                 <div class="flex items-center">
  814.                                                     <div>
  815.                                                         <span><i class="fa-solid fa-check"></i> {{ rule|trans }}</span>
  816.                                                     </div>
  817.                                                 </div>
  818.                                             {% endfor %}
  819.                                         </div>
  820.                                     </div>
  821.                                 {% endif %}
  822.                             <div class="mt-6">
  823.                                 {% if app.user %}
  824.                                     {% if "ROLE_TENANT" in app.user.roles %}
  825.                                         {% if app.user.isRegistrationFinalized %}
  826.                                             {% if not building.complexProperty %}
  827.                                                 {% if building.isActive %}
  828.                                                     <div class="d-flex justify-content-center flex flex-wrap justify-between items-center">
  829.                                                         <a href="{{ path('edit-user', {id: app.user.id}) }}{{ building is defined and building|length > 0 ? '?buildingId=' ~ building.id : '' }}" style="background-color: #ffcc00; align-self: center; padding-right: 10px;" type="button" class="text-black w-full font-medium rounded-md text-sm pr-5 pl-2.5 md:pr-5 pl-2 py-2 text-center mb-3 md:mb-0 md:mr-3">
  830.                                                             <i class="fa-solid fa-file text-white"></i>
  831.                                                             <span class="hidden md:inline">{{ 'building.deposerdemande'|trans }}</span>
  832.                                                         </a>
  833.                                                     </div>
  834.                                                 {% else %}
  835.                                                     <div class="d-flex justify-content-center flex flex-wrap justify-between items-center">
  836.                                                         <a  style="background-color:rgb(149 148 144); align-self: center; padding-right: 10px;" type="button" class="text-black w-full font-medium rounded-md text-sm pr-5 pl-2.5 md:pr-5 pl-2 py-2 text-center mb-3 md:mb-0 md:mr-3">
  837.                                                             <i class="fa-solid fa-xmark text-white"></i>
  838.                                                             <span class="hidden md:inline">{{ 'building.nondispo'|trans }}</span>
  839.                                                         </a>
  840.                                                     </div>
  841.                                                 {% endif %}
  842.                                             {% endif %}
  843.                                                 {# <div class="mt-6">
  844.                                                     <a href="{{ path('building_reporting',{id : building.id}) }}" class="text-gray-400 w-full font-medium rounded-md text-sm text-center">
  845.                                                         <p class="hidden sm:inline-block">
  846.                                                             <img src="{{ asset('/images/icons/Signaler.png') }}" height="30px" width="30px" class="fa-sharp fa-solid fa-door-open p-1 rounded-lg"/>
  847.                                                             <span class="underline">{{ 'accueil.signalernannonce'|trans }}</span>
  848.                                                         </p>
  849.                                                     </a>
  850.                                                 </div> #}
  851.                                         {% else %}
  852.                                             {% if not building.complexProperty %}
  853.                                                 <div class="d-flex justify-content-center flex flex-wrap justify-between items-center">
  854.                                                     <a href="{{ path('edit-user', {id: app.user.id}) }}?buildingId={{ building.id }}" class="bg-[#ffcc00] d-flex justify-content-center inline-block text-black  w-full font-medium rounded-md text-md sm:px-5 sm:py-3 px-3 py-2 text-center mb-3 md:mb-0 md:mr-3">
  855.                                                         <span class="hidden md:inline">{{ 'building.deposerdemande'|trans }}</span>
  856.                                                     </a>
  857.                                                 </div>
  858.                                             {% endif %}
  859.                                         {% endif %}
  860.                                     {% endif %}
  861.                                 {% else %}
  862.                                     <div class="d-flex justify-content-center flex flex-wrap justify-between items-center">
  863.                                             <button onclick="window.location.href='{{ path('app_login_site') }}?before=' + encodeURIComponent(window.location.href)" class="bg-[#ffcc00] d-flex justify-content-center inline-block text-black w-full font-medium rounded-md text-md sm:px-5 sm:py-3 px-3 py-2 text-center mb-3 md:mb-0 md:mr-3">
  864.                                                 <span class="hidden md:inline">{{ 'building.deposerdemande'|trans }}</span>
  865.                                             </button>
  866.                                         </div>
  867.                                 {% endif %}
  868.                                 <br>
  869.                                 <div class="mt-6 mb-5">
  870.                                     {% if building.DEP != null %}
  871.                                         <div class="mt-6">
  872.                                             <h1 class="text-2xl font-bold">DPE ({{'building.dpe'|trans}})</h1>
  873.                                             <br>
  874.                                             <div class='grid grid-cols-8 gap-1 text-center align-middle'>
  875.                                             
  876.                                                     {% if building.DEP == 'A' %}
  877.                                                         <span id="dpe" class=" DPE-bar-A text-2xl font-bold rounded-l-lg">A</span>
  878.                                                         <span id="dpe" class=" DPE-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  879.                                                         <span id="dpe" class=" DPE-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  880.                                                         <span id="dpe" class=" DPE-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  881.                                                         <span id="dpe" class=" DPE-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  882.                                                         <span id="dpe" class=" DPE-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  883.                                                         <span id="dpe" class=" DPE-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  884.                                                     {% elseif building.DEP ==  'B' %}
  885.                                                         <span id="dpe" class=" DPE-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  886.                                                         <span id="dpe" class=" DPE-bar-B text-2xl font-bold ">B</span>
  887.                                                         <span id="dpe" class=" DPE-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  888.                                                         <span id="dpe" class=" DPE-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  889.                                                         <span id="dpe" class=" DPE-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  890.                                                         <span id="dpe" class=" DPE-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  891.                                                         <span id="dpe" class=" DPE-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  892.                                                     {% elseif building.DEP == 'C' %}
  893.                                                         <span id="dpe" class=" DPE-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  894.                                                         <span id="dpe" class=" DPE-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  895.                                                         <span id="dpe" class=" DPE-bar-C text-2xl font-bold">C</span>
  896.                                                         <span id="dpe" class=" DPE-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  897.                                                         <span id="dpe" class=" DPE-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  898.                                                         <span id="dpe" class=" DPE-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  899.                                                         <span id="dpe" class=" DPE-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  900.                                                     {% elseif building.DEP == 'D' %}
  901.                                                         <span id="dpe" class=" DPE-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  902.                                                         <span id="dpe" class=" DPE-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  903.                                                         <span id="dpe" class=" DPE-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  904.                                                         <span id="dpe" class=" DPE-bar-D text-2xl font-bold">D</span>
  905.                                                         <span id="dpe" class=" DPE-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  906.                                                         <span id="dpe" class=" DPE-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  907.                                                         <span id="dpe" class=" DPE-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  908.                                                     {% elseif building.DEP == 'E' %}
  909.                                                         <span id="dpe" class=" DPE-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  910.                                                         <span id="dpe" class=" DPE-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  911.                                                         <span id="dpe" class=" DPE-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  912.                                                         <span id="dpe" class=" DPE-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  913.                                                         <span id="dpe" class=" DPE-bar-E text-2xl font-bold">E</span>
  914.                                                         <span id="dpe" class=" DPE-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  915.                                                         <span id="dpe" class=" DPE-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  916.                                                     {% elseif building.DEP == 'F' %}
  917.                                                         <span id="dpe" class=" DPE-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  918.                                                         <span id="dpe" class=" DPE-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  919.                                                         <span id="dpe" class=" DPE-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  920.                                                         <span id="dpe" class=" DPE-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  921.                                                         <span id="dpe" class=" DPE-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  922.                                                         <span id="dpe" class=" DPE-bar-F text-2xl font-bold">F</span>
  923.                                                         <span id="dpe" class=" DPE-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>    
  924.                                                     {% elseif building.DEP == 'G' %}
  925.                                                         <span id="dpe" class=" DPE-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  926.                                                         <span id="dpe" class=" DPE-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  927.                                                         <span id="dpe" class=" DPE-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  928.                                                         <span id="dpe" class=" DPE-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  929.                                                         <span id="dpe" class=" DPE-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  930.                                                         <span id="dpe" class=" DPE-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  931.                                                         <span id="dpe" class=" DPE-bar-G text-2xl font-bold rounded-r-lg">G</span>
  932.                                                     {% endif %}
  933.                                             </div>
  934.                                             {% if building.DEP == 'Vierge' %}
  935.                                                 <div class='text-center align-middle'>
  936.                                                     <span id="dpe" class="DPE-bar-V text-[20px] text-white rounded-r-lg p-2">Vierge</span>
  937.                                                 </div>
  938.                                             {% endif %}
  939.                                         </div>
  940.                                     {% endif %}
  941.                                     {% if building.GES != null %}
  942.                                         <div class="mt-6">
  943.                                             <h1 class="text-2xl font-bold">GES ({{'building.ges'|trans}})</h1>
  944.                                             <br>
  945.                                             <div class='grid grid-cols-8 gap-1 text-center align-middle'>
  946.                                                 
  947.                                                     {% if building.GES == 'A' %}
  948.                                                         <span id="ges" class=" GES-bar-A text-2xl font-bold rounded-l-lg">A</span>
  949.                                                         <span id="ges" class=" GES-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  950.                                                         <span id="ges" class=" GES-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  951.                                                         <span id="ges" class=" GES-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  952.                                                         <span id="ges" class=" GES-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  953.                                                         <span id="ges" class=" GES-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  954.                                                         <span id="ges" class=" GES-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  955.                                                     {% elseif building.GES ==  'B' %}
  956.                                                         <span id="ges" class=" GES-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  957.                                                         <span id="ges" class=" GES-bar-B text-2xl font-bold ">B</span>
  958.                                                         <span id="ges" class=" GES-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  959.                                                         <span id="ges" class=" GES-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  960.                                                         <span id="ges" class=" GES-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  961.                                                         <span id="ges" class=" GES-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  962.                                                         <span id="ges" class=" GES-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  963.                                                     {% elseif building.GES == 'C' %}
  964.                                                         <span id="ges" class=" GES-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  965.                                                         <span id="ges" class=" GES-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  966.                                                         <span id="ges" class=" GES-bar-C text-2xl font-bold">C</span>
  967.                                                         <span id="ges" class=" GES-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  968.                                                         <span id="ges" class=" GES-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  969.                                                         <span id="ges" class=" GES-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  970.                                                         <span id="ges" class=" GES-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  971.                                                     {% elseif building.GES == 'D' %}
  972.                                                         <span id="ges" class=" GES-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  973.                                                         <span id="ges" class=" GES-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  974.                                                         <span id="ges" class=" GES-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  975.                                                         <span id="ges" class=" GES-bar-D text-2xl font-bold">D</span>
  976.                                                         <span id="ges" class=" GES-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  977.                                                         <span id="ges" class=" GES-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  978.                                                         <span id="ges" class=" GES-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  979.                                                     {% elseif building.GES == 'E' %}
  980.                                                         <span id="ges" class=" GES-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  981.                                                         <span id="ges" class=" GES-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  982.                                                         <span id="ges" class=" GES-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  983.                                                         <span id="ges" class=" GES-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  984.                                                         <span id="ges" class=" GES-bar-E text-2xl font-bold">E</span>
  985.                                                         <span id="ges" class=" GES-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  986.                                                         <span id="ges" class=" GES-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  987.                                                     {% elseif building.GES == 'F' %}
  988.                                                         <span id="ges" class=" GES-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  989.                                                         <span id="ges" class=" GES-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  990.                                                         <span id="ges" class=" GES-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  991.                                                         <span id="ges" class=" GES-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  992.                                                         <span id="ges" class=" GES-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  993.                                                         <span id="ges" class=" GES-bar-F text-2xl font-bold">F</span>
  994.                                                         <span id="ges" class=" GES-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>    
  995.                                                     {% elseif building.GES == 'G' %}
  996.                                                         <span id="ges" class=" GES-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  997.                                                         <span id="ges" class=" GES-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  998.                                                         <span id="ges" class=" GES-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  999.                                                         <span id="ges" class=" GES-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  1000.                                                         <span id="ges" class=" GES-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  1001.                                                         <span id="ges" class=" GES-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  1002.                                                         <span id="ges" class=" GES-bar-G text-2xl font-bold rounded-r-lg">G</span>
  1003.                                                     {% endif %}
  1004.                                             </div>
  1005.                                             {% if building.GES == 'Vierge' %}
  1006.                                                 <div class='text-center align-middle'>
  1007.                                                     <span id="ges" class="GES-bar-V text-[20px] text-white rounded-r-lg p-2">Vierge</span>
  1008.                                                 </div>
  1009.                                             {% endif %}
  1010.                                         </div>
  1011.                                     {% endif %}
  1012.                                     {# {% if not building.complexProperty %}
  1013.                                         <div style="text-align: center; margin-top: 30px;">
  1014.                                             <button type="submit" id="submitButton" style="background-color: #fbcb04; color: black; font-weight: bold; padding: 12px 25px; border: none; border-radius: 5px; cursor: pointer; font-size: 16px;">Réserver ce logement</button>
  1015.                                         </div>
  1016.                                     {% endif %} #}
  1017.                                 </div>
  1018.                                 <a href="{{ path('building_reporting',{id : building.id}) }}" class=" hidden md:block text-gray-400 w-full font-medium rounded-md text-sm text-center">
  1019.                                 <p class="flex justify-center items-center h-full">
  1020.                                     <span class="underline">{{ 'accueil.signalernannonce'|trans }}</span>
  1021.                                 </p>
  1022.                             </a>
  1023.                             </div>
  1024.                         </div>
  1025.                     </div>
  1026.                 </div>
  1027.                 {% if similarProperties %}
  1028.                     <p class="text-2xl m-2"><strong>{{ 'accueil.log'|trans }}</strong></p>
  1029.                 <div style="width: 95%" class="relative border border-gray-300 hover:border-blue-500 shadow-2xl rounded p-6">
  1030.                     <div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
  1031.                         {% for loopIndex, building in similarProperties %}
  1032.                         {% if loopIndex % 43 == 0 and loopIndex != 0 %}
  1033.                     </div>
  1034.                     <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
  1035.                         {% endif %}
  1036.                         <div class="w-full text-center">
  1037.                             {% if building.buildingDocuments is not empty %}
  1038.                             {% set filteredDocuments = building.buildingDocuments|filter(document => document.name starts with 'file') %}
  1039.                             {% if filteredDocuments is not empty %}
  1040.                             <div id="carousel-{{ building.id }}" class="relative z-0 w-full" data-carousel="static">
  1041.                                 <div class="overflow-hidden relative h-[20rem] md:h-[10rem] lg:h-[20rem] flex mt-10">
  1042.                                     {% for document in filteredDocuments %}
  1043.                                         {% if document.imageFile %}
  1044.                                             <div onclick="zoomImage('{{ document.imageFile }}')" class="rounded-xl max-h-[800px] bg-[url({{ asset('images/files/' ~ document.imageFile) }})] bg-cover bg-no-repeat bg-center w-full duration-700 ease-in-out {% if loop.first %}active{% endif %}" data-carousel-item></div>
  1045.                                         {% endif %}
  1046.                                     {% endfor %}
  1047.                                 </div>
  1048.                                 <button type="button" class="flex absolute top-0 left-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none" data-carousel-prev>
  1049.                                     <span class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30  group-hover:bg-white/50  group-focus:ring-4 group-focus:ring-white  group-focus:outline-none">
  1050.                                         <svg class="w-5 h-5 text-white sm:w-6 sm:h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path></svg>
  1051.                                         <span class="hidden">Previous</span>
  1052.                                     </span>
  1053.                                 </button>
  1054.                                 <button type="button" class="flex absolute top-0 right-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none" data-carousel-next>
  1055.                                     <span class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30  group-hover:bg-white/50  group-focus:ring-4 group-focus:ring-white  group-focus:outline-none">
  1056.                                         <svg class="w-5 h-5 text-white sm:w-6 sm:h-6 " fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg>
  1057.                                         <span class="hidden">Next</span>
  1058.                                     </span>
  1059.                                 </button>
  1060.                                 <div class="flex absolute bottom-5 left-1/2 z-30 space-x-3 -translate-x-1/2">
  1061.                                     {% for document in filteredDocuments %}
  1062.                                     {% if document.imageFile %}
  1063.                                     <button type="button" style="border: 1px grey solid;" class="w-3 h-3 rounded-full border-black" aria-current="false" aria-label="Slide {{ building.id }}" data-carousel-slide-to="{{ loop.index0 }}"></button>
  1064.                                     {% endif %}
  1065.                                     {% endfor %}
  1066.                                 </div>
  1067.                             </div>
  1068.                             {% else %}
  1069.                                 <p>No images</p>
  1070.                             {% endif %}
  1071.                             {% else %}
  1072.                                 <p>No documents available for this building.</p>
  1073.                             {% endif %}
  1074.                             <p class="text-2xl m-2 break-words whitespace-normal">
  1075.                                 {% if building.title %}
  1076.                                     <strong>{{ building.title }}</strong>
  1077.                                 {% else %}
  1078.                                     &nbsp;
  1079.                                 {% endif %}
  1080.                             </p>
  1081.                             <p>
  1082.                                 <strong>{{ 'accueil.city'|trans }} :</strong> {{ building.cityEntity.city }}
  1083.                             </p>
  1084.                             <p>
  1085.                                 <strong>{{ 'accueil.superfi'|trans }}</strong> {{ building.surface }} m²
  1086.                             </p>
  1087.                             <p>
  1088.                                 <strong>{{ 'accueil.loyermen'|trans }}</strong> {{ building.rent / 100 }} euros
  1089.                             </p
  1090.                             <p>
  1091.                                 {% if building.isActive %}
  1092.                                     <strong>{{ 'accueil.startloc'|trans }}</strong> {{ building.dateStartAt|date('d/m/Y') }}
  1093.                                 {% else %}
  1094.                                     &nbsp;
  1095.                                 {% endif %}
  1096.                             </p>
  1097.                             
  1098.                             {% if app.user %}
  1099.                             {% if "ROLE_TENANT" in app.user.roles %}
  1100.                             {% if app.user.isRegistrationFinalized %}
  1101.                             {% if building.isActive %}
  1102.                                 <div class="d-flex justify-content-center flex flex-wrap justify-between items-center m-4">
  1103.                                     <a href="{{ path('detail_building', {id : building.id}) }}" style="background-color: #ffcc00; align-self: center; padding-right: 10px; " type="button" class="text-black w-full font-medium rounded-md text-sm pr-5 pl-2.5 md:pr-5 pl-2 py-2 text-center mb-3 md:mb-0 md:mr-3">
  1104.                                         <span class="inline">{{ 'accueil.plus'|trans }}</span>
  1105.                                     </a>
  1106.                                 </div>
  1107.                             {% else %}
  1108.                                 <div class="d-flex justify-content-center flex flex-wrap justify-between items-center m-4">
  1109.                                     <a style="background-color:rgb(149 148 144); align-self: center; padding-right: 10px;" type="button" class="text-black w-full font-medium rounded-md text-sm pr-5 pl-2.5 md:pr-5 pl-2 py-2 text-center mb-3 md:mb-0 md:mr-3">
  1110.                                         <i class="fa-solid fa-xmark text-white"></i>
  1111.                                         <span class="inline">{{ 'building.nondispo'|trans }}</span>
  1112.                                     </a>
  1113.                                 </div>
  1114.                             {% endif %}
  1115.                             {% else %}
  1116.                                 <div class="d-flex justify-content-center flex flex-wrap justify-between items-center m-4">
  1117.                                     <a href="{{ path('edit-user', {id: app.user.id}) }}?buildingId={{ building.id }}" class="bg-[#ffcc00] d-flex justify-content-center inline-block text-black w-full font-medium rounded-md text-md px-3 py-2 text-center mb-3">
  1118.                                         <span class="inline">{{ 'building.deposerdemande'|trans }}</span>
  1119.                                     </a>
  1120.                                 </div>
  1121.                             {% endif %}
  1122.                             {% endif %}
  1123.                             {% else %}
  1124.                             <div class="d-flex justify-content-center flex flex-wrap justify-between items-center m-4">
  1125.                                 <button onclick="window.location.href='{{ path('app_login_site') }}?before=' + encodeURIComponent(window.location.href)" class="bg-[#ffcc00] d-flex justify-content-center inline-block text-black w-full font-medium rounded-md text-md sm:px-5 sm:py-3 px-3 py-2 text-center mb-3 md:mb-0 md:mr-3">
  1126.                                     <span class="inline">{{ 'building.deposerdemande'|trans }}</span>
  1127.                                 </button>
  1128.                             </div>
  1129.                             {% endif %}
  1130.                         </div>
  1131.                         {% endfor %}
  1132.                     </div>
  1133.                     {% if buildingsInComplex|length % 3 != 0 %}
  1134.                         <div class="grid grid-cols-1 sm:grid-cols-2 gap-4"></div>
  1135.                     {% endif %}
  1136.                 </div>
  1137.                 {% endif %}
  1138.                 </div>
  1139.             </div>
  1140.         </div>
  1141.     </div>
  1142.     <div id="sharePopup" class="fixed inset-0 bg-black bg-opacity-50 flex justify-center items-center hidden">
  1143.         <div class="bg-white p-6 rounded-lg shadow-lg">
  1144.             <h2 class="text-xl font-bold mb-4">Partager ce logement via :</h2>
  1145.             <div class="flex flex-col items-center space-y-4">
  1146.                 <a href="mailto:?subject=Regardez ce logement&body=Voici un logement qui pourrait vous intéresser : {{ app.request.uri }}" target="_blank" class="p-2">
  1147.                     <img src="{{ asset('/images/email.png') }}" alt="Mail" class="w-8 h-8">
  1148.                 </a>
  1149.                 <a href="https://www.facebook.com/sharer/sharer.php?u={{ app.request.uri|url_encode }}" target="_blank" class="p-2">
  1150.                     <img src="{{ asset('/images/facebook.png') }}" alt="Facebook" class="w-8 h-8">
  1151.                 </a>
  1152.                 <a href="https://wa.me/?text=Voici un logement qui pourrait vous intéresser : {{ app.request.uri|url_encode }}" target="_blank" class="p-2">
  1153.                     <img src="{{ asset('/images/whatsapp.jfif') }}" alt="WhatsApp" class="w-8 h-8">
  1154.                 </a>
  1155.                 <button onclick="copyToClipboard('{{ app.request.uri }}')" class="p-2">
  1156.                     <img src="{{ asset('/images/link.png') }}" alt="Copy" class="w-8 h-8">
  1157.                 </button>
  1158.             </div>
  1159.             <div class="flex justify-center mt-4">
  1160.                 <button onclick="toggleSharePopup()" class="bg-gray-300 hover:bg-gray-400 text-black font-medium rounded-md text-sm px-4 py-2">
  1161.                     Fermer
  1162.                 </button>
  1163.             </div>
  1164.         </div>
  1165.     </div>
  1166.     
  1167. {% set googleMapsApiKey = app.request.server.get('GOOGLEMAP_KEY') %}
  1168.         <script>
  1169.             const googleMapsApiKey = "{{ googleMapsApiKey }}";
  1170.             var iconMap = "{{ asset('/images/icons/Bons Plans.png') }}";
  1171.         </script>
  1172.     {% block scripts %}
  1173.     <script async src="{{ 'https://maps.googleapis.com/maps/api/js' ~ '?key=' ~ googleMapsApiKey ~ '&callback=initMap&v=beta&libraries=places,geometry,marker' }}"></script>
  1174.             <script>
  1175.             function initMap() {
  1176.             var input = document.getElementById('addressDistanceInput');
  1177.             var options = {
  1178.                 types: ['geocode'],
  1179.                 componentRestrictions: { country: 'fr' }
  1180.                 };
  1181.             var autocomplete = new google.maps.places.Autocomplete(input, options);
  1182.             var currentMarker = null;
  1183.             var currentCircle = null;
  1184.             
  1185.             google.maps.event.addListener(autocomplete, 'place_changed', function() {
  1186.                 var place = autocomplete.getPlace();
  1187.                 
  1188.                 if (!place.geometry) {
  1189.                     console.log("Aucun détail géographique trouvé pour cette adresse.");
  1190.                     return;
  1191.                 }
  1192.                 var latitude = place.geometry.location.lat();
  1193.                 var longitude = place.geometry.location.lng();
  1194.                 
  1195.                 if (currentMarker) currentMarker.setMap(null);
  1196.                 if (currentCircle) currentCircle.setMap(null);
  1197.                 var iconMap = {
  1198.                     url: "{{ asset('/images/icons/ecole.png') }}",
  1199.                     scaledSize: new google.maps.Size(40, 40),
  1200.                     anchor: new google.maps.Point(20, 40)
  1201.                 };
  1202.                 currentMarker = new google.maps.Marker({
  1203.                     position: { lat: latitude, lng: longitude },
  1204.                     map: map,
  1205.                     title: "Adresse distance",
  1206.                     icon: iconMap,
  1207.                 });
  1208.                 console.log(currentMarker)
  1209.                 currentCircle = new google.maps.Circle({
  1210.                     strokeColor: "#FFFF00",
  1211.                     strokeOpacity: 0.8,
  1212.                     strokeWeight: 2,
  1213.                     fillColor: "#FFFF00",
  1214.                     fillOpacity: 0.35,
  1215.                     map: map,
  1216.                     center: {lat: {{ building.lat|json_encode|raw }}, lng: {{ building.lng|json_encode|raw }}},
  1217.                     radius: 2500,
  1218.                     zoom: 50,
  1219.                 });
  1220.                                 
  1221.                 var initialPosition = new google.maps.LatLng({{ building.lat|json_encode|raw }}, {{ building.lng|json_encode|raw }});
  1222.                 var newPosition = new google.maps.LatLng(latitude, longitude);
  1223.                 var distance = google.maps.geometry.spherical.computeDistanceBetween(initialPosition, newPosition);
  1224.                 distance = Math.round(distance /1000);
  1225.                 var temps = (distance/80)*60;
  1226.                 temps = Math.round(temps);
  1227.                 var addressDistanceField = document.querySelector('#addressDistance');
  1228.                 addressDistanceField.style.display = 'block';
  1229.                 addressDistanceField.innerHTML = `
  1230.                     <p>{{ 'building.logement1'|trans }} ${distance} {{ 'building.logement2'|trans }} ${temps} {{ 'building.logement3'|trans }}</p>
  1231.                     <p>{{ 'building.logement4'|trans }}</p>
  1232.                 `;
  1233.                 map.setCenter(new google.maps.LatLng(latitude, longitude));
  1234.                 
  1235.             });
  1236.             if ({{ building.lat|json_encode|raw }} == null || {{ building.lng|json_encode|raw }} == null) {
  1237.                 return 0;
  1238.             }
  1239.             const map = new google.maps.Map(document.getElementById("map"), { mapId:"b47cb966043d1a05", center: {lat: {{ building.lat|json_encode|raw }}, lng: {{ building.lng|json_encode|raw }}}, zoom: 14, });
  1240.             const parser = new DOMParser();
  1241.             
  1242.             // A marker with a custom inline SVG.
  1243.             const pinSvgString = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="30px" height="34px" viewBox="0 0 30 40" version="1.1">
  1244.                             <defs>
  1245.                             <filter id="alpha" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%">
  1246.                             <feColorMatrix type="matrix" in="SourceGraphic" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"/>
  1247.                             </filter>
  1248.                             <mask id="mask0">
  1249.                             <g filter="url(#alpha)">
  1250.                             <rect x="0" y="0" width="30" height="40" style="fill:rgb(0%,0%,0%);fill-opacity:0.996078;stroke:none;"/>
  1251.                             </g>
  1252.                             </mask>
  1253.                             <clipPath id="clip1">
  1254.                             <rect x="0" y="0" width="30" height="40"/>
  1255.                             </clipPath>
  1256.                             <g id="surface5" clip-path="url(#clip1)">
  1257.                             <path style=" stroke:none;fill-rule:evenodd;fill:rgb(99.607843%,80.392157%,0%);fill-opacity:1;" d="M 14.472656 0.429688 C 18.484375 0.265625 21.949219 1.511719 24.871094 4.164062 C 28.933594 7.972656 30.359375 12.582031 29.152344 17.984375 C 28.730469 19.613281 28.15625 21.183594 27.425781 22.703125 C 26.023438 25.640625 24.378906 28.429688 22.492188 31.066406 C 20.523438 33.816406 18.417969 36.464844 16.179688 39.019531 C 15.96875 39.238281 15.730469 39.414062 15.457031 39.550781 C 15.1875 39.574219 14.917969 39.574219 14.648438 39.550781 C 14.339844 39.378906 14.066406 39.167969 13.820312 38.914062 C 11.074219 35.8125 8.558594 32.539062 6.273438 29.105469 C 4.929688 27.042969 3.71875 24.894531 2.644531 22.667969 C 1.714844 20.746094 1.066406 18.738281 0.703125 16.644531 C 0.132812 12.804688 1.015625 9.328125 3.347656 6.214844 C 6.113281 2.582031 9.820312 0.65625 14.472656 0.429688 Z M 14.472656 0.429688 "/>
  1258.                             </g>
  1259.                             </defs>
  1260.                             <g id="surface1">
  1261.                             <use xlink:href="#surface5" mask="url(#mask0)"/>
  1262.                             <path style=" stroke:none;fill-rule:evenodd;fill:rgb(7.45098%,7.843137%,8.627451%);fill-opacity:1;" d="M 14.257812 7.695312 C 15.882812 7.558594 17.457031 7.757812 18.984375 8.296875 C 20.640625 8.976562 21.609375 10.1875 21.890625 11.925781 C 22.273438 14.070312 21.621094 15.84375 19.933594 17.246094 C 19.6875 17.445312 19.429688 17.628906 19.160156 17.796875 C 18.753906 18.105469 18.699219 18.46875 19 18.882812 C 20.109375 20.59375 21.199219 22.316406 22.28125 24.042969 C 22.476562 24.546875 22.351562 24.957031 21.910156 25.265625 C 21.496094 25.585938 21.023438 25.746094 20.5 25.75 C 20.308594 25.6875 20.148438 25.578125 20.023438 25.421875 C 18.710938 23.203125 17.417969 20.980469 16.144531 18.742188 C 16.097656 18.542969 16.132812 18.359375 16.25 18.191406 C 16.613281 17.933594 16.984375 17.6875 17.363281 17.453125 C 18.5625 16.527344 19.171875 15.316406 19.195312 13.820312 C 19.253906 12.777344 18.953125 11.847656 18.296875 11.03125 C 17.738281 10.5 17.074219 10.148438 16.304688 9.984375 C 15.792969 9.886719 15.273438 9.816406 14.753906 9.777344 C 14.714844 9.300781 14.605469 8.835938 14.417969 8.382812 C 14.335938 8.246094 14.253906 8.105469 14.171875 7.96875 C 14.136719 7.855469 14.167969 7.765625 14.257812 7.695312 Z M 14.257812 7.695312 "/>
  1263.                             <path style=" stroke:none;fill-rule:evenodd;fill:rgb(7.45098%,7.843137%,8.627451%);fill-opacity:1;" d="M 11.617188 7.726562 C 12.667969 7.652344 13.367188 8.101562 13.714844 9.070312 C 13.890625 9.921875 13.628906 10.605469 12.921875 11.117188 C 11.960938 11.558594 11.179688 11.359375 10.574219 10.515625 C 10.011719 9.496094 10.195312 8.644531 11.121094 7.953125 C 11.285156 7.867188 11.449219 7.792969 11.617188 7.726562 Z M 11.617188 7.726562 "/>
  1264.                             <path style=" stroke:none;fill-rule:evenodd;fill:rgb(7.45098%,7.843137%,8.627451%);fill-opacity:1;" d="M 11.582031 12.132812 C 12.0625 12.101562 12.53125 12.152344 12.992188 12.289062 C 13.125 12.359375 13.210938 12.46875 13.253906 12.617188 C 13.265625 13.429688 13.277344 14.246094 13.289062 15.058594 C 13.320312 15.238281 13.417969 15.359375 13.589844 15.421875 C 14.53125 15.421875 15.472656 15.445312 16.410156 15.492188 C 16.589844 15.550781 16.65625 15.671875 16.605469 15.851562 C 16.511719 16.046875 16.375 16.214844 16.199219 16.351562 C 15.34375 16.9375 14.390625 17.246094 13.34375 17.28125 C 12.695312 17.304688 12.050781 17.304688 11.402344 17.28125 C 11.003906 17.261719 10.761719 17.058594 10.679688 16.679688 C 10.65625 15.324219 10.65625 13.96875 10.679688 12.617188 C 10.730469 12.5 10.808594 12.402344 10.910156 12.324219 C 11.128906 12.234375 11.351562 12.167969 11.582031 12.132812 Z M 11.582031 12.132812 "/>
  1265.                             <path style=" stroke:none;fill-rule:evenodd;fill:rgb(7.45098%,7.843137%,8.627451%);fill-opacity:1;" d="M 8.441406 13.167969 C 8.796875 13.160156 9.148438 13.167969 9.5 13.183594 C 9.621094 13.222656 9.710938 13.296875 9.765625 13.40625 C 9.789062 14.589844 9.789062 15.773438 9.765625 16.953125 C 9.71875 17.101562 9.621094 17.1875 9.464844 17.210938 C 9.085938 17.242188 8.710938 17.230469 8.335938 17.175781 C 8.027344 17.046875 7.835938 16.824219 7.753906 16.507812 C 7.730469 15.609375 7.730469 14.714844 7.753906 13.820312 C 7.886719 13.5 8.117188 13.285156 8.441406 13.167969 Z M 8.441406 13.167969 "/>
  1266.                             <path style=" stroke:none;fill-rule:evenodd;fill:rgb(7.45098%,7.843137%,8.627451%);fill-opacity:1;" d="M 11.441406 18.191406 C 11.816406 18.1875 12.191406 18.191406 12.566406 18.210938 C 12.894531 18.234375 13.125 18.390625 13.253906 18.675781 C 13.277344 20.5 13.277344 22.324219 13.253906 24.148438 C 13.21875 24.523438 13.046875 24.828125 12.742188 25.058594 C 12.265625 25.433594 11.726562 25.667969 11.121094 25.765625 C 10.886719 25.761719 10.742188 25.644531 10.679688 25.421875 C 10.65625 23.195312 10.65625 20.96875 10.679688 18.742188 C 10.71875 18.601562 10.792969 18.480469 10.910156 18.382812 C 11.082031 18.296875 11.257812 18.234375 11.441406 18.191406 Z M 11.441406 18.191406 "/>
  1267.                             </g>
  1268.                         </svg>`
  1269.             const pinSvgElement = parser.parseFromString(pinSvgString, "image/svg+xml").documentElement;
  1270.             const AdvancedMarkerElement = new google.maps.marker.AdvancedMarkerView({ position: {lat: {{ building.lat|json_encode|raw }}, lng: {{ building.lng|json_encode|raw }}}, map, content: pinSvgElement, title:({{ building.id|json_encode|raw }}).toString(), });
  1271.         }
  1272.         window.initMap = initMap;
  1273.         function showMap() {
  1274.             document.getElementById('map').style.filter = "none";
  1275.             document.getElementById('mapGoogle').style.display = "none";
  1276.         }
  1277.         </script>
  1278.     {% endblock %}
  1279. {% endblock %}
  1280. {% block javascripts %}
  1281.     <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css"/>
  1282.     <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.min.css"/>
  1283.     <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
  1284.     <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js"></script>
  1285.     <script type="text/javascript">
  1286.         $(document).ready(function() {
  1287.             const $carousel = $('.slick-carousel');
  1288.             $carousel.slick({
  1289.                 slidesToShow: 1,
  1290.                 slidesToScroll: 1,
  1291.                 autoplay: false,
  1292.                 arrows: false,
  1293.                 dots: true,
  1294.                 responsive: [
  1295.                     {
  1296.                         breakpoint: 1024,
  1297.                         settings: { slidesToShow: 1 }
  1298.                     },
  1299.                     {
  1300.                         breakpoint: 768,
  1301.                         settings: { slidesToShow: 1 }
  1302.                     }
  1303.                 ]
  1304.             });
  1305.             $('.slick-custom-prev').on('click', function () {
  1306.                 $carousel.slick('slickPrev');
  1307.             });
  1308.             $('.slick-custom-next').on('click', function () {
  1309.                 $carousel.slick('slickNext');
  1310.             });
  1311.         });
  1312.     </script>
  1313.     <script>
  1314.         function resize() {
  1315.             const fd= document.getElementById("firstDiv");
  1316.             if(screen.width<768){
  1317.                 fd.parentElement.classList.remove("container","px-4","py-8");
  1318.                 fd.parentElement.parentElement.classList.remove('m-auto');
  1319.                 
  1320.             }else{
  1321.                 fd.parentElement.classList.add("container","px-4","py-8");
  1322.                 fd.parentElement.parentElement.classList.add('m-auto');
  1323.             }
  1324.         }
  1325.         $(document).ready(function () {
  1326.             resize()
  1327.             //const bfs = document.getElementById("buttonFileShow");
  1328.             //const fs = document.getElementById("fileShow");
  1329.             //bfs.addEventListener("click", function () {
  1330.                 //fs.classList.toggle("hidden")
  1331.             //});
  1332.             const btn = document.getElementById("showMoreDescription");
  1333.             const desc = document.getElementById("description");
  1334.             btn.addEventListener("click", function () {
  1335.                 desc.classList.toggle("line-clamp-[5]");
  1336.                 const showText = btn.getAttribute("data-more");
  1337.                 const hideText = btn.getAttribute("data-less");
  1338.                 btn.textContent = desc.classList.contains("line-clamp-[5]") ? showText : hideText;
  1339.             });
  1340.         });
  1341.         
  1342.         window.onresize = resize;
  1343.     </script>
  1344.     <script>
  1345.         function zoomImage(imageUrl)
  1346.         {
  1347.             const zoomImageContainer = document.getElementById("zoomContainer")
  1348.             const zoomImage = document.getElementById("zoomImg")
  1349.             zoomImage.src = `{{ asset('images/files/') }}${imageUrl}`;
  1350.             zoomImageContainer.style.display = "flex";
  1351.             zoomImage.style.minWidth = "65%";
  1352.         }
  1353.         function closeZoomImage()
  1354.         {
  1355.             const zoomImageContainer = document.getElementById("zoomContainer")
  1356.             zoomImageContainer.style.display = "none";
  1357.         }
  1358.     </script>
  1359.     <script>
  1360.         $(document).ready(function() {
  1361.             $('.like-button').click(function() {
  1362.                 const imageId = $(this).data('image-id');
  1363.                 $(this).toggleClass('fa-solid');
  1364.                 $(this).toggleClass('fa-regular');
  1365.                 // Send AJAX request to like the image
  1366.                 $.ajax({
  1367.                     type: 'POST',
  1368.                     url: '{{ path('liked_building_action', {'id': 'IMAGE_ID'}) }}'.replace('IMAGE_ID', imageId),
  1369.                     success: function(response) {
  1370.                         if(!response['success']){
  1371.                             window.location.href = '{{ path('app_login') }}';
  1372.                         }
  1373.                     }.bind(this),
  1374.                     error: function() {
  1375.                         // Handle AJAX error
  1376.                     }
  1377.                 });
  1378.             });
  1379.         });
  1380.     </script>
  1381.     <script>
  1382.         function toggleSharePopup() {
  1383.             const sharePopup = document.getElementById('sharePopup');
  1384.             sharePopup.classList.toggle('hidden');
  1385.         }
  1386.         function copyToClipboard(text) {
  1387.             navigator.clipboard.writeText(text).then(function() {
  1388.                 alert('Lien copié dans le presse-papiers');
  1389.             }, function(err) {
  1390.                 console.error('Erreur lors de la copie du texte: ', err);
  1391.             });
  1392.         }
  1393.     </script>
  1394. {% endblock %}