templates/home/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Accueil - {{ parent() }}{% endblock %}
  3. {% block body %}
  4.     <link rel="stylesheet" href="{{ asset('css/swip.css') }}">
  5.     <div id="title_annonce">
  6.         <h1 class="text-danger fs-1 fs-lg-6 mt-1">Découvrez les dernières annonces</h1>
  7.         <h2 class="text-secondary-emphasis">De votre agence immobilière préférée</h2>
  8.         <hr>
  9.     </div>
  10.     <div id="modals">
  11.         {% for property in properties %}
  12.             {{ include('modal/show.html.twig', { 'property': property }) }}
  13.         {% endfor %}
  14.     </div>
  15.     
  16.     <div class="swiper-container swiper mySwiper">
  17.     <div class="swiper-button-prev"></div>
  18.         <div class="swiper-wrapper">
  19.     {% for property in properties %}
  20.                 <div class="swiper-slide">
  21.                     {% if property.images|length > 0 %}
  22.                         <img style="width: 450px; height: 400px; " src="{{ asset('images/properties/' ~ property.images[0].imagename) }}" alt="{{ property.title }}">
  23.                     {% else %}
  24.                          <img src="{{ asset ('images/no-image.png') }}" style=""  alt="No image available">
  25.                     {% endif %}
  26.                         <div class="slide-content">
  27.                             <h2>{{ property.title }}</h2>
  28.                             <h5 class="text-danger">{{ property.housingType.name }} - {{ property.category.name }}
  29.                                 {% if property.category.name matches '/location/i' and property.subType is not empty %}
  30.                                     - {{ property.subType.name }}
  31.                                 {% endif %}
  32.                             </h5>
  33.                             {% if property.category.name matches '/location/i' and property.subType is not empty %}
  34.                                     <h2 id="price">{{ property.rent|number_format }} €/mois</h2>
  35.                             {% else %}
  36.                                     <h2 id="price">{{ property.price|number_format }} €</h2>
  37.                             {% endif %}
  38.                         </div>
  39.             <div class="d-flex">
  40.                             <div class="d-flex flex-row align-items-center">
  41.                                 <button id="favori-button-{{ property.id }}" class="favori-button"   onclick="toggleFavori({{ property.id }})" data-property-id="{{ property.id }}"></button>
  42.                                 <h6 class="fs-6 ml-2 position-relative" id="favori_numb" >{{ property.favoritNumber }}</h6>
  43.                                 
  44.                 </div>
  45.                             <button id="voir"type="button" class="btn open-modal-btn mt-4 text-white px-4 py-2 rounded" data-toggle="modal" data-target="#exampleModal-{{ property.id }}">Voir</button>
  46.                         </div>
  47.                 </div>
  48.             {% endfor %}
  49.     </div>
  50.         <div class="swiper-button-next"></div>
  51.     </div>
  52. </div>
  53. <button aria-label="Prendre un Rendez-vous" type="button" data-toggle="tooltip" data-custom-class="custom-tooltip" data-placement="left" title="Prendre un Rendez-vous" class="btn btn-danger position-fixed" style="bottom: 0; right: 0; margin: 2em; z-index: 2; border-radius: 3em; width: 5em; height: 5em;" onclick="window.location='{{ path('app_appointment_new') }}';">
  54.     <i class="fa-solid fa-calendar-days" style="font-size: 2em;"></i>
  55. </button>
  56. <script>
  57. $(function () {
  58.             $('[data-toggle="tooltip"]').tooltip({
  59.                 delay: { "show": 500, "hide": 100 },
  60.                 customClass: 'custom-tooltip'
  61.             });
  62.         });
  63. window.favoriUpdateUrl = '{{ path('app_favori_update') }}';
  64. </script>
  65.     
  66. <script src="{{asset('js/swiper.js')}}"> </script>    
  67.     <script src="{{ asset('js/favorit.js') }}"></script>
  68. {% endblock %}