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.                                             {% if building.propertyManager.id == 127 %}
  199.                                                 <img src="{{ asset('/images/site/bandeau-pro.png') }}" alt="Bandeau pro" class="absolute bottom-2 right-2 opacity-90 !w-24 !h-10 max-w-none z-50">
  200.                                             {% endif %}
  201.                                     {% endfor %}
  202.                                 </div>
  203.                                 {# Slider indicators #} 
  204.                                 <div class="flex absolute border-black bottom-5 left-1/2 z-30 space-x-3 -translate-x-1/2">
  205.                                     {% for document in building.buildingDocuments %}
  206.                                             <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>
  207.                                     {% endfor %}
  208.                                 </div>
  209.                                 {# Slider controls #} 
  210.                                 {% if building.buildingDocuments|length > 1 %}
  211.                                         <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>
  212.                                             <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">
  213.                                                 <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>
  214.                                                 <span class="hidden">Previous</span>
  215.                                             </span>
  216.                                         </button>
  217.                                         <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>
  218.                                             <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">
  219.                                                 <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>
  220.                                                 <span class="hidden">Next</span>
  221.                                             </span>
  222.                                         </button>
  223.                                 {% endif %}
  224.                                 
  225.                             </div>
  226.                     {% endif %}
  227.                 </div>
  228.             </div>
  229.         {# end #}
  230.         <div class='container '>
  231.             <div class="flex justify-between items-center">
  232.                 <div >
  233.                     <h2 class="text-2xl font-bold">{{  building.title}}</h2>
  234.                     <h2 class="text-2xl font-bold md:text-nowrap">{{  building.cityEntity.city}}, {{  building.cityEntity.country}}</h2>
  235.                 </div>
  236.                 <div class="flex items-center">
  237.                     <a class="flex items-center justify-center p-3 cursor-pointer rounded-lg">
  238.                         {% if liked %}
  239.                             <h2 class="hidden md:block">{{ 'accueil.retirerfav'|trans }}</h2>
  240.                             <i class="text-[#ffcc00] fa-solid fa-heart md:pl-3 fa-2x like-button" data-image-id="{{ building.id }}"></i>
  241.                         {% else %}
  242.                             <h2 class="hidden md:block">{{ 'accueil.addfav'|trans }}</h2>
  243.                             <i class="text-[#ffcc00] fa-regular fa-heart md:pl-3 fa-2x like-button" data-image-id="{{ building.id }}"></i>
  244.                         {% endif %}
  245.                     </a>
  246.                     <a class="flex items-center justify-center p-3 cursor-pointer rounded-lg" onclick="toggleSharePopup()">
  247.                         <h2 class="hidden md:block">{{ 'accueil.share'|trans }}</h2>
  248.                         <img src="{{ asset('/images/partager-jaune.png') }}" alt="Partager" class="md:pl-3 w-10 h-8">
  249.                     </a>
  250.                 </div>
  251.             </div>
  252.             
  253.             <div class="relative mt-6 hidden md:block">
  254.                 <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">
  255.                     <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">
  256.                         <svg class="w-5 h-5 text-white sm:w-6 sm:h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  257.                             <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path>
  258.                         </svg>
  259.                         <span class="hidden">Previous</span>
  260.                     </span>
  261.                 </button>
  262.                 <div class="slick-carousel">
  263.                     {% if building.buildingDocuments %}
  264.                         {% if building.complexProperty %}
  265.                             {% for document in building.buildingDocuments %}
  266.                                 {% if document.name starts with 'imagesComplexe' %}
  267.                                     <div class="relative">
  268.                                         <img onclick="zoomImage('{{ document.imageFile }}')" src="{{ asset('/images/files/') }}{{ document.imageFile }}" alt="">
  269.                                         {% if building.propertyManager.id == 127 %}
  270.                                             <img src="{{ asset('/images/site/bandeau-pro.png') }}" alt="Bandeau pro" class="absolute bottom-2 right-2 opacity-90 !w-24 !h-10 max-w-none z-50">
  271.                                         {% endif %}
  272.                                     </div>
  273.                                 {% endif %}
  274.                             {% endfor %}
  275.                         {% else %}
  276.                             {% for document in building.buildingDocuments %}
  277.                                 {% if document.name == "base" %}
  278.                                     <div class="relative">
  279.                                         <img onclick="zoomImage('{{ document.imageFile }}')" class="rounded-tl-lg image-size" src="{{ asset('/images/files/') }}{{ document.imageFile }}" alt="">
  280.                                         {% if building.propertyManager.id == 127 %}
  281.                                             <img src="{{ asset('/images/site/bandeau-pro.png') }}" alt="Bandeau pro" class="absolute bottom-2 right-2 opacity-90 !w-24 !h-10 max-w-none z-50">
  282.                                         {% endif %}
  283.                                     </div>
  284.                                 {% endif %}
  285.                             {% endfor %}
  286.                             {% for document in building.buildingDocuments %}
  287.                                 {% if document.name != "base" and document.name in ["file0","file1","file2", "file3", "file4", "file5", "file6", "file7", "file8"] %}
  288.                                     <div class="relative">
  289.                                         <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="">
  290.                                         {% if building.propertyManager.id == 127 %}
  291.                                             <img src="{{ asset('/images/site/bandeau-pro.png') }}" alt="Bandeau pro" class="absolute bottom-2 right-2 opacity-90 !w-24 !h-10 max-w-none z-50">
  292.                                         {% endif %}
  293.                                     </div>
  294.                                 {% endif %}
  295.                             {% endfor %}
  296.                         {% endif %}
  297.                     {% endif %}
  298.                 </div>
  299.                 <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">
  300.                     <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">
  301.                         <svg class="w-5 h-5 text-white sm:w-6 sm:h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  302.                             <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
  303.                         </svg>
  304.                         <span class="hidden">Next</span>
  305.                     </span>
  306.                 </button>
  307.             </div>
  308.                 <br>
  309.                 <div id="fileShow" class="hidden grid grid-cols-4 gap-4">
  310.                     {% if building.buildingDocuments|length > 4 %}    
  311.                         {%  for  i in  5..8 %}
  312.                             {% for document in building.buildingDocuments %}
  313.                                 
  314.                                 {% if ("file" ~ i) == document.name  %}
  315.                                     <div class="hidden md:block ">
  316.                                         <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="">
  317.                                     </div>
  318.                                 {% endif %}
  319.                             {% endfor %}
  320.                             
  321.                         {% endfor %}
  322.                     {% else %}
  323.                         <div class="md-5">
  324.                             <hr class="my-6 border-gray-300">
  325.                             <h2 class="text-2xl font-bold"> {{ 'building.noImage'|trans }}</h2>
  326.                             <hr class="my-6 border-gray-300">
  327.                         </div>
  328.                     {% endif %}
  329.                 </div>
  330.             </div>
  331.             {% if building.complexProperty %}
  332.                 <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>
  333.             {% else %}
  334.                 <h2 class="hidden md:block text-2xl font-bold md:text-nowrap">{{ building.type|trans|capitalize  }}</h2>
  335.             {% endif %}
  336.             {% if building.complexProperty %}
  337.                 <h2 class="hidden md:block text-2xl font-bold md:text-nowrap">{{ 'accueil.loyer'|trans }} {{lowestRent /100}} euros</h2>
  338.             {% else %}
  339.                 <h2 class="hidden md:block text-2xl font-bold md:text-nowrap">{{ 'accueil.loyer'|trans }} {{ building.rent /100 }} euros</h2>    
  340.             {% endif %}
  341.             <div class="md:mt-10">
  342.                 <div class="md:grid md:grid-cols-4 md:gap-4 items-start">
  343.                     <div class="col-span-3">
  344.                         <div class="flex flex-col mb-6">
  345.                             <div class="mt-3 md:text-center">
  346.                                 <h3 class="  md:hidden text-lg text-gray-500">{{ building.cityEntity.city ~ ", " ~ building.cityEntity.country }}</h3>
  347.                                 {# <h3 class="hidden md:block text-lg text-gray-500">{{ 'accueil.add'|trans }}{{ building.createdAt|date('d/m/y H:i') }}</h3> #}
  348.                             </div>
  349.                             
  350.                         </div>
  351.                         <hr class="my-6 border-gray-300">
  352.                         <h1 class="text-2xl font-bold">{{ 'accueil.description'|trans }}</h1>
  353.                         <div style="width: 95%" class="my-6">
  354.                             {% if building.description|length <= 400 %}
  355.                                 <p id="description" class="">
  356.                                     {{ building.description|nl2br }}
  357.                                 </p> <br>
  358.                             {% else %}
  359.                                 <p id="description" class="line-clamp-[5]">
  360.                                     {{ building.description|nl2br }}
  361.                                 </p> <br>
  362.                             {% endif %}    
  363.                             {% if building.description|length > 400 or building.description|split("\n")|length > 5 %}
  364.                                 <button id="showMoreDescription"
  365.                                     class="underline font-bold cursor-pointer"
  366.                                     data-more="{{ 'building.savoirplus'|trans }}"
  367.                                     data-less="{{ 'building.savoirmoins'|trans }}">
  368.                                     {{ 'building.savoirplus'|trans }}
  369.                                 </button>
  370.                             {% endif %}            
  371.                             <div class="mt-6">                            
  372.                                 {% for document in building.buildingDocuments %}
  373.                                     {% if document.name == "houseRules" %}
  374.                                             <h1 class="mb-3 text-2xl font-bold">{{ 'building.houseRules'|trans }}</h1>
  375.                                             {% if document.imageFile|split('.')[1] == "pdf" %}
  376.                                                 <a class="" target="_blank" href="{{ asset('/images/files/' ~ document.imageFile) }}">
  377.                                                                 <img class="img-fluid mx-auto justify-center" style="max-width: 50px; max-height: 50px"
  378.                                                                 src="{{ asset('/images/site/pdf.png') }}" alt="">
  379.                                                             </a>
  380.                                             {% else %}
  381.                                                 <a class="" target="_blank" href="{{ asset('/images/files/' ~ document.imageFile) }}">
  382.                                                 <img class="w-25 rounded" src="{{ asset('images/files/') }}{{ document.imageFile }}" alt="">
  383.                                                 </a>
  384.                                             {% endif %}
  385.                                     {% endif %}
  386.                                 {% endfor %}
  387.                             </div>
  388.                         </div>
  389.                         <hr class="my-6 border-gray-300">
  390.                         {# {% if building.buildingEquipment is not empty %}
  391.                             <div class="my-10">
  392.                                 <h1 class="text-2xl font-bold">{{ 'accueil.equipement'|trans }}</h1>
  393.                                 <div class="grid grid-cols-2 gap-2 my-6 text-sm">
  394.                                     {% for equipment in building.buildingEquipment %}
  395.                                         <div class="flex items-center">
  396.                                             <div>
  397.                                                 <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>
  398.                                             </div>
  399.                                             <div>
  400.                                                 <span>{{ equipment.name|trans }}</span>
  401.                                             </div>
  402.                                         </div>
  403.                                     {% endfor %}
  404.                                 </div>
  405.                             </div>
  406.                         {% endif %} #}
  407.                         {% if building.interior is not empty %}
  408.                             <div class="my-10">
  409.                                 <h1 class="text-2xl font-bold">{{ 'accueil.equipementInterior'|trans }}</h1>
  410.                                 <div class="grid grid-cols-2 gap-2 my-6 text-sm">
  411.                                     {% for equipment in building.interior %}
  412.                                         <div class="flex items-center">
  413.                                             <div>
  414.                                                 <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>
  415.                                             </div>
  416.                                             <div>
  417.                                                 <span>{{equipment|trans }}</span>
  418.                                             </div>
  419.                                         </div>
  420.                                     {% endfor %}
  421.                                 </div>
  422.                             </div>
  423.                         {% endif %}
  424.                         {% if building.exterior is not empty %}
  425.                             <div class="my-10">
  426.                                 <h1 class="text-2xl font-bold">{{ 'accueil.equipementExterior'|trans }}</h1>
  427.                                 <div class="grid grid-cols-2 gap-2 my-6 text-sm">
  428.                                     {% for equipment in building.exterior %}
  429.                                         <div class="flex items-center">
  430.                                             <div>
  431.                                                 <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>
  432.                                             </div>
  433.                                             <div>
  434.                                                 <span>{{ equipment|trans }}</span>
  435.                                             </div>
  436.                                         </div>
  437.                                     {% endfor %}
  438.                                 </div>
  439.                             </div>
  440.                         {% endif %}
  441.                         <hr class=" md:hidden my-6 border-gray-300">
  442.                         <div class=" md:hidden my-10">
  443.                             <div class="grid grid-cols-2 gap-2 text-sm">
  444.                                 
  445.                                 <div class="justify-center items-center h-full content-center">
  446.                                     <h3 class="text-2xl mb-2 text-base"><b>{{ building.rent / 100 }}
  447.                                         € </b>{{ 'accueil.parmois'|trans }}</h3>
  448.                                         <span class="text-sm">({{ 'building.dont'|trans }}{{ building.expenses / 100 }}{{ 'building.charges'|trans }})</span>
  449.                                     
  450.                                     {% if building.dateStartAt is not null %}
  451.                                         <p class="mt-6 ">{{'building.dispo'|trans}}
  452.                                             <span id="dateStartAt">{{ building.dateStartAt|date('d/m/Y') }}</span></p>
  453.                                     {% else %}
  454.                                         <p>{{'building.nodispo'|trans}}</p>
  455.                                     {% endif %}
  456.                                     {% if building.isAidEligible %}
  457.                                         <div class="mt-6 ">
  458.                                             <span class="font-bold text-xs leading-[1] ">{{ 'building.cafeligible'|trans }}</span>
  459.                                         </div>
  460.                                     {% endif %}
  461.                                 </div>
  462.                                 <div class="justify-center items-center h-full content-center">
  463.                                     {% if app.user %}
  464.                                         {% if "ROLE_TENANT" in app.user.roles %}
  465.                                             {% if app.user.isRegistrationFinalized %}
  466.                                                 {% if building.isActive %}
  467.                                                     <div class="d-flex justify-content-center flex flex-wrap justify-between items-center">
  468.                                                         <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">
  469.                                                             <i class="fa-solid fa-file text-white"></i>
  470.                                                             <span class="inline">{{ 'building.deposerdemande'|trans }}</span>
  471.                                                         </a>
  472.                                                     </div>
  473.                                                     
  474.                                                 {% else %}
  475.                                                     <div class="d-flex justify-content-center flex flex-wrap justify-between items-center">
  476.                                                         <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">
  477.                                                             <i class="fa-solid fa-xmark text-white"></i>
  478.                                                             <span class="inline">{{ 'building.nondispo'|trans }}</span>
  479.                                                         </a>
  480.                                                     </div>
  481.                                                 {% endif %}
  482.                                                     <div class="mt-6">
  483.                                                         
  484.                                                         {# <a href="{{ path('building_reporting',{id : building.id}) }}" class="text-gray-400 w-full font-medium rounded-md text-sm text-center">
  485.                                                             <p class="inline-block">
  486.                                                                 <img src="{{ asset('/images/icons/Signaler.png') }}" height="30px" width="30px" class="fa-sharp fa-solid fa-door-open p-1 rounded-lg"/>
  487.                                                                 <span class="underline">{{ 'accueil.signalernannonce'|trans }}</span>
  488.                                                             </p>
  489.                                                         </a> #}
  490.                                                     </div>
  491.                                             {% else %}
  492.                                                 <div class="d-flex justify-content-center flex flex-wrap justify-between items-center">
  493.                                                     <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">
  494.                                                         <span class="inline">{{ 'building.deposerdemande'|trans }}</span>
  495.                                                     </a>
  496.                                                 </div>
  497.                                             {% endif %}
  498.                                         {% endif %}
  499.                                     {% else %}
  500.                                         <div class="d-flex justify-content-center flex flex-wrap justify-between items-center">
  501.                                                 <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">
  502.                                                     <span class="inline">{{ 'building.deposerdemande'|trans }}</span>
  503.                                                 </button>
  504.                                             </div>
  505.                                     {% endif %}
  506.                                     <a href="{{ path('building_reporting',{id : building.id}) }}" class=" text-gray-400 w-full font-medium rounded-md text-sm text-center">
  507.                                         <p>
  508.                                             <span class="underline">{{ 'accueil.signalernannonce'|trans }}</span>
  509.                                         </p>
  510.                                     </a>
  511.                                 </div>
  512.                             </div>
  513.                         </div>
  514.                     {#    <hr class="my-6 border-gray-300">
  515.                         <p class="container my-10">
  516.                             <img class="h-12" src="{{ asset('/images/site/garantme.png') }}" alt="">
  517.                         </p>
  518.                         <p>
  519.                             {{ 'accueil.garantme1'|trans }}<br>
  520.                             {{ 'accueil.garantme2'|trans }}
  521.                             <br> <br>
  522.                             <div class="mt-6">
  523.                                 <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">
  524.                                     <span>{{ 'accueil.more'|trans }}</span>
  525.                                 </button>
  526.                             </div>
  527.                             <div id="garant-me-text" class="hidden">
  528.                                 <span class="font-bold">{{ 'accueil.aquoicasert'|trans }}</span>
  529.                                 <br>
  530.                                 <ul>
  531.                                     <li>
  532.                                         {{ 'accueil.gracea'|trans }}<br>
  533.                                     </li>
  534.                                     <li>
  535.                                         {{ 'accueil.gracea2'|trans }}<br>
  536.                                     </li>
  537.                                 </ul>
  538.                                 <br>
  539.                                 <span class="font-bold">{{ 'accueil.commentfaire'|trans }}</span>
  540.                                 <br>
  541.                                 {{ 'accueil.inscription'|trans }}
  542.                                 <br>
  543.                                 <br>
  544.                                 <span class="font-bold">{{ 'accueil.howmuch'|trans }}</span>
  545.                                 <br>
  546.                                 <br>
  547.                                 {{ 'accueil.explication1'|trans }}<br>
  548.                                 <br>
  549.                                 {{ 'accueil.explication2'|trans }}<br>
  550.                                 <br>
  551.                                 {{ 'accueil.explication3'|trans }}<br><br>
  552.                             </div>
  553.                         </p>
  554.                         #}                        
  555.                         <div id="zoomContainer" style="display: none;">
  556.                             <img id="zoomImg" src"" class="" alt="ImageZoom" style="max-width: 100%; max-height: 100%;">
  557.                             <button onclick="closeZoomImage()" id="closeButton" class="close-button">&times;</button>
  558.                         </div>
  559.                         {% if building.complexProperty %}
  560.                         <p class="text-2xl m-2">
  561.                             <strong>
  562.                                 {{ buildingsInComplex|length > 1 
  563.                                     ? 'accueil.rooms'|trans 
  564.                                     : 'accueil.room'|trans 
  565.                                 }}
  566.                             </strong>
  567.                         </p>
  568.                         <div style="width: 95%" class="relative border border-gray-300 hover:border-blue-500 shadow-2xl rounded p-6">
  569.                             <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
  570.                                 {% for loopIndex, building in buildingsInComplex %}
  571.                                 {% if loopIndex % 4 == 0 and loopIndex != 0 %}
  572.                             </div>
  573.                             <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
  574.                                 {% endif %}
  575.                                 <div class="w-full text-center">
  576.                                     {% if building.buildingDocuments is not empty %}
  577.                                     {% set filteredDocuments = building.buildingDocuments|filter(document => document.name starts with 'file' or document.name starts with 'base' or document.name starts with 'cover') %}
  578.                                     {% if filteredDocuments is not empty %}
  579.                                     <div id="carousel-{{ building.id }}" class="relative z-0 w-full" data-carousel="static">
  580.                                         <div class="overflow-hidden relative h-[20rem] md:h-[10rem] lg:h-[20rem] flex mt-10">
  581.                                             {% for document in filteredDocuments %}
  582.                                             {% if document.imageFile %}
  583.                                             <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>
  584.                                             {% endif %}
  585.                                             {% endfor %}
  586.                                         </div>
  587.                                         <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>
  588.                                             <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">
  589.                                                 <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>
  590.                                                 <span class="hidden">Previous</span>
  591.                                             </span>
  592.                                         </button>
  593.                                         <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>
  594.                                             <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">
  595.                                                 <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>
  596.                                                 <span class="hidden">Next</span>
  597.                                             </span>
  598.                                         </button>
  599.                                         <div class="flex absolute bottom-5 left-1/2 z-30 space-x-3 -translate-x-1/2">
  600.                                             {% for document in filteredDocuments %}
  601.                                             {% if document.imageFile %}
  602.                                             <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>
  603.                                             {% endif %}
  604.                                             {% endfor %}
  605.                                         </div>
  606.                                     </div>
  607.                                     {% else %}
  608.                                     <p>No images</p>
  609.                                     {% endif %}
  610.                                     {% else %}
  611.                                     <p>No docu
  612.                                     0:03 / 0:24
  613.                                     ments available for this building.</p>
  614.                                     {% endif %}
  615.                                     <div class="mb-4">
  616.                                         <p class="text-2xl m-2">
  617.                                             <strong>{{ 'accueil.room'|trans }} {{ loop.index }}</strong>
  618.                                         </p>
  619.                                         <p>
  620.                                             <strong>{{ 'accueil.superfi'|trans }}</strong> {{ building.surfaceBedroom }} m²
  621.                                         </p>
  622.                                         {% if building.propertyManager.id == 527  and building.discountPrice > 0%}
  623.                                             <p>
  624.                                                 <strong>{{ 'accueil.loyermen'|trans }}</strong> <s>{{ building.rent / 100 }} euros</s>
  625.                                             </p>
  626.                                             <p>
  627.                                                 <strong>{{ 'accueil.discountPriceRent'|trans }}</strong> <span style="Color: red">{{ building.discountPrice}} euros</span>
  628.                                             </p>
  629.                                             <p>
  630.                                                 <strong>{{ 'accueil.dateEndPromo'|trans }}</strong> {{ building.dateEndPromo|date('d/m/Y')}}
  631.                                             </p>
  632.                                         {% else %}
  633.                                             <p>
  634.                                                 <strong>{{ 'accueil.loyermen'|trans }}</strong> {{ building.rent / 100 }} euros
  635.                                             </p>
  636.                                         {% endif %}
  637.                                         <p>
  638.                                             <strong>{{ 'accueil.privbath'|trans }}</strong> {{ building.privateBathroom ? 'Oui'|trans : 'Non'|trans }}
  639.                                         </p>
  640.                                         <p>
  641.                                             <strong>{{ 'accueil.bed'|trans }}</strong> {{ (building.typeBed|lower == 'lit simple' or building.typeBed|lower == 'single bed') ? 'accueil.bedSimple'|trans : 'accueil.bedDouble'|trans }}
  642.                                         </p>
  643.                                         <p>
  644.                                             {% if building.isActive %}
  645.                                                 <strong>{{ 'accueil.startloc'|trans }}</strong> {{ building.dateStartAt|date('d/m/Y') }}
  646.                                             {% else %}
  647.                                                 &nbsp;
  648.                                             {% endif %}
  649.                                         </p>
  650.                                     </div>
  651.                                     {% if app.user %}
  652.                                     {% if "ROLE_TENANT" in app.user.roles %}
  653.                                     {% if app.user.isRegistrationFinalized %}
  654.                                     {% if building.isActive %}
  655.                                     <div class="d-flex justify-content-center flex flex-wrap justify-between items-center m-3.1">
  656.                                         <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">
  657.                                             <span class="inline">{{ 'building.deposerdemandeChambre'|trans }}</span>
  658.                                         </a>
  659.                                     </div>
  660.                                     {% else %}
  661.                                     <div class="d-flex justify-content-center flex flex-wrap justify-between items-center  mt-4">
  662.                                         <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">
  663.                                             <i class="fa-solid fa-xmark text-white"></i>
  664.                                             <span class="inline">{{ 'building.nondispo'|trans }}</span>
  665.                                         </a>
  666.                                     </div>
  667.                                     {% endif %}
  668.                                     {% else %}
  669.                                     <div class="d-flex justify-content-center flex flex-wrap justify-between items-center m-3.1">
  670.                                         <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">
  671.                                             <span class="inline">{{ 'building.deposerdemande'|trans }}</span>
  672.                                         </a>
  673.                                     </div>
  674.                                     {% endif %}
  675.                                     {% endif %}
  676.                                     {% else %}
  677.                                     <div class="d-flex justify-content-center flex flex-wrap justify-between items-center m-3.1">
  678.                                         <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">
  679.                                             <span class="inline">{{ 'building.deposerdemande'|trans }}</span>
  680.                                         </button>
  681.                                     </div>
  682.                                     {% endif %}
  683.                                 </div>
  684.                                 {% endfor %}
  685.                             </div>
  686.                             {% if buildingsInComplex|length % 4 != 0 %}
  687.                             <div class="grid grid-cols-1 sm:grid-cols-2 gap-4"></div>
  688.                             {% endif %}
  689.                         </div>
  690.                         {% endif %}
  691.                             {% if building and not building.hideAddress == true %}
  692.                                 <div class="my-10">
  693.                                     <h1 class="text-2xl font-bold">{{ 'accueil.whereis'|trans }}</h1>
  694.                                     <h3 class="text-sm text-gray-500 mt-2">{{ building.streetNumber }} {{ building.street }} {{ building.cityEntity.city }} {{ building.cityEntity.postalCode }},{{ building.cityEntity.country }}</h3>
  695.                                     {# <div id="redirectMap" style="display: none;" class="bg-[#ffcc00] 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"></div> #}
  696.                                     <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">
  697.                                     <div id="addressDistance" style="display: none; margin-top: 15px"></div>
  698.                                     
  699.                                     <div class=" relative flex mx-auto text-center justify-center mt-5" style="width: 95%">
  700.                                         {% if  building.lat !=null or building.lng !=null %}
  701.                                             <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">
  702.                                                 <i class="fa-solid fa-map-pin"></i>
  703.                                                 {{ 'accueil.affichercarte'|trans }}
  704.                                             </button>
  705.                                             <div id="map"></div>
  706.                                         {% else %}
  707.                                                 <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">
  708.                                                 <i class="fa-solid fa-map-pin"></i>
  709.                                                 {{ 'accueil.mapNotFound'|trans }}
  710.                                             </button>
  711.                                         {% endif %}
  712.                                     </div>
  713.                                 </div>
  714.                             {% endif %}
  715.                     </div>
  716.                     
  717.                     <div class="hidden md:block col-span-4 sm:col-span-1 shadow-2xl rounded p-6 h-auto w-full">
  718.                         <span class="text-2xl font-bold">{{ 'accueil.detail'|trans }}</span>
  719.                         <div class="flex flex-col justify-between">
  720.                             <div class="mt-2">
  721.                                 <span><strong>{{ 'accueil.ref'|trans }}:</strong> {{building.RefBuilding}}</span>
  722.                             </div>
  723.                             <div class="mt-2">
  724.                                 <span><strong>{{ 'accueil.city'|trans }}:</strong> {{  building.cityEntity.city}}, {{  building.cityEntity.country}}</span>
  725.                             </div>
  726.                             {# {% if building.complexProperty %}
  727.                             <div class="mt-2">
  728.                                 <span><strong>{{ "Chambre n°" }}{{  building.bedroomNumber}}</strong></span>
  729.                             </div>
  730.                             {% endif %} #}
  731.                             {% if building.complexProperty %}
  732.                                 <div class="mt-2">
  733.                                     <span><strong>{{ 'accueil.loyer'|trans }}</strong> {{lowestRent /100}}€</span>
  734.                                 </div>
  735.                                 
  736.                                 {% if building.propertyManager.id == 527 %}
  737.                                     <div class="mt-2">
  738.                                         <span><strong>{{ 'accueil.chargesJoivy'|trans }}</strong></span>
  739.                                     </div>
  740.                                     <div class="mt-2">
  741.                                         <span><strong>{{ 'accueil.chargesJoivyDescription'|trans }}</strong></span>
  742.                                     </div>
  743.                                 {% else %}
  744.                                     <div class="mt-2">
  745.                                         <span><strong>{{ 'accueil.charge'|trans }}</strong> </br> <span>{{ building.expenses / 100 }}€</span></span>
  746.                                     </div>
  747.                                 {% endif %}
  748.     
  749.                                 {% if building.leaseDraftingFees > 0 %}
  750.                                         <div class="mt-2">
  751.                                             <h3 class="text-2xl text-base"><b>{{ 'rental_conditions.leaseDraftingFees'|trans }}: </b>{{ building.leaseDraftingFees}}€ </h3>
  752.                                         </div>
  753.                                 {% endif %}    
  754.                                     
  755.                             {% else %}
  756.                                 <div>
  757.                                     <div class="mt-2">
  758.                                         <h3 class="text-2xl text-base"><b>{{ building.rent / 100 }}€ </b>{{ 'accueil.parmois'|trans }}</h3>
  759.                                         <span class="text-sm">({{ 'building.dont'|trans }}{{ building.expenses / 100 }}{{ 'building.charges'|trans }})</span>
  760.                                     </div>
  761.                                     {% if building.leaseDraftingFees > 0 %}
  762.                                         <div class="mt-2">
  763.                                             <h3 class="text-2xl text-base"><b>{{ 'rental_conditions.leaseDraftingFees'|trans }}: </b>{{ building.leaseDraftingFees}}€ </h3>
  764.                                         </div>
  765.                                     {% endif %}    
  766.                                     {# {% if building.expenses != null %}
  767.                                         <div>
  768.                                             <div class="grid grid-cols-2 gap-2 my-6">
  769.                                                 {% if building.expensesDescription is not empty %}
  770.                                                     <span class="text-sm">{{ 'building.comprennent'|trans }}</span>
  771.                                                     <br>
  772.                                                     {% for expense in building.expensesDescription|split(',') %}
  773.                                                         <div class="flex items-center">
  774.                                                             <div>
  775.                                                                 <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>
  776.                                                             </div>
  777.                                                             <div>
  778.                                                                 <span>{{ expense|trans }}</span>
  779.                                                             </div>
  780.                                                         </div>
  781.                                                     {% endfor %}
  782.                                                 {% endif %}
  783.                                             </div>
  784.                                         </div>
  785.                                     {% endif %} #}
  786.                                 </div>
  787.                             {% endif %}
  788.                             
  789.                             <div class="mt-2">
  790.                                 <span><strong>{{ 'admin.surface'|trans }}:</strong> {{building.surface}} m²</span>
  791.                             </div>
  792.                             
  793.                                 {% if building.isFurniture %}
  794.                                     <div class="mt-2">
  795.                                         <span><strong>{{ 'building.FurnishedAccommodation'|trans }}</strong></span>
  796.                                     </div>
  797.                                 {% endif %}
  798.                                 
  799.                                 {% if building.isFloor %}
  800.                                     {% if building.floor == "etage.entresol" or building.floor == "Entresol" %}
  801.                                         <span class="mt-2"><strong>{{ 'etage.entresol'|trans }}</strong></span>
  802.                                     {% elseif building.floor == "etage.rez" or building.floor == "Rez-de-chaussée" %}
  803.                                         <span class="mt-2"><strong>{{ 'etage.rez'|trans }}</strong></span>
  804.                                     {% elseif building.floor == "etage.dernier"%}
  805.                                         <span class="mt-2"><strong>{{ 'etage.dernier'|trans }}</strong></span>
  806.                                     {% elseif building.floor starts with "etage.etage" %}
  807.                                         <span class="mt-2"><strong>{{ building.floor|trans }}</strong></span>
  808.                                     {% else %}
  809.                                         <span class="mt-2"><strong>{{ ('etage.etage' ~ (building.floor|split('eme')[0]))|trans }}</strong></span>
  810.                                     {% endif %}
  811.                                 {% else %}
  812.                                     <div class="mt-2">
  813.                                         <span><strong>{{ 'building.notFloor'|trans }}</strong></span>
  814.                                     </div>
  815.                                 {% endif %}
  816.                                 
  817.                                 {% if building.complexProperty %}
  818.                                     {% if building.privateBathroom %}
  819.                                         <div class="mt-2">
  820.                                             <span><strong>{{ 'building.privateBathroom'|trans }}</strong></span>
  821.                                         </div>
  822.                                     {% else %}
  823.                                         <div class="mt-2">
  824.                                             <span><strong>{{ 'building.notPrivateBathroom'|trans }}</strong></span>
  825.                                         </div>
  826.                                     {% endif %}
  827.                                 {% else %}
  828.                                     {% if building.bathrooms >0 %}
  829.                                         <div class="mt-2">
  830.                                             <span><strong>{{ building.bathrooms }} {{ 'building.sdb'|trans }}</strong></span>
  831.                                         </div>
  832.                                     {% endif %}
  833.                                 {% endif %}
  834.                                 {% if building.complexProperty %}
  835.                                     <div class="mt-2">
  836.                                         <span><strong>{{'building.dispo'|trans}} </strong> <span> {% if earlyLocation %}{{ earlyLocation|date('d/m/Y') }}{% endif %}</span></span>
  837.                                     </div>
  838.                                 {% else %}
  839.                                     {% if building.dateStartAt is not null %}
  840.                                     <div class="mt-2">
  841.                                         <span><strong>{{'building.dispo'|trans}}</strong> {{ building.dateStartAt|date('d/m/Y') }}</span>
  842.                                     </div>
  843.                                     {% else %}
  844.                                         <p>{{'building.nodispo'|trans}}</p>
  845.                                     {% endif %}
  846.                                 {% endif %}
  847.                                 
  848.                                 {% if building.isAidEligible %}
  849.                                     <div class="mt-2">
  850.                                         <span><strong>{{ 'building.cafeligible'|trans }}</strong></span>
  851.                                     </div>
  852.                                 {% endif %}
  853.                                 {% if building.charges is not empty %}
  854.                                     <div class="my-5">
  855.                                         <h1 class="text-2xl font-bold">{{ 'accueil.Fees'|trans }}</h1>
  856.                                         <div class="grid grid-cols-2 gap-2 my-2 text-sm">
  857.                                             {% for fees in building.charges %}
  858.                                                 <div class="flex items-center">
  859.                                                     <div>
  860.                                                         <span><i class="fa-solid fa-check"></i> {{ fees|trans }}</span>
  861.                                                     </div>
  862.                                                 </div>
  863.                                             {% endfor %}
  864.                                         </div>
  865.                                     </div>
  866.                                 {% endif %}
  867.                                 {% if building.houseRules is not empty %}
  868.                                     <div class="my-5">
  869.                                         <h1 class="text-2xl font-bold">{{ 'accueil.houseRules'|trans }}</h1>
  870.                                         <div class="grid grid-cols-2 gap-2 my-2 text-sm">
  871.                                             {% for rule in building.houseRules %}
  872.                                                 <div class="flex items-center">
  873.                                                     <div>
  874.                                                         <span><i class="fa-solid fa-check"></i> {{ rule|trans }}</span>
  875.                                                     </div>
  876.                                                 </div>
  877.                                             {% endfor %}
  878.                                         </div>
  879.                                     </div>
  880.                                 {% endif %}
  881.                             <div class="mt-6">
  882.                                 {% if app.user %}
  883.                                     {% if "ROLE_TENANT" in app.user.roles %}
  884.                                         {% if app.user.isRegistrationFinalized %}
  885.                                             {% if not building.complexProperty %}
  886.                                                 {% if building.isActive %}
  887.                                                     <div class="d-flex justify-content-center flex flex-wrap justify-between items-center">
  888.                                                         <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">
  889.                                                             <i class="fa-solid fa-file text-white"></i>
  890.                                                             <span class="hidden md:inline">{{ 'building.deposerdemande'|trans }}</span>
  891.                                                         </a>
  892.                                                     </div>
  893.                                                 {% else %}
  894.                                                     <div class="d-flex justify-content-center flex flex-wrap justify-between items-center">
  895.                                                         <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">
  896.                                                             <i class="fa-solid fa-xmark text-white"></i>
  897.                                                             <span class="hidden md:inline">{{ 'building.nondispo'|trans }}</span>
  898.                                                         </a>
  899.                                                     </div>
  900.                                                 {% endif %}
  901.                                             {% endif %}
  902.                                                 {# <div class="mt-6">
  903.                                                     <a href="{{ path('building_reporting',{id : building.id}) }}" class="text-gray-400 w-full font-medium rounded-md text-sm text-center">
  904.                                                         <p class="hidden sm:inline-block">
  905.                                                             <img src="{{ asset('/images/icons/Signaler.png') }}" height="30px" width="30px" class="fa-sharp fa-solid fa-door-open p-1 rounded-lg"/>
  906.                                                             <span class="underline">{{ 'accueil.signalernannonce'|trans }}</span>
  907.                                                         </p>
  908.                                                     </a>
  909.                                                 </div> #}
  910.                                         {% else %}
  911.                                             {% if not building.complexProperty %}
  912.                                                 <div class="d-flex justify-content-center flex flex-wrap justify-between items-center">
  913.                                                     <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">
  914.                                                         <span class="hidden md:inline">{{ 'building.deposerdemande'|trans }}</span>
  915.                                                     </a>
  916.                                                 </div>
  917.                                             {% endif %}
  918.                                         {% endif %}
  919.                                     {% endif %}
  920.                                 {% else %}
  921.                                     <div class="d-flex justify-content-center flex flex-wrap justify-between items-center">
  922.                                         <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">
  923.                                             <span class="hidden md:inline">{{ 'building.deposerdemande'|trans }}</span>
  924.                                         </button>
  925.                                     </div>
  926.                                 {% endif %}
  927.                                 <br>
  928.                                 <div class="mt-6 mb-5">
  929.                                     {% if building.DEP != null %}
  930.                                         <div class="mt-6">
  931.                                             <h1 class="text-2xl font-bold">DPE ({{'building.dpe'|trans}})</h1>
  932.                                             <br>
  933.                                             <div class='grid grid-cols-8 gap-1 text-center align-middle'>
  934.                                             
  935.                                                     {% if building.DEP == 'A' %}
  936.                                                         <span id="dpe" class=" DPE-bar-A text-2xl font-bold rounded-l-lg">A</span>
  937.                                                         <span id="dpe" class=" DPE-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  938.                                                         <span id="dpe" class=" DPE-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  939.                                                         <span id="dpe" class=" DPE-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  940.                                                         <span id="dpe" class=" DPE-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  941.                                                         <span id="dpe" class=" DPE-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  942.                                                         <span id="dpe" class=" DPE-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  943.                                                     {% elseif building.DEP ==  'B' %}
  944.                                                         <span id="dpe" class=" DPE-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  945.                                                         <span id="dpe" class=" DPE-bar-B text-2xl font-bold ">B</span>
  946.                                                         <span id="dpe" class=" DPE-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  947.                                                         <span id="dpe" class=" DPE-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  948.                                                         <span id="dpe" class=" DPE-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  949.                                                         <span id="dpe" class=" DPE-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  950.                                                         <span id="dpe" class=" DPE-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  951.                                                     {% elseif building.DEP == 'C' %}
  952.                                                         <span id="dpe" class=" DPE-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  953.                                                         <span id="dpe" class=" DPE-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  954.                                                         <span id="dpe" class=" DPE-bar-C text-2xl font-bold">C</span>
  955.                                                         <span id="dpe" class=" DPE-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  956.                                                         <span id="dpe" class=" DPE-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  957.                                                         <span id="dpe" class=" DPE-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  958.                                                         <span id="dpe" class=" DPE-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  959.                                                     {% elseif building.DEP == 'D' %}
  960.                                                         <span id="dpe" class=" DPE-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  961.                                                         <span id="dpe" class=" DPE-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  962.                                                         <span id="dpe" class=" DPE-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  963.                                                         <span id="dpe" class=" DPE-bar-D text-2xl font-bold">D</span>
  964.                                                         <span id="dpe" class=" DPE-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  965.                                                         <span id="dpe" class=" DPE-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  966.                                                         <span id="dpe" class=" DPE-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  967.                                                     {% elseif building.DEP == 'E' %}
  968.                                                         <span id="dpe" class=" DPE-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  969.                                                         <span id="dpe" class=" DPE-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  970.                                                         <span id="dpe" class=" DPE-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  971.                                                         <span id="dpe" class=" DPE-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  972.                                                         <span id="dpe" class=" DPE-bar-E text-2xl font-bold">E</span>
  973.                                                         <span id="dpe" class=" DPE-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  974.                                                         <span id="dpe" class=" DPE-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  975.                                                     {% elseif building.DEP == 'F' %}
  976.                                                         <span id="dpe" class=" DPE-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  977.                                                         <span id="dpe" class=" DPE-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  978.                                                         <span id="dpe" class=" DPE-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  979.                                                         <span id="dpe" class=" DPE-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  980.                                                         <span id="dpe" class=" DPE-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  981.                                                         <span id="dpe" class=" DPE-bar-F text-2xl font-bold">F</span>
  982.                                                         <span id="dpe" class=" DPE-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>    
  983.                                                     {% elseif building.DEP == 'G' %}
  984.                                                         <span id="dpe" class=" DPE-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  985.                                                         <span id="dpe" class=" DPE-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  986.                                                         <span id="dpe" class=" DPE-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  987.                                                         <span id="dpe" class=" DPE-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  988.                                                         <span id="dpe" class=" DPE-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  989.                                                         <span id="dpe" class=" DPE-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  990.                                                         <span id="dpe" class=" DPE-bar-G text-2xl font-bold rounded-r-lg">G</span>
  991.                                                     {% endif %}
  992.                                             </div>
  993.                                             {% if building.DEP == 'Vierge' %}
  994.                                                 <div class='text-center align-middle'>
  995.                                                     <span id="dpe" class="DPE-bar-V text-[20px] text-white rounded-r-lg p-2">Vierge</span>
  996.                                                 </div>
  997.                                             {% endif %}
  998.                                         </div>
  999.                                     {% endif %}
  1000.                                     {% if building.GES != null %}
  1001.                                         <div class="mt-6">
  1002.                                             <h1 class="text-2xl font-bold">GES ({{'building.ges'|trans}})</h1>
  1003.                                             <br>
  1004.                                             <div class='grid grid-cols-8 gap-1 text-center align-middle'>
  1005.                                                 
  1006.                                                     {% if building.GES == 'A' %}
  1007.                                                         <span id="ges" class=" GES-bar-A text-2xl font-bold rounded-l-lg">A</span>
  1008.                                                         <span id="ges" class=" GES-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  1009.                                                         <span id="ges" class=" GES-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  1010.                                                         <span id="ges" class=" GES-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  1011.                                                         <span id="ges" class=" GES-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  1012.                                                         <span id="ges" class=" GES-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  1013.                                                         <span id="ges" class=" GES-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  1014.                                                     {% elseif building.GES ==  'B' %}
  1015.                                                         <span id="ges" class=" GES-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  1016.                                                         <span id="ges" class=" GES-bar-B text-2xl font-bold ">B</span>
  1017.                                                         <span id="ges" class=" GES-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  1018.                                                         <span id="ges" class=" GES-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  1019.                                                         <span id="ges" class=" GES-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  1020.                                                         <span id="ges" class=" GES-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  1021.                                                         <span id="ges" class=" GES-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  1022.                                                     {% elseif building.GES == 'C' %}
  1023.                                                         <span id="ges" class=" GES-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  1024.                                                         <span id="ges" class=" GES-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  1025.                                                         <span id="ges" class=" GES-bar-C text-2xl font-bold">C</span>
  1026.                                                         <span id="ges" class=" GES-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  1027.                                                         <span id="ges" class=" GES-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  1028.                                                         <span id="ges" class=" GES-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  1029.                                                         <span id="ges" class=" GES-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  1030.                                                     {% elseif building.GES == 'D' %}
  1031.                                                         <span id="ges" class=" GES-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  1032.                                                         <span id="ges" class=" GES-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  1033.                                                         <span id="ges" class=" GES-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  1034.                                                         <span id="ges" class=" GES-bar-D text-2xl font-bold">D</span>
  1035.                                                         <span id="ges" class=" GES-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  1036.                                                         <span id="ges" class=" GES-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  1037.                                                         <span id="ges" class=" GES-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  1038.                                                     {% elseif building.GES == 'E' %}
  1039.                                                         <span id="ges" class=" GES-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  1040.                                                         <span id="ges" class=" GES-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  1041.                                                         <span id="ges" class=" GES-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  1042.                                                         <span id="ges" class=" GES-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  1043.                                                         <span id="ges" class=" GES-bar-E text-2xl font-bold">E</span>
  1044.                                                         <span id="ges" class=" GES-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  1045.                                                         <span id="ges" class=" GES-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>
  1046.                                                     {% elseif building.GES == 'F' %}
  1047.                                                         <span id="ges" class=" GES-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  1048.                                                         <span id="ges" class=" GES-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  1049.                                                         <span id="ges" class=" GES-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  1050.                                                         <span id="ges" class=" GES-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  1051.                                                         <span id="ges" class=" GES-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  1052.                                                         <span id="ges" class=" GES-bar-F text-2xl font-bold">F</span>
  1053.                                                         <span id="ges" class=" GES-bar-G text-2xl font-bold rounded-r-lg mt-2.5 h-2"></span>    
  1054.                                                     {% elseif building.GES == 'G' %}
  1055.                                                         <span id="ges" class=" GES-bar-A text-2xl font-bold rounded-l-lg mt-2.5 h-2"></span>
  1056.                                                         <span id="ges" class=" GES-bar-B text-2xl font-bold mt-2.5 h-2"></span>
  1057.                                                         <span id="ges" class=" GES-bar-C text-2xl font-bold mt-2.5 h-2"></span>
  1058.                                                         <span id="ges" class=" GES-bar-D text-2xl font-bold mt-2.5 h-2"></span>
  1059.                                                         <span id="ges" class=" GES-bar-E text-2xl font-bold mt-2.5 h-2"></span>
  1060.                                                         <span id="ges" class=" GES-bar-F text-2xl font-bold mt-2.5 h-2"></span>
  1061.                                                         <span id="ges" class=" GES-bar-G text-2xl font-bold rounded-r-lg">G</span>
  1062.                                                     {% endif %}
  1063.                                             </div>
  1064.                                             {% if building.GES == 'Vierge' %}
  1065.                                                 <div class='text-center align-middle'>
  1066.                                                     <span id="ges" class="GES-bar-V text-[20px] text-white rounded-r-lg p-2">Vierge</span>
  1067.                                                 </div>
  1068.                                             {% endif %}
  1069.                                         </div>
  1070.                                     {% endif %}
  1071.                                     {# {% if not building.complexProperty %}
  1072.                                         <div style="text-align: center; margin-top: 30px;">
  1073.                                             <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>
  1074.                                         </div>
  1075.                                     {% endif %} #}
  1076.                                 </div>
  1077.                                 <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">
  1078.                                 <p class="flex justify-center items-center h-full">
  1079.                                     <span class="underline">{{ 'accueil.signalernannonce'|trans }}</span>
  1080.                                 </p>
  1081.                             </a>
  1082.                             </div>
  1083.                         </div>
  1084.                     </div>
  1085.                 </div>
  1086.                 {% if similarProperties %}
  1087.                     <p class="text-2xl m-2"><strong>{{ 'accueil.log'|trans }}</strong></p>
  1088.                     <div style="width: 95%" class="relative border border-gray-300 hover:border-blue-500 shadow-2xl rounded p-6">
  1089.                         <div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
  1090.                             {% for loopIndex, building in similarProperties %}
  1091.                             {% if loopIndex % 43 == 0 and loopIndex != 0 %}
  1092.                         </div>
  1093.                     <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
  1094.                         {% endif %}
  1095.                         <div class="w-full text-center">
  1096.                             {% if building.buildingDocuments is not empty %}
  1097.                             {% set filteredDocuments = building.buildingDocuments|filter(document => document.name starts with 'file' or document.name starts with 'base' or document.name starts with 'cover') %}
  1098.                             {% if filteredDocuments is not empty %}
  1099.                                 {% if filteredDocuments|length > 1 %}
  1100.                                     <div id="carousel-{{ building.id }}" class="relative z-0 w-full" data-carousel="static">
  1101.                                         <div class="overflow-hidden relative h-[20rem] md:h-[10rem] lg:h-[20rem] flex mt-10">
  1102.                                             {% for document in filteredDocuments %}
  1103.                                                 {% if document.imageFile %}
  1104.                                                     <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>
  1105.                                                 {% endif %}
  1106.                                             {% endfor %}
  1107.                                         </div>
  1108.                                         <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>
  1109.                                             <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">
  1110.                                                 <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>
  1111.                                                 <span class="hidden">Previous</span>
  1112.                                             </span>
  1113.                                         </button>
  1114.                                         <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>
  1115.                                             <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">
  1116.                                                 <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>
  1117.                                                 <span class="hidden">Next</span>
  1118.                                             </span>
  1119.                                         </button>
  1120.                                         <div class="flex absolute bottom-5 left-1/2 z-30 space-x-3 -translate-x-1/2">
  1121.                                             {% for document in filteredDocuments %}
  1122.                                                 {% if document.imageFile %}
  1123.                                                     <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>
  1124.                                                 {% endif %}
  1125.                                             {% endfor %}
  1126.                                         </div>
  1127.                                     </div>
  1128.                                 {% elseif filteredDocuments|length == 1 %}
  1129.                                     <div class="overflow-hidden relative h-[14rem] md:h-[10rem] lg:h-[14rem]">
  1130.                                         {% for bd in filteredDocuments %}
  1131.                                             <div class="rounded-xl h-full bg-[url({{ asset('images/files/' ~ bd.imageFile) }})] bg-cover bg-no-repeat bg-center"></div>
  1132.                                         {% endfor %}
  1133.                                         {% if building.propertyManager.lessorType == "Gestionnaire" %}
  1134.                                             <img src="{{ asset('/images/site/bandeau-pro.png') }}" alt="Bandeau pro" class="absolute bottom-2 right-2 h-6 opacity-90 z-[1000]">
  1135.                                         {% endif %}                                    
  1136.                                     </div>
  1137.                                 {% endif %}
  1138.                             {% else %}
  1139.                                 <p>No images</p>
  1140.                             {% endif %}
  1141.                             {% else %}
  1142.                                 <p>No documents available for this building.</p>
  1143.                             {% endif %}
  1144.                             <p class="text-2xl m-2 break-words whitespace-normal">
  1145.                                 {% if building.title %}
  1146.                                     <strong>{{ building.title }}</strong>
  1147.                                 {% else %}
  1148.                                     &nbsp;
  1149.                                 {% endif %}
  1150.                             </p>
  1151.                             <p>
  1152.                                 <strong>{{ 'accueil.city'|trans }} :</strong> {{ building.cityEntity.city }}
  1153.                             </p>
  1154.                             <p>
  1155.                                 <strong>{{ 'accueil.superfi'|trans }}</strong> {{ building.surface }} m²
  1156.                             </p>
  1157.                             <p>
  1158.                                 <strong>{{ 'accueil.loyermen'|trans }}</strong> {{ building.rent / 100 }} euros
  1159.                             </p
  1160.                             <p>
  1161.                                 {% if building.isActive %}
  1162.                                     <strong>{{ 'accueil.startloc'|trans }}</strong> {{ building.dateStartAt|date('d/m/Y') }}
  1163.                                 {% else %}
  1164.                                     &nbsp;
  1165.                                 {% endif %}
  1166.                             </p>
  1167.                             
  1168.                             {% if app.user %}
  1169.                             {% if "ROLE_TENANT" in app.user.roles %}
  1170.                             {% if app.user.isRegistrationFinalized %}
  1171.                             {% if building.isActive %}
  1172.                                 <div class="d-flex justify-content-center flex flex-wrap justify-between items-center m-4">
  1173.                                     <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">
  1174.                                         <span class="inline">{{ 'accueil.more'|trans }}</span>
  1175.                                     </a>
  1176.                                 </div>
  1177.                             {% else %}
  1178.                                 <div class="d-flex justify-content-center flex flex-wrap justify-between items-center m-4">
  1179.                                     <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">
  1180.                                         <i class="fa-solid fa-xmark text-white"></i>
  1181.                                         <span class="inline">{{ 'building.nondispo'|trans }}</span>
  1182.                                     </a>
  1183.                                 </div>
  1184.                             {% endif %}
  1185.                             {% else %}
  1186.                                 <div class="d-flex justify-content-center flex flex-wrap justify-between items-center m-4">
  1187.                                     <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">
  1188.                                         <span class="inline">{{ 'building.deposerdemande'|trans }}</span>
  1189.                                     </a>
  1190.                                 </div>
  1191.                             {% endif %}
  1192.                             {% endif %}
  1193.                             {% else %}
  1194.                             <div class="d-flex justify-content-center flex flex-wrap justify-between items-center m-4">
  1195.                                 <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">
  1196.                                     <span class="inline">{{ 'building.deposerdemande'|trans }}</span>
  1197.                                 </button>
  1198.                             </div>
  1199.                             {% endif %}
  1200.                         </div>
  1201.                         {% endfor %}
  1202.                     </div>
  1203.                     {% if buildingsInComplex|length % 3 != 0 %}
  1204.                         <div class="grid grid-cols-1 sm:grid-cols-2 gap-4"></div>
  1205.                     {% endif %}
  1206.                 </div>
  1207.                 {% endif %}
  1208.                 </div>
  1209.             </div>
  1210.         </div>
  1211.     </div>
  1212.     <div id="sharePopup" class="fixed inset-0 bg-black bg-opacity-50 flex justify-center items-center hidden">
  1213.         <div class="bg-white p-6 rounded-lg shadow-lg">
  1214.             <h2 class="text-xl font-bold mb-4">Partager ce logement via :</h2>
  1215.             <div class="flex flex-col items-center space-y-4">
  1216.                 <a href="mailto:?subject=Regardez ce logement&body=Voici un logement qui pourrait vous intéresser : {{ app.request.uri }}" target="_blank" class="p-2">
  1217.                     <img src="{{ asset('/images/email.png') }}" alt="Mail" class="w-8 h-8">
  1218.                 </a>
  1219.                 <a href="https://www.facebook.com/sharer/sharer.php?u={{ app.request.uri|url_encode }}" target="_blank" class="p-2">
  1220.                     <img src="{{ asset('/images/facebook.png') }}" alt="Facebook" class="w-8 h-8">
  1221.                 </a>
  1222.                 <a href="https://wa.me/?text=Voici un logement qui pourrait vous intéresser : {{ app.request.uri|url_encode }}" target="_blank" class="p-2">
  1223.                     <img src="{{ asset('/images/whatsapp.jfif') }}" alt="WhatsApp" class="w-8 h-8">
  1224.                 </a>
  1225.                 <button onclick="copyToClipboard('{{ app.request.uri }}')" class="p-2">
  1226.                     <img src="{{ asset('/images/link.png') }}" alt="Copy" class="w-8 h-8">
  1227.                 </button>
  1228.             </div>
  1229.             <div class="flex justify-center mt-4">
  1230.                 <button onclick="toggleSharePopup()" class="bg-gray-300 hover:bg-gray-400 text-black font-medium rounded-md text-sm px-4 py-2">
  1231.                     Fermer
  1232.                 </button>
  1233.             </div>
  1234.         </div>
  1235.     </div>
  1236.     
  1237. {% set googleMapsApiKey = app.request.server.get('GOOGLEMAP_KEY') %}
  1238.         <script>
  1239.             const googleMapsApiKey = "{{ googleMapsApiKey }}";
  1240.             var iconMap = "{{ asset('/images/icons/Bons Plans.png') }}";
  1241.         </script>
  1242.     {% block scripts %}
  1243.     <script async src="{{ 'https://maps.googleapis.com/maps/api/js' ~ '?key=' ~ googleMapsApiKey ~ '&callback=initMap&v=beta&libraries=places,geometry,marker' }}"></script>
  1244.             <script>
  1245.             function initMap() {
  1246.             var input = document.getElementById('addressDistanceInput');
  1247.             var options = {
  1248.                 types: ['geocode'],
  1249.                 componentRestrictions: { country: ["fr", "es", "be", "lu", "de", "it", "pt", "ca"] }
  1250.                 };
  1251.             var autocomplete = new google.maps.places.Autocomplete(input, options);
  1252.             var currentMarker = null;
  1253.             var currentCircle = null;
  1254.             
  1255.             google.maps.event.addListener(autocomplete, 'place_changed', function() {
  1256.                 var place = autocomplete.getPlace();
  1257.                 var addressInput = place.formatted_address;
  1258.                 
  1259.                 if (!place.geometry) {
  1260.                     console.log("Aucun détail géographique trouvé pour cette adresse.");
  1261.                     return;
  1262.                 }
  1263.                 var latitude = place.geometry.location.lat();
  1264.                 var longitude = place.geometry.location.lng();
  1265.                 
  1266.                 if (currentMarker) currentMarker.setMap(null);
  1267.                 if (currentCircle) currentCircle.setMap(null);
  1268.                 var iconMap = {
  1269.                     url: "{{ asset('/images/icons/ecole.png') }}",
  1270.                     scaledSize: new google.maps.Size(40, 40),
  1271.                     anchor: new google.maps.Point(20, 40)
  1272.                 };
  1273.                 currentMarker = new google.maps.Marker({
  1274.                     position: { lat: latitude, lng: longitude },
  1275.                     map: map,
  1276.                     title: "Adresse distance",
  1277.                     icon: iconMap,
  1278.                 });
  1279.                 //console.log(currentMarker)
  1280.                 currentCircle = new google.maps.Circle({
  1281.                     strokeColor: "#FFFF00",
  1282.                     strokeOpacity: 0.8,
  1283.                     strokeWeight: 2,
  1284.                     fillColor: "#FFFF00",
  1285.                     fillOpacity: 0.35,
  1286.                     map: map,
  1287.                     center: {lat: {{ building.lat|json_encode|raw }}, lng: {{ building.lng|json_encode|raw }}},
  1288.                     radius: 2500,
  1289.                     zoom: 50,
  1290.                 });
  1291.                                 
  1292.                 var initialPosition = new google.maps.LatLng({{ building.lat|json_encode|raw }}, {{ building.lng|json_encode|raw }});
  1293.                 var newPosition = new google.maps.LatLng(latitude, longitude);
  1294.                 var distance = google.maps.geometry.spherical.computeDistanceBetween(initialPosition, newPosition);
  1295.                 distance = Math.round(distance /1000);
  1296.                 var temps = (distance/80)*60;
  1297.                 temps = Math.round(temps);
  1298.                 var addressDistanceField = document.querySelector('#addressDistance');
  1299.                 addressDistanceField.style.display = 'block';
  1300.                 addressDistanceField.innerHTML = `
  1301.                     <p>{{ 'building.logement1'|trans }} ${distance} {{ 'building.logement2'|trans }} ${temps} {{ 'building.logement3'|trans }}</p>
  1302.                     <p>{{ 'building.logement4'|trans }}</p>
  1303.                 `;
  1304.                 
  1305.                 map.setCenter(new google.maps.LatLng(latitude, longitude));
  1306.                 const ua = navigator.userAgent;
  1307.                 const device = /iPad|iPhone|iPod/.test(ua) ? 'iOS' : 'Windows/Android';
  1308.                 var initialAddress =
  1309.                       {{ building.street|json_encode|raw }} + " " 
  1310.                     + {{ building.cityEntity.city|json_encode|raw }} + " " 
  1311.                     + {{ building.cityEntity.postalCode|json_encode|raw }} + " " 
  1312.                     + {{ building.cityEntity.country|json_encode|raw }};
  1313.                 if(initialAddress && addressInput){
  1314.                     var divRedirectMap = document.getElementById('redirectMap');
  1315.                     divRedirectMap.innerHTML = "";
  1316.                     divRedirectMap.style.display = "block";
  1317.                     let a = document.createElement("a");
  1318.                     a.append("{{ 'accueil.mapsRedirectButton'|trans }}");
  1319.                     a.style.display = "block";
  1320.                     a.style.width = "100%";
  1321.                     a.style.height = "100%";
  1322.                     if(device == 'iOS'){
  1323.                         a.href = `https://maps.apple.com/?saddr=${initialAddress}&daddr=${addressInput}`;
  1324.                     }
  1325.                     else {
  1326.                         a.href = `https://www.google.com/maps/dir/?api=1&origin=${initialAddress}&destination=${addressInput}`;
  1327.                     }
  1328.                     a.target = "_blank";
  1329.                     divRedirectMap.append(a);
  1330.                 }        
  1331.             });
  1332.             if ({{ building.lat|json_encode|raw }} == null || {{ building.lng|json_encode|raw }} == null) {
  1333.                 return 0;
  1334.             }
  1335.             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, });
  1336.             const parser = new DOMParser();
  1337.             
  1338.             // A marker with a custom inline SVG.
  1339.             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">
  1340.                             <defs>
  1341.                             <filter id="alpha" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%">
  1342.                             <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"/>
  1343.                             </filter>
  1344.                             <mask id="mask0">
  1345.                             <g filter="url(#alpha)">
  1346.                             <rect x="0" y="0" width="30" height="40" style="fill:rgb(0%,0%,0%);fill-opacity:0.996078;stroke:none;"/>
  1347.                             </g>
  1348.                             </mask>
  1349.                             <clipPath id="clip1">
  1350.                             <rect x="0" y="0" width="30" height="40"/>
  1351.                             </clipPath>
  1352.                             <g id="surface5" clip-path="url(#clip1)">
  1353.                             <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 "/>
  1354.                             </g>
  1355.                             </defs>
  1356.                             <g id="surface1">
  1357.                             <use xlink:href="#surface5" mask="url(#mask0)"/>
  1358.                             <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 "/>
  1359.                             <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 "/>
  1360.                             <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 "/>
  1361.                             <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 "/>
  1362.                             <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 "/>
  1363.                             </g>
  1364.                         </svg>`
  1365.             const pinSvgElement = parser.parseFromString(pinSvgString, "image/svg+xml").documentElement;
  1366.             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(), });
  1367.         }
  1368.         window.initMap = initMap;
  1369.         function showMap() {
  1370.             document.getElementById('map').style.filter = "none";
  1371.             document.getElementById('mapGoogle').style.display = "none";
  1372.         }
  1373.         </script>
  1374.     {% endblock %}
  1375. {% endblock %}
  1376. {% block javascripts %}
  1377.     <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css"/>
  1378.     <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.min.css"/>
  1379.     <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
  1380.     <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js"></script>
  1381.     <script type="text/javascript">
  1382.         $(document).ready(function() {
  1383.             const $carousel = $('.slick-carousel');
  1384.             $carousel.slick({
  1385.                 slidesToShow: 1,
  1386.                 slidesToScroll: 1,
  1387.                 autoplay: false,
  1388.                 arrows: false,
  1389.                 dots: true,
  1390.                 responsive: [
  1391.                     {
  1392.                         breakpoint: 1024,
  1393.                         settings: { slidesToShow: 1 }
  1394.                     },
  1395.                     {
  1396.                         breakpoint: 768,
  1397.                         settings: { slidesToShow: 1 }
  1398.                     }
  1399.                 ]
  1400.             });
  1401.             $('.slick-custom-prev').on('click', function () {
  1402.                 $carousel.slick('slickPrev');
  1403.             });
  1404.             $('.slick-custom-next').on('click', function () {
  1405.                 $carousel.slick('slickNext');
  1406.             });
  1407.         });
  1408.     </script>
  1409.     <script>
  1410.         function resize() {
  1411.             const fd= document.getElementById("firstDiv");
  1412.             if(screen.width<768){
  1413.                 fd.parentElement.classList.remove("container","px-4","py-8");
  1414.                 fd.parentElement.parentElement.classList.remove('m-auto');
  1415.                 
  1416.             }else{
  1417.                 fd.parentElement.classList.add("container","px-4","py-8");
  1418.                 fd.parentElement.parentElement.classList.add('m-auto');
  1419.             }
  1420.         }
  1421.         $(document).ready(function () {
  1422.             resize();
  1423.             const el = document.getElementById('description');
  1424.             const btn = document.getElementById('showMoreDescription');
  1425.             if (el && btn) {
  1426.                 if (el.scrollHeight > el.clientHeight) {
  1427.                     btn.style.display = 'block';
  1428.                 } else {
  1429.                     btn.style.display = 'none';
  1430.                 }
  1431.                 btn.addEventListener("click", function () {
  1432.                     el.classList.toggle("line-clamp-[5]");
  1433.                     const showText = btn.getAttribute("data-more");
  1434.                     const hideText = btn.getAttribute("data-less");
  1435.                     btn.textContent = el.classList.contains("line-clamp-[5]") ? showText : hideText;
  1436.                 });
  1437.             }
  1438.         });
  1439.         
  1440.         window.onresize = resize;
  1441.     </script>
  1442.     <script>
  1443.         function zoomImage(imageUrl)
  1444.         {
  1445.             const zoomImageContainer = document.getElementById("zoomContainer")
  1446.             const zoomImage = document.getElementById("zoomImg")
  1447.             zoomImage.src = `{{ asset('images/files/') }}${imageUrl}`;
  1448.             zoomImageContainer.style.display = "flex";
  1449.             zoomImage.style.minWidth = "65%";
  1450.         }
  1451.         function closeZoomImage()
  1452.         {
  1453.             const zoomImageContainer = document.getElementById("zoomContainer")
  1454.             zoomImageContainer.style.display = "none";
  1455.         }
  1456.     </script>
  1457.     <script>
  1458.         $(document).ready(function() {
  1459.             $('.like-button').click(function() {
  1460.                 const imageId = $(this).data('image-id');
  1461.                 $(this).toggleClass('fa-solid');
  1462.                 $(this).toggleClass('fa-regular');
  1463.                 // Send AJAX request to like the image
  1464.                 $.ajax({
  1465.                     type: 'POST',
  1466.                     url: '{{ path('liked_building_action', {'id': 'IMAGE_ID'}) }}'.replace('IMAGE_ID', imageId),
  1467.                     success: function(response) {
  1468.                         if(!response['success']){
  1469.                             window.location.href = '{{ path('app_login') }}';
  1470.                         }
  1471.                     }.bind(this),
  1472.                     error: function() {
  1473.                         // Handle AJAX error
  1474.                     }
  1475.                 });
  1476.             });
  1477.         });
  1478.     </script>
  1479.     <script>
  1480.         function toggleSharePopup() {
  1481.             const sharePopup = document.getElementById('sharePopup');
  1482.             sharePopup.classList.toggle('hidden');
  1483.         }
  1484.         function copyToClipboard(text) {
  1485.             navigator.clipboard.writeText(text).then(function() {
  1486.                 alert('Lien copié dans le presse-papiers');
  1487.             }, function(err) {
  1488.                 console.error('Erreur lors de la copie du texte: ', err);
  1489.             });
  1490.         }
  1491.     </script>
  1492. {% endblock %}