{% extends 'base_front.html.twig' %}
{% block meta %}
<title>Bourg | {{ advert.info.nature }} à {{ advert.localisation.ville }}</title>
{% if advert.info.nature is defined and advert.info.surface is defined and advert.localisation.ville is defined %}
<meta name="description" content="{{ advert.info.nature }} de {{ advert.info.surface }} m² à {{ advert.localisation.ville }}">
{% endif %}
{% endblock %}
{% block body %}
<section class="slide-header single">
<div class="row h-100">
<div class="col-md-6 d-flex justify-content-center align-items-center">
<div class="description-single">
<div class="title-page bg-blue d-flex gold pl-0 pt-0 pb-5">
<!--img src="{{ asset('img/icons/chevrons-right.svg') }}" alt="chevrons droite"-->
<span class="ml-3">
{{ advert.localisation.ville }} •
{% if advert.info.disponibilite %}
{% if advert.info.disponibilite == 'immédiate' %}
Disponibilité {{ advert.info.disponibilite }}
{% else %}
Disponible à p. d. {{ advert.info.disponibilite }}
{% endif %}
{% endif %}
<br> Réf. {{ advert.info.reference }}
</span>
</div>
<h1 class="mb-3">{{ advert.info.nature }}</h1>
<div class="description pt-3 pb-3">
{% if advert.info.surface and advert.info.surface > 0 %}
<p>
<img src="{{ asset('img/icons/surface.svg') }}" class="mr-3" loading="lazy">
<span class="gold">{{ advert.info.surface }} m²</span>
<span class="gold">surface d’habitation</span>
</p>
{% endif %}
{% if advert.info.nombre_chambres and advert.info.nombre_chambres > 0 %}
<p>
<img src="{{ asset('img/icons/chambres.svg') }}" class="mr-3" loading="lazy">
<span class="gold">{{ advert.info.nombre_chambres }}</span>
<span class="gold">chambre{% if advert.info.nombre_chambres > 1 %}s{% endif%} à coucher</span>
</p>
{% endif %}
{% if advert.pieces.salles_de_bain and advert.pieces.salles_de_bain > 0 %}
<p>
<img src="{{ asset('img/icons/salles-bain.svg') }}" class="mr-3" loading="lazy">
<span class="gold">{{ advert.pieces.salles_de_bain }}</span>
<span class="gold">salle{% if advert.pieces.salles_de_bain > 1%}s{% endif%} de bain</span>
</p>
{% endif %}
{% if advert.parking.garages and advert.parking.garages > 0 %}
<p>
<img src="{{ asset('img/icons/garage.svg') }}" class="mr-3" loading="lazy">
<span class="gold">{{ advert.parking.garages }}</span>
<span class="gold">garage{% if advert.parking.garages > 1 %}s{% endif %}</span>
</p>
{% endif %}
{% set parkingOuvert = advert.parking.parking_ouvert ?? 0 %}
{% set parkingsouterrain = advert.parking.parkin_souterrain ?? 0 %}
{% set parkingCollectif = advert.parking.collectif ?? 0 %}
{% set parkings = parkingOuvert + parkingsouterrain + parkingCollectif %}
{% if parkings > 0 %}
<p>
<img src="{{ asset('img/icons/parking.svg') }}" class="mr-3" loading="lazy">
<span class="gold">{{ parkings }}</span>
<span class="gold">parking extérieur</span>
</p>
{% endif %}
</div>
<div class="price gold">
{% set price = advert.prix.budget|number_format(0, ' ', ' ') %}
{% if advert.info.vente_location == 'location' %}
{{ price }}€/mois
{% else %}
{{ price }}€
{% endif %}
</div>
</div>
</div>
<div class="col-md-6 slides">
<div class="main-slide">
<div class="img-main-slide position-relative" id="mainImg">
<img src="{{ advert.photos.1.url }}" id="mainImg" class="position-absolute" style="height:100%;object-fit:cover;right:0;width:100%">
<a href="{{ advert.photos.1.url }}" id="photoGallery" class="position-absolute bg-red d-flex justify-content-center align-items-center">
<img src="{{ asset('img/icons/icon-photos.svg') }}" class="img-fluid" style="width:45px;" loading="lazy">
</a>
</div>
</div>
{#
<div class="slides-title d-flex align-items-center justify-content-end col-md-10 p-0 float-right position-relative">
<a href="#" class="position-absolute arrow-slide-single" id="arrowSlideMove" onclick="javascript: return false;">
<img src="{{ asset('img/icons/arrow-right.svg') }}">
</a>
<div class="slide-miniatures d-flex align-self-baseline" id="containerMiniatures">
{% for photo in advert.photos|slice(1) %}
<div class="slide position-relative {% if loop.index >= 4 %}display-none{% endif %} float-left">
<img src="{{ photo.url }}">
</div>
{% endfor %}
</div>
</div>
#}
</div>
</div>
<a href="#targetSeeMore" class="btn-see-more position-absolute d-flex flex-column align-items-center gold text-center">
<span>En savoir plus</span>
<img src="{{ asset('img/icons/arrow-bottom-gold.svg') }}" alt="En savoir plus" class="mb-2">
</a>
</section>
<section class="details-single pb-5" id="targetSeeMore">
<div class="container mt-5 pt-5">
<div class="row justify-content-between align-items-start">
<div class="col-12 col-md-5 doc position-relative">
<!--img src="{{ asset('img/floor_doc.svg') }}" alt="Doc property" class="position-absolute doc-floor"-->
<h6>Extérieur</h6>
<ul class="pl-0">
{% for key, value in advert.exterieur %}
{% if value and value == '1' %}
<li>{{ key|replace({'_': ' '})|capitalize }}</li>
{% endif %}
{% endfor %}
</ul>
<h6>Intérieur</h6>
<ul class="pl-0">
{% for key, value in advert.interieur %}
{% if value and value == '1' %}
<li>{{ key|replace({'_': ' '})|capitalize }}</li>
{% endif %}
{% endfor %}
{% for key, value in advert.pieces %}
{% if value and value == '1' %}
<li>{{ key|replace({'_': ' '})|capitalize }}</li>
{% endif %}
{% endfor %}
</ul>
<h6>Autres</h6>
<ul class="pl-0">
{% for key, value in advert.parking %}
{% if value and value == '1' %}
<li>{{ key|replace({'_': ' '})|capitalize }}</li>
{% endif %}
{% endfor %}
{% for key, value in advert.energie %}
{% if value and value != '0.00' %}
<li>{{ key|replace({'_': ' ', 'lettre': ''})|capitalize }} <strong>{{ value|replace({'_': ' '})|capitalize }}</strong></li>
{% endif %}
{% endfor %}
</ul>
{% if advert.documents is not empty %}
<h6>Documents</h6>
<ul class="pl-0">
{% for doc in advert.documents %}
<li><img src="{{ asset('img/icons/doc.svg') }}" class="mr-2"><a href="{{ doc.url }}" target="_blank" class="gold" download>{{ doc.name_file }}</a></li>
{% endfor %}
</ul>
{% endif %}
<div class="m-auto pt-4 energy-single no-responsive">
<h4>Performance énergétique</h4>
{% if advert.energie.indice_energetique %}
<div class="row col-md-8 p-0 m-0">
<div class="col-sm-2 col-md-2 bg-grey-light p-2 text-vertical info-indice">
<span class="gold">Maison existante</span>
<span class="gold">Nouvelle maison</span>
</div>
<div class="col-sm-10 col-md-10 d-flex flex-column h-100">
{% set arrayLetters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'] %}
{% set widthBar = '5' %}
{% for letter in arrayLetters %}
{% if letter == advert.energie.indice_energetique %}
<div class="col-sm-12 col-md-12 bar energy-a mb-2 pb-0 pt-0 pl-1 pr-1 d-flex justify-content-center align-items-center selected">
<span class="col-md-{{ widthBar }} pr-0 letter-a gold d-flex justify-content-center align-items-center">{{ letter }}</span>
{% if letter == 'A' %}
<span class="cols-m-7 col-md-7 pl-0 info-a gold text-center">Haute efficacité d’énergie</span>
{% endif %}
</div>
{% else %}
<div class="col-sm-{% if not loop.last %}{{ widthBar }}{% else%}12{% endif%} col-md-{% if not loop.last %}{{ widthBar }}{% else%}12{% endif%} bar energy-{{ letter|lower }} {% if not loop.last %}mb-2{% endif %}">{{ letter }}</div>
{% endif %}
{% set widthBar = widthBar + 1 %}
{% endfor %}
</div>
</div>
{% else %}
<p>Performance énergetique non renseignée.</p>
{% endif %}
</div>
</div>
<div class="col-12 col-md-5">
<div class="contact-single p-0 gold">
<div class="title-page bg-blue d-flex align-items-baseline gold pl-0 pt-0 pb-5">
<!--img src="{{ asset('img/icons/chevrons-right.svg') }}" alt="chevrons droite"-->
<div class="pl-3">
<!--<div class="img-contact" style="background: url({% if advert.commerciaux.photo %}{{ advert.commerciaux.photo }}{% else %}{{ asset('img/user-default.png') }}{% endif %})no-repeat center;background-size: cover"></div>-->
<div class="description-contact bg-grey-very-light p-4">
<div class="border-title bg-grey mb-2 mt-0"></div>
<h3 style="font-size: 1.3em;">{{ advert.commerciaux.prenom }} {{ advert.commerciaux.nom|upper }}</h3>
<p class="mb-0">Contactez votre conseiller pour plus d’informations concernant
le bien ou pour organiser une visite</p>
</div>
{% if advert.commerciaux.gsm %}
<div class="col-md-11 bg-red-contact gold pb-0">
<img src="{{ asset('img/icons/icon-mobile-dark.svg') }}" loading="lazy">
<span class="ml-3"><a href="tel:{{ advert.commerciaux.gsm }}" class="gold">{{ advert.commerciaux.gsm }}</a></span>
</div>
{% endif %}
{% if advert.commerciaux.email %}
<div class="col-md-10 bg-brown gold">
<img src="{{ asset('img/icons/icon-envelop-dark.svg') }}">
<span class="ml-3"><a href="mailto:{{ advert.commerciaux.email }}" class="gold">{{ advert.commerciaux.email }}</a></span>
</div>
{% endif %}
</div>
</div>
</div>
<div class="title-page bg-blue d-flex gold pl-0 pt-0 pb-5">
<!--img src="{{ asset('img/icons/chevrons-right.svg') }}" alt="chevrons droite"-->
<span class="ml-3">DESCRIPTION</span>
</div>
{# <h1 class="mb-3">MAISON UNIFAMILIALE ISOLÉE</h1> #}
<div class="description gold">
{{ advert.description.description_fr|raw }}
</div>
{#
<div class="contact-advert gold">
Pour plus de renseignements et informations :<br>
M. Philippe LANDRAIN<br>
Tél: <a href="tel:00352454848451" class="gold">00352 454848 -451</a><br>
E-mail: <a href="mailto:philippe@stugalux.lu" class="gold">philippe@stugalux.lu</a><br>
</div>
#}
</div>
</div>
</div>
</section>
{% endblock %}
{% block javascript %}
{{ parent() }}
<script>
document.getElementById('photoGallery').addEventListener('click', (e) => {
e.preventDefault();
SimpleLightbox.open({
items: [
{% for photo in advert.photos %}
"{{ photo.url }}",
{% endfor %}
]
});
})
</script>
{% endblock %}