{% for ad in ads %}
<div>
<h3>{{ ad.title }}</h3>
<p>Auteur : {{ ad.author }}</p>
<p>Éditeur : {{ ad.publishingHouse }}</p>
<p>État : {{ ad.bookCondition }}
<p>Prix : {{ ad.price }}€</p>
<p>Description : {{ ad.description }}</p>
{% for url in ad.imagesUrl %}
<img src={{url}} width=300>
{% endfor %}
<p>Vendu par <strong>{{ ad.user.firstname }} {{ ad.user.lastname }}</strong> ({{ ad.user.email }})</p>
{# {% if is_granted('ROLE_USER') %}
<form method="GET" action="{{ path('app_basket_add', {id: ad.id}) }}">
<button type="submit">Ajouter au panier</button>
</form>
{% else %}
<p><a href="{{ path('app_user_registration') }}">Inscrivez-vous</a> ou <a href="{{ path('app_login') }}">connectez-vous</a> pour ajouter ce livre à votre panier.</p>
{% endif %} #}
{# Correction du 06/04 qui ne s'invente pas : #}
<p>
{% if not app.user or not app.user.basket.books.contains(ad) and not app.user.bookads.contains(ad) %}
<a href="{{ path('app_basket_add', {id: ad.id}) }}">Ajouter au panier</a>
{% endif %}
</p>
</div>
<hr>
{% endfor %}