templates/partials/_bookAdSearchLoop.html.twig line 1

Open in your IDE?
  1.     {% for ad in ads %}
  2.         <div>
  3.             <h3>{{ ad.title }}</h3>
  4.             <p>Auteur : {{ ad.author }}</p>
  5.             <p>Éditeur : {{ ad.publishingHouse }}</p>
  6.             <p>État : {{ ad.bookCondition }}
  7.             <p>Prix : {{ ad.price }}€</p>
  8.             <p>Description : {{ ad.description }}</p>
  9.             {% for url in ad.imagesUrl %}
  10.                 <img src={{url}} width=300>
  11.             {% endfor %}
  12.             <p>Vendu par <strong>{{ ad.user.firstname }} {{ ad.user.lastname }}</strong> ({{ ad.user.email }})</p>
  13.             {# {% if is_granted('ROLE_USER') %}
  14.                 <form method="GET" action="{{ path('app_basket_add', {id: ad.id}) }}">
  15.                     <button type="submit">Ajouter au panier</button>
  16.                   </form>
  17.             {% else %}
  18.                 <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>
  19.             {% endif %} #}
  20.             {# Correction du 06/04 qui ne s'invente pas : #}
  21.             <p>
  22.             {% if not app.user or not app.user.basket.books.contains(ad) and not app.user.bookads.contains(ad) %}
  23.                 <a href="{{ path('app_basket_add', {id: ad.id}) }}">Ajouter au panier</a>
  24.             {% endif %}
  25.             </p>
  26.         </div>
  27.         <hr>
  28.     {% endfor %}