{% extends 'base.html.twig' %}
{% block title %}{{ settings[0].siteName }} : Nos biens{% endblock %}
{% block body %}
{# Recherche #}
<div class="container-fluid shadow">
<div class="container pt-2 pb-4">
<div class="row bg-white mt-4 d-flex justify-content-center">
<div class="col-lg-10 col-sm-12 text-center">
{{ form_start(form) }}
<div class="row border shadow">
<div class="col-lg-2 col-sm-12 small text-muted pt-2">
{{ form_row(form.bienType) }}
</div>
<div class="col-lg-3 col-sm-12 small text-muted pt-2">
{{ form_row(form.ville) }}
</div>
<div class="col-lg-2 col-sm-12 small text-muted pt-2">
{{ form_row(form.maxPrice) }}
</div>
<div class="col-lg-2 col-sm-12 small text-muted pt-2">
{{ form_row(form.minSurface) }}
</div>
<div class="col-lg-2 col-sm-12 small text-muted pt-2">
{{ form_row(form.nbPieces) }}
</div>
<div class="col-lg-1 col-sm-12 color-bg d-flex align-items-center justify-content-center">
<button class="btn" type="submit">
<svg style="fill: #fff;" width="45" height="45" id="Calque_1" data-name="Calque 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 283.46 283.46">
<path d="M179.33,24.31c29.29,4.31,51.88,18.92,67.26,44.33,10.63,17.57,15.14,36.86,12.41,57.12-5.46,40.6-28.12,67.39-67.32,79.3-19.08,5.8-38.34,4.53-56.95-2.71-6.32-2.46-12.18-6.11-18.25-9.22-.6-.31-1.18-.65-1.96-1.08-1.05,5.25-4.33,8.85-7.85,12.37-15.53,15.49-31.05,30.98-46.46,46.58-4.18,4.23-8.56,7.91-14.58,9.06h-5.07c-5.23-1.18-10.05-3.28-13.02-7.94-1.77-2.79-2.73-6.09-4.05-9.17,0-1.69,0-3.39,0-5.08,1.18-6.11,4.95-10.51,9.22-14.75,15.72-15.6,31.34-31.31,46.95-47.02,3.3-3.33,6.8-6.23,11.66-7.21-2.08-3.67-4.21-7.12-6.06-10.71-8.91-17.35-12.04-35.74-9.29-55.04,3.82-26.8,17-47.99,39.08-63.46,13.61-9.54,28.89-14.76,45.51-15.93,.6-.04,1.19-.23,1.79-.35,3.23,0,6.46,0,9.69,0,2.43,.3,4.87,.55,7.29,.9Zm56.88,91.63c-.04-38.19-30.9-69.07-68.95-69.01-38.08,.06-69.03,31.07-68.95,69.09,.08,38.08,31.12,69.14,69.02,69.08,38.06-.07,68.91-31.05,68.87-69.15Z"/>
</svg>
</button>
</div>
</div>
{{ form_end(form) }}
</div>
</div>
</div>
</div>
{# Biens #}
<div class="container pt-5 pb-4">
<div class="row row-cols-1 row-cols-md-3 g-4">
{% for bien in biens %}
{% if bien.photo1 != null %}
{% set p1 = 1 %}
{% else %}
{% set p1 = 0 %}
{% endif %}
{% if bien.photo2 != null %}
{% set p2 = 1 %}
{% else %}
{% set p2 = 0 %}
{% endif %}
{% if bien.photo3 != null %}
{% set p3 = 1 %}
{% else %}
{% set p3 = 0 %}
{% endif %}
{% if bien.photo4 != null %}
{% set p4 = 1 %}
{% else %}
{% set p4 = 0 %}
{% endif %}
{% if bien.photo5 != null %}
{% set p5 = 1 %}
{% else %}
{% set p5 = 0 %}
{% endif %}
{% if bien.photo6 != null %}
{% set p6 = 1 %}
{% else %}
{% set p6 = 0 %}
{% endif %}
{% if bien.photo7 != null %}
{% set p7 = 1 %}
{% else %}
{% set p7 = 0 %}
{% endif %}
{% if bien.photo8 != null %}
{% set p8 = 1 %}
{% else %}
{% set p8 = 0 %}
{% endif %}
{% if bien.photo9 != null %}
{% set p9 = 1 %}
{% else %}
{% set p9 = 0 %}
{% endif %}
{% set nbImages = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p7 + p8 + p9 %}
<div class="col biens">
<div class="card h-100 position-relative">
<a href="{{ path('app_biens_show', {'id': bien.id}) }}" class="text-decoration-none">
{# <span class="button-bien position-absolute">VENDU</span> #}
{% if bien.photo1 != null %}
<img src="{{ bien.photo1 }}" class="card-img-top img-fluid" alt="Bien 1">
{% else %}
<img src="{{ asset('assets/img/maison.jpg')}}" class="card-img-top img-fluid bg-secondary" alt="Bien 1" style="height: 313px; width: 100%; object-fit: cover;">
{% endif %}
<span class="button-bien-photos position-absolute">
<svg class="text-white" width="32" height="32" viewBox="0 0 24 24"><circle cx="12" cy="12" r="3.2" fill="currentColor"/><path fill="currentColor" d="M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5s5 2.24 5 5s-2.24 5-5 5z"/></svg>
{{ nbImages }}
</span>
<div class="card-body">
<h4 class="card-title color fw-bold">{{ bien.prix|format_currency('EUR') }}</h4>
<p class="card-text text-dark">
{{ bien.libelle }}
<br>
{{ bien.ville }} {{ bien.codePostal }}
</p>
</div>
</a>
</div>
</div>
{% endfor %}
</div>
<div class="row">
<div class="col navigation mt-4 d-flex justify-content-center">
{{ knp_pagination_render(biens) }}
</div>
</div>
</div>
{% endblock %}