templates/front/property/list.html.twig line 1

Open in your IDE?
  1. {% extends 'base_front.html.twig' %}
  2. {% block meta %}
  3.     <title>Bourg | {% if contentHeader.preTitle is defined %}{{ contentHeader.preTitle }}{% endif %}</title>
  4.     {% if contentHeader.title is defined %}
  5.         <meta name="description" content="{% if contentHeader.preTitle is defined %}{{ contentHeader.preTitle ~ ' | ' }}{% endif %}{{ contentHeader.title|striptags }}">
  6.     {% endif %}
  7. {% endblock %}
  8. {% block body %}
  9.     <section class="slide-header list">
  10.         <div class="main-slide">
  11.             <div class="img-main-slide position-relative" style="background:url({{ asset(constant('App\\Services\\UploadFileService::POST_IMAGE_DIR') ~ slider.image1) }})no-repeat center;background-size:cover;" id="mainImg">
  12.                 <div class="title-page bg-blue d-flex gold justify-content-end position-absolute">
  13.                     <!--img src="{{ asset('img/icons/chevrons-right.svg') }}" alt="chevrons droite"-->
  14.                     <span class="ml-3">{{ contentHeader.preTitle|capitalize }}</span>
  15.                 </div>
  16.             </div>
  17.         </div>
  18.         {% set titleSplited = contentHeader.title|split(' ') %}
  19.         <div class="slides-title page d-flex align-items-center justify-content-end col-md-11 p-0 float-right position-relative">
  20.             <h1 class="title-left-right mr-5">
  21.                 {% if titleSplited|length > 1 %}
  22.                     <span>{{ titleSplited.0 }} {{ titleSplited.1 }}</span><br>
  23.                     <span class="gold">
  24.                         {% for word in titleSplited|slice(2) %}
  25.                             {{ ' ' ~ word }}
  26.                         {% endfor %}
  27.                     </span>
  28.                 {% else %}
  29.                     <span>{{ contentHeader.title }}</span>
  30.                 {% endif %}
  31.                 {% if app.user %}
  32.                     <a href="{{ path('back_content_edit', {'id': contentHeader.id}) }}"><i class="fas fa-pencil-alt" style="color:red"></i></a>
  33.                 {% endif %}
  34.             </h1>
  35.             <a href="#" class="position-absolute arrow-slide-single" id="arrowSlideMove" onclick="javascript: return false;">
  36.                 <img src="{{ asset('img/icons/arrow-right.svg') }}">
  37.             </a>
  38.             <div class="slide-miniatures d-flex align-self-baseline" id="containerMiniatures">
  39.                 {% if slider.image2 %}
  40.                     <div class="slide position-relative float-left">
  41.                         <img src="{{ asset(constant('App\\Services\\UploadFileService::POST_IMAGE_DIR') ~ slider.image2) }}">
  42.                     </div>
  43.                 {% endif %}
  44.                 {% if slider.image3 %}
  45.                     <div class="slide position-relative float-left">
  46.                         <img src="{{ asset(constant('App\\Services\\UploadFileService::POST_IMAGE_DIR') ~ slider.image3) }}">
  47.                     </div>
  48.                 {% endif %}
  49.                 {% if slider.image4 %}
  50.                     <div class="slide position-relative float-left">
  51.                         <img src="{{ asset(constant('App\\Services\\UploadFileService::POST_IMAGE_DIR') ~ slider.image4) }}">
  52.                     </div>
  53.                 {% endif %}
  54.             </div>
  55.         </div>
  56.         <a href="#targetSeeMore" class="btn-see-more position-absolute d-flex flex-column align-items-center gold text-center">
  57.             <span>En savoir plus</span>
  58.             <img src="{{ asset('img/icons/arrow-bottom-gold.svg') }}" alt="En savoir plus" class="mb-2">
  59.             
  60.         </a>
  61.     </section>
  62.     <section class="form-filter" id="targetSeeMore">
  63.         <div class="container">
  64.             <div class="title-page bg-blue d-flex gold pl-0">
  65.                 <!--img src="{{ asset('img/icons/chevrons-right.svg') }}" alt="chevrons droite"-->
  66.                 <span class="ml-3">Vos critères</span>
  67.             </div>
  68.             <form class="mt-3" id="formFilter">
  69.                 <input name="advert-type" id="advertTypeFilter" type="hidden" value="{{ type }}">
  70.                 <div class="row">
  71.                     <div class="col-md-2">
  72.                         <select class="w-100" name="type">
  73.                             <option value="">Type</option>
  74.                             <option value="Maison">Maison</option>
  75.                             <option value="Appartement">Appartement</option>
  76.                             <option value="Commerce">Commerce</option>
  77.                             <option value="Garage">Garage</option>
  78.                             <option value="Parking">Parking</option>
  79.                             <option value="Terrain">Terrain</option>
  80.                         </select>
  81.                     </div>
  82.                     <div class="col-md-2">
  83.                         <select class="w-100" name="rent">
  84.                             <option value="">Vente / Location</option>
  85.                             <option value="vente" {% if type == 'vente' %}selected{% endif %}>Vente</option>
  86.                             <option value="location" {% if type == 'location' %}selected{% endif %}>Location</option>
  87.                         </select>
  88.                     </div>
  89.                     <div class="col-md-2">
  90.                         <select class="w-100" name="location">
  91.                             <option value="">Localisation</option>
  92.                             {% for city in advertCities %}
  93.                                 <option value="{{ city }}">{{ city }}</option>
  94.                             {% endfor %}
  95.                         </select>
  96.                     </div>
  97.                     <div class="col-md-2">
  98.                         {% if type == 'vente' %}
  99.                             <select class="w-100" name="max_price">
  100.                                 <option value="">Budget Max.</option>
  101.                                 <option value="500000">500 000€</option>
  102.                                 <option value="600000">600 000€</option>
  103.                                 <option value="700000">700 000€</option>
  104.                                 <option value="800000">800 000€</option>
  105.                                 <option value="900000">900 000€</option>
  106.                                 <option value="1000000">1 000 000€</option>
  107.                                 <option value="1500000">1 500 000€</option>
  108.                                 <option value="2000000">2 000 000€</option>
  109.                             </select>
  110.                         {% else %}
  111.                             <select class="w-100" name="max_price">
  112.                                 <option value="">Budget Max.</option>
  113.                                 <option value="600">300€</option>
  114.                                 <option value="400">400€</option>
  115.                                 <option value="500">500€</option>
  116.                                 <option value="600">600€</option>
  117.                                 <option value="700">700€</option>
  118.                                 <option value="800">800€</option>
  119.                                 <option value="900">900€</option>
  120.                                 <option value="1000">1000€</option>
  121.                                 <option value="1500">1 500€</option>
  122.                                 <option value="2000">2 000€</option>
  123.                                 <option value="2500">2 500€</option>
  124.                             </select>
  125.                         {% endif %}
  126.                     </div>
  127.                     <div class="col-md-2">
  128.                         <select class="w-100" name="min_room">
  129.                             <option value="">Chambres(s) min.</option>
  130.                             <option value="1">1</option>
  131.                             <option value="2">2</option>
  132.                             <option value="3">3</option>
  133.                             <option value="4">4</option>
  134.                         </select>
  135.                     </div>
  136.                 </div>
  137.             </form>
  138.         </div>
  139.     </section>
  140.     <section class="result-properties">
  141.         <div class="container">
  142.             <div class="text-center mt-5 mb-5">
  143.                 <h3 class="gold">{{ contentHeader.preTitle|capitalize }}</h3>
  144.                 <h2 class="gold" id="nbAdvertResult"><span class="gold">{{ countAdverts }}</span> {% if countAdverts > 1 %}annonces trouvées{% else %}annonce trouvée{% endif %}</h2>
  145.             </div>
  146.             <div class="position-relative col-md-12">
  147.                 <div id="loader" class="ml-3"></div>
  148.             </div>
  149.             <ul class="pl-0" id="containerAdvertList">
  150.                 {% for advert in adverts %}
  151.                     <li class="col-12 col-md-12 position-relative slide-1 slide-single h-100 p-0 {% if not loop.first %}mt-5{% endif %}">
  152.                         <div class="d-flex h-100 link-slide-1">
  153.                             <div class="col-md-6 img-slide img-slide-1 position-relative">
  154.                                 {% for photo in advert.photos %}
  155.                                     <img src="{{ photo.url }}" alt="{{ advert.info.nature}} • {{ advert.info.surface }}m²" onclick="location.href='{{ path('front_property_single', {'id': advert.info.id, 'type': real_estate.toSlug(advert.info.nature), 'city': real_estate.toSlug(advert.localisation.ville)}) }}';" loading="lazy">
  156.                                 {% endfor %}
  157.                             </div>
  158.                             <div class="col-md-6 bg-red gold p-5 d-flex flex-column justify-content-center position-relative info-slide info-slide-1" onclick="location.href='{{ path('front_property_single', {'id': advert.info.id, 'type': real_estate.toSlug(advert.info.nature), 'city': real_estate.toSlug(advert.localisation.ville)}) }}';">
  159.                                 <div class="title-page bg-blue d-flex gold pl-0 pt-0">
  160.                                     <!--img src="{{ asset('img/icons/chevrons-right.svg') }}" alt="chevrons droite"-->
  161.                                     <span>{{ advert.info.nature}} {% if advert.info.surface %}• {{ advert.info.surface }}m²{% endif %}</span>
  162.                                 </div>
  163.                                 <h1 class="mb-3">{{ advert.localisation.ville }}</h1>
  164.                                 {%  set price = advert.prix.budget|number_format(0, ' ', ' ') %}
  165.                                 <h4>
  166.                                     {% if advert.info.vente_location == 'location' %}
  167.                                         {{ price }}€<sup>/mois</sup>
  168.                                     {% else %}
  169.                                         {{ price }}€
  170.                                     {% endif %}
  171.                                 </h4>
  172.                                 {% if advert.info.disponibilite %}
  173.                                     {% if advert.info.disponibilite == 'immédiate' %}
  174.                                         <p>Disponibilité {{ advert.info.disponibilite }}</p>
  175.                                     {% else %}
  176.                                         <p>Disponible à p. d. {{ advert.info.disponibilite }}</p>
  177.                                     {% endif %}
  178.                                 {% endif %}
  179.                                 {% set parkingOuvert = advert.parking.parking_ouvert ?? 0 %}
  180.                                 {% set parkingsouterrain = advert.parking.parkin_souterrain ?? 0 %}
  181.                                 {% set parkingCollectif = advert.parking.collectif ?? 0 %}
  182.                                 {% set parkings = parkingOuvert + parkingsouterrain + parkingCollectif %}
  183.                                 <div class="description pt-3 pb-5">
  184.                                     {% if advert.info.surface and advert.info.surface > 0 %}
  185.                                         <p>
  186.                                             <img src="{{ asset('img/icons/surface.svg') }}" class="mr-3" loading="lazy">
  187.                                             <span class="gold">{{ advert.info.surface }} m²</span>
  188.                                             <span class="gold">surface d’habitation</span>
  189.                                         </p>
  190.                                     {% endif %}
  191.                                     {% if advert.info.nombre_chambres and advert.info.nombre_chambres > 0 %}
  192.                                         <p>
  193.                                             <img src="{{ asset('img/icons/chambres.svg') }}" class="mr-3" loading="lazy">
  194.                                             <span class="gold">{{ advert.info.nombre_chambres }}</span>
  195.                                             <span class="gold">chambre{% if advert.info.nombre_chambres > 1 %}s{% endif%} à coucher</span>
  196.                                         </p>
  197.                                     {% endif %}
  198.                                     {% if advert.pieces.salles_de_bain and advert.pieces.salles_de_bain > 0 %}
  199.                                         <p>
  200.                                             <img src="{{ asset('img/icons/salles-bain.svg') }}" class="mr-3" loading="lazy">
  201.                                             <span class="gold">{{ advert.pieces.salles_de_bain }}</span>
  202.                                             <span class="gold">salle{% if advert.pieces.salles_de_bain > 1%}s{% endif%} de bain</span>
  203.                                         </p>
  204.                                     {% endif %}
  205.                                     {% if advert.parking.garages and advert.parking.garages > 0 %}
  206.                                         <p>
  207.                                             <img src="{{ asset('img/icons/garage.svg') }}" class="mr-3" loading="lazy">
  208.                                             <span class="gold">{{ advert.parking.garages }}</span>
  209.                                             <span class="gold">garage{% if advert.parking.garages > 1 %}s{% endif %}</span>
  210.                                         </p>
  211.                                     {% endif %}
  212.                                     {% if parkings > 0 %}
  213.                                         <p>
  214.                                             <img src="{{ asset('img/icons/parking.svg') }}" class="mr-3" loading="lazy">
  215.                                             <span class="gold">{{ parkings }}</span>
  216.                                             <span class="gold">parking extérieur</span>
  217.                                         </p>
  218.                                     {% endif %}
  219.                                 </div>
  220.                                 <a href="{{ path('front_property_single', {'id': advert.info.id, 'type': real_estate.toSlug(advert.info.nature), 'city': real_estate.toSlug(advert.localisation.ville)}) }}" class="btn-gold bg-gold gold">Plus</a>
  221.                                 <!--img src="{{ asset('img/icons/chevrons-left.svg') }}" class="chevrons-left position-absolute"-->
  222.                             </div>
  223.                         </div>
  224.                     </li>
  225.                 {% endfor %}
  226.             </ul>
  227.         </div>
  228.     </section>
  229. {% endblock %}
  230. {% block javascript %}
  231.     <script>
  232.         $(document).ready(function(){
  233.             $('.img-slide').slick({
  234.                 'prevArrow': '<button class="slick-prev slick-arrow" aria-label="Previous" type="button" style=""><i class="fas fa-arrow-left fa-2x"></i></button>',
  235.                 'nextArrow': '<button class="slick-next slick-arrow" aria-label="Next" type="button" style=""><i class="fas fa-arrow-right fa-2x"></i></button>',
  236.             });
  237.         });
  238.     </script>
  239. {% endblock %}