templates/session/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block body %}
  3.     <div class="d-flex align-items-center justify-content-between mb-2">
  4.         <h1 class="mt-4 mb-3">Sessions</h1>
  5.         <a class="btn btn-primary mt-3" href="{{ path('app_session_new') }}"> Start new session</a>
  6.     </div>
  7.     <table class="table">
  8.         <thead>
  9.         <tr>
  10.             <th>Date</th>
  11.             <th>Recipes</th>
  12.             <th>Actions</th>
  13.         </tr>
  14.         </thead>
  15.         <tbody>
  16.         {% for session in sessions %}
  17.             <tr>
  18.                 <td>{{ session.date.format('d/m/Y') }}</td>
  19.                 <td>
  20.                     {% for recipe in session.recipes %}
  21.                         {{ recipe.name }}
  22.                         {%- if recipe == session.recipes|last -%}
  23.                             {{ '.' }}
  24.                         {%- else -%}
  25.                             {{ ' / ' }}
  26.                         {% endif %}
  27.                     {% endfor %}
  28.                 </td>
  29.                 <td>{{ include('session/_delete_form.html.twig') }}</td>
  30.                 <td> <a class="btn btn-primary" href="{{ path('app_session_show', {'id': session.id}) }}" role="button">Go</a></td>
  31.             </tr>
  32.         {% else %}
  33.             <tr>
  34.                 <td colspan="4">no records found</td>
  35.             </tr>
  36.         {% endfor %}
  37.         </tbody>
  38.     </table>
  39. {% endblock %}