{% extends 'layout.twig' %}
{% block title%}
 User
{% endblock %}
{% block body %}
<br/>
  <a class="btn btn-success my-5" href="/ads/create" role="button">Create</a>
	



    <div class="row">


      {% for ad in results %}
        <div class="col-md-4">
          <div class="card bg-light mb-3">
            <div class="card-header text-center">
              <strong>
                {{ ad.prix }}
                {% if (ad.type =="Location") %}
                  &euro;/mois
                {% else %}
                  &euro;
                {% endif %}
              </strong><br>
            </div>
            <a href="/show/{{ad.slug}}/{{ad.id}}">
              <img style="height: 200px; width: 100%; display: block;" src="./../uploads/{{ad.images|first}}" alt="image de l appartement"></a>
            <div class="card-body">
              <h4 class="card-title">
                <a href="/show/{{ad.slug}}/{{ad.id}}" style="color: black;">{{ad.titre}}</a>
              </h4>
              <p class="card-text">
                {{ad.description}}
              </p>
              <a href="/show/{{ad.slug}}/{{ad.id}}" class="btn btn-primary float-right">Savoir plus !</a>
              <a href="/ads/update/{{ad.id}}" class="btn btn-warning">update l'annonce</a>
  
              <a href="/ads/{{ad.id}}" class="btn btn-danger">delete l'annonce</a> 
  
  
            </div>
          </div>
        </div>
      {% endfor %}
    </div>





{% endblock %}