templates/details/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}{{ details.name }}!{% endblock %}
  3. {% block description %}{{ details.description|striptags }}{% endblock %}
  4. {% block picture %}/assets/src/{{ details.photo }}{% endblock %}
  5. {% block body %}
  6.     <section>
  7.         <div class="container bg-center">
  8.             <nav aria-label="breadcrumb">
  9.                 <ol class="breadcrumb">
  10.                     <li class="breadcrumb-item"><a href="{{ path('accueil') }}">Accueil</a></li>
  11.                     <li class="breadcrumb-item"><a
  12.                                 href="{{ path('categories', {id:details.catprod.souscat.id}) }}">{{ details.catprod.souscat.name }}</a>
  13.                     </li>
  14.                     <li class="breadcrumb-item"><a
  15.                                 href="{{ path('produits_listes', {id:details.catprod.id}) }}">{{ details.catprod.name }}</a>
  16.                     </li>
  17.                     <li class="breadcrumb-item active" aria-current="page">{{ details.name }}</li>
  18.                 </ol>
  19.             </nav>
  20.             <div class="row p-4">
  21.                 <h2>{{ details.name }}</h2>
  22.             </div>
  23.             <div class="row pt-2 pb-2">
  24.                 <div class="col-sm-3">
  25.                     <img alt="{{ details.name }}" src="/assets/src/{{ details.photo }}" class="img-fluid">
  26.                 </div>
  27.                 <div class="col-sm-9">
  28.                     <p>{{ details.description |raw }}</p>
  29.                     <p><strong>Prix : </strong><span class="text-success">{{ details.price }} €</span></p>
  30.                     <form action="{{ path("paniers_add") }}" method="post">
  31.                         <input type="hidden" name="produit" value="{{ details.id }}">
  32.                         <input type="hidden" name="name" value="{{ details.name }}">
  33.                         <input type="hidden" name="photo" value="{{ details.photo }}">
  34.                         {#                        {{ dump(app.session.get('panier')[details.id]["qte"]) }} #}
  35.                         {% if details.status == 1 %}
  36.                         <div class="form-row">
  37.                             <div class="col-2">
  38.                                 <input type="number" class="form-control" name="qte" id="qte" min="0" max="{{ details.stock }}" value="{% if details.id in app.session.get('panier')|keys %}{{ app.session.get('panier')[details.id]['qte'] }}{% else %}1{% endif %}">
  39.                             </div>
  40.                             <div class="col">
  41.                                 <button type="submit" class="btn btn-success">Ajouter au panier</button>
  42.                             </div>
  43.                         </div>
  44.                         {% else %}
  45.                             <div class="alert alert-warning" role="alert">
  46.                                 Produit indisponible
  47.                             </div>
  48.                         {% endif %}
  49.                     </form>
  50.                 </div>
  51.             </div>
  52.         </div>
  53.     </section>
  54. {% endblock %}