templates/pages/playlists.html.twig line 1

Open in your IDE?
  1. {% extends "basefront.html.twig" %}
  2. {% block body %}
  3.     <table class="table table-striped" aria-describedby="Table des playlists">
  4.         <thead>
  5.             <tr>
  6.                 <th class="text-left align-top" scope="col">
  7.                     playlist<br />
  8.                     <a href="{{ path('playlists.sort', {champ:'name', ordre:'ASC'}) }}" class="btn btn-info btn-sm active" role="button" aria-pressed="true"><</a>
  9.                     <a href="{{ path('playlists.sort', {champ:'name', ordre:'DESC'}) }}" class="btn btn-info btn-sm active" role="button" aria-pressed="true">></a>
  10.                     <form class="form-inline mt-1" method="POST" action="{{ path('playlists.findallcontain', {champ:'name'}) }}">
  11.                         <div class="form-group mr-1 mb-2">
  12.                             <input type="text" class="sm" name="recherche" 
  13.                                    value="{% if valeur|default and not table|default %}{{ valeur }}{% endif %}">
  14.                             <input type="hidden" name="_token" value="{{ csrf_token('filtre_name') }}">
  15.                             <button type="submit" class="btn btn-info mb-2 btn-sm">filtrer</button>
  16.                         </div>
  17.                     </form>                    
  18.                 </th>
  19.                 <th class="text-left align-top" scope="col">
  20.                     catégories
  21.                     <form class="form-inline mt-1" method="POST" action="{{ path('playlists.findallcontain', {champ:'id', table:'categories'}) }}">
  22.                         <select class="form-select form-select-sm" name="recherche" id="recherche" onchange="this.form.submit()">
  23.                             <option value=""></option>
  24.                             {% for categorie in categories %}
  25.                                 <option 
  26.                                     {% if valeur|default and valeur==categorie.id %} 
  27.                                         selected
  28.                                     {% endif %} 
  29.                                     value="{{ categorie.id }}">{{ categorie.name }}
  30.                                 </option>
  31.                             {% endfor %}
  32.                         </select>                    
  33.                     </form>            
  34.                 </th>
  35.                 <th class="text-center align-top" scope="col">
  36.                     Nombre de formations
  37.                     <div class="col">
  38.                         <a href="{{ path('playlists.sort', {champ:'nbformations', ordre:'ASC'}) }}"
  39.                            class="btn btn-info btn-sm active" role="button" aria-pressed="true"><</a>
  40.                         <a href="{{ path('playlists.sort', {champ:'nbformations', ordre:'DESC'}) }}"
  41.                            class="btn btn-info btn-sm active" role="button" aria-pressed="true">></a>
  42.                     </div>
  43.                 </th>
  44.                 <th class="text-center align-top" scope="col">
  45.                     &nbsp;
  46.                 </th>
  47.             </tr>
  48.         </thead>
  49.         <tbody>
  50.             <!-- boucle sur les playlists -->
  51.             {% if playlists|length > 0 %}
  52.                 {% for playlist in playlists %}
  53.                     <tr class="align-middle">
  54.                         <td>
  55.                             <h5 class="text-info">
  56.                                 {{ playlist.name }}
  57.                             </h5>
  58.                         </td>
  59.                         <td class="text-left">
  60.                                 {% for categorie in playlist.categoriesplaylist %}
  61.                                     {{ categorie }}
  62.                                 {% endfor %}
  63.                         </td>
  64.                         <td class="text-center">
  65.                             {{ playlist.formations|length }}
  66.                         </td>
  67.                         <td class="text-center">
  68.                             <a href="{{ path('playlists.showone', {id:playlist.id}) }}" class="btn btn-secondary">Voir détail</a>
  69.                         </td>
  70.                     </tr>
  71.                 {% endfor %}
  72.             {% endif %}
  73.         </tbody>
  74.     </table>
  75. {% endblock %}