{% extends 'base.html.twig' %}
{% block title %}Hello IndexController!{% endblock %}
{% block stylesheets %}
<link href="{{ asset('theme/css/t-datepicker.min.css') }}" rel="stylesheet" type="text/css">
<link href="{{ asset('theme/css/themes/t-datepicker-blue.css') }}" rel="stylesheet" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.8.0/dist/leaflet.css" integrity="sha512-hoalWLoI8r4UszCkZ5kL8vayOGVae1oxXe/2A4AO6J9+580uKHDO3JdHb7NzwwzK5xr/Fs0W40kiNHxM9vyTtQ==" crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.8.0/dist/leaflet.js" integrity="sha512-BB3hKbKWOc9Ez/TAwyWxNXeoV9c1v6FIeYiBieIWkpLjauysF18NzgR1MBNBXf8/KABdlkX68nAhlwcDFLGPCQ==" crossorigin=""></script>
<style>
html, body {
height: 100%;
margin: 0;
}
.leaflet-container {
height: 400px;
width: 600px;
max-width: 100%;
max-height: 100%;
}
</style>
{% endblock %}
{% block modal %}
{{ include('logement/modal.html.twig') }}
{% endblock %}
{% block nav %}
<header class="header-nav menu_style_home_one style2 navbar-scrolltofixed stricky main-menu">
{% endblock %}
{% block logo %}
{{ include('include/logopage.html.twig') }}
{% endblock %}
{% block body %}
{{ include('modele/modele.html.twig') }}
{{ include('logement/equipement.html.twig') }}
<div class="col-lg-12">
<div class="property_attachment_area">
<h4 class="mb30">GPE</h4>
{% if annonce.ges != 0 %}
{{ include('widget/dpe.html.twig') }}
{% else %}
<h4 class="mb30">GES non renseigner</h4>
{% endif %}
</div>
</div>
<div class="col-lg-12">
<div class="property_attachment_area">
<h4 class="mb30">Property Attachments</h4>
{% if annonce.ges != 0 %}
{{ include('widget/ges.html.twig') }}
{% else %}
<h4 class="mb30">GES non renseigner</h4>
{% endif %}
</div>
</div>
{{ include('widget/proxi.html.twig') }}
{{ include('widget/map.html.twig') }}
{{ include('logement/form.html.twig') }}
{% if annonce.commentairesLogements | length != 0 %}
{{ include('logement/commantaires.html.twig') }}
{% endif %}
{{ include('logement/propositions.html.twig') }}
</div>
</div>
{{ include('widget/menu.html.twig') }}
</section>
{% endblock %}
{% block jsindex %}
<script src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT"
crossorigin="anonymous"></script>
{% endblock %}
{% block javascripts %}
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
var chaine = '<div class="alert alert-primary alert-dismissible fade show" role="alert">Vous avez rajouter cette annonce à vos favories.<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button></div>';
function onClickBtnLike(event) {
event.preventDefault();
const url = this.href;
const spanCount = this.querySelector('span.js-likes');
const icone = this.querySelector('i');
axios.get(url).then(function (response) {
spanCount.textContent = response.data.likes;
if (response.status === 200){
if (icone.classList.contains('fas')) {
icone.classList.replace('fas','far');
}
else {
icone.classList.replace('far', 'fas');
}
}
}).catch(function (error) {
});
}
document.querySelectorAll('a.js-like').forEach(function (link){
link.addEventListener('click', onClickBtnLike)
})
</script>
{% endblock %}