templates/pages/formations.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 formations">
  4.         <thead>
  5.             <tr>
  6.                 <th class="text-left align-top" scope="col">
  7.                     formation<br />
  8.                     <a href="{{ path('formations.sort', {champ:'title', ordre:'ASC'}) }}" class="btn btn-info btn-sm active" role="button" aria-pressed="true"><</a>
  9.                     <a href="{{ path('formations.sort', {champ:'title', 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('formations.findallcontain', {champ:'title'}) }}">
  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_title') }}">
  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.                     playlist<br />
  21.                     <a href="{{ path('formations.sort', {table:'playlist', champ:'name', ordre:'ASC'}) }}" class="btn btn-info btn-sm active" role="button" aria-pressed="true"><</a>
  22.                     <a href="{{ path('formations.sort', {table:'playlist', champ:'name', ordre:'DESC'}) }}" class="btn btn-info btn-sm active" role="button" aria-pressed="true">></a>
  23.                     <form class="form-inline mt-1" method="POST" action="{{ path('formations.findallcontain', {champ:'name', table:'playlist'}) }}">
  24.                         <div class="form-group mr-1 mb-2">
  25.                             <input type="text" class="sm" name="recherche" 
  26.                                    value="{% if valeur|default and table|default and table=='playlist' %}{{ valeur }}{% endif %}">
  27.                             <input type="hidden" name="_token" value="{{ csrf_token('filtre_name') }}">
  28.                             <button type="submit" class="btn btn-info mb-2 btn-sm">filtrer</button>
  29.                         </div>
  30.                     </form>                    
  31.                 </th>
  32.                 <th class="text-left align-top" scope="col">
  33.                     catégories
  34.                     <form class="form-inline mt-1" method="POST" action="{{ path('formations.findallcontain', {champ:'id', table:'categories'}) }}">
  35.                         <select class="form-select form-select-sm" name="recherche" id="recherche" onchange="this.form.submit()">
  36.                             <option value=""></option>
  37.                             {% for categorie in categories %}
  38.                                 <option 
  39.                                     {% if valeur|default and valeur==categorie.id %} 
  40.                                         selected
  41.                                     {% endif %} 
  42.                                     value="{{ categorie.id }}">{{ categorie.name }}
  43.                                 </option>
  44.                             {% endfor %}
  45.                         </select>                    
  46.                     </form>            
  47.                 </th>
  48.                 <th class="text-center align-top" scope="col">
  49.                     date<br />
  50.                     <a href="{{ path('formations.sort', {champ:'publishedAt', ordre:'ASC'}) }}" class="btn btn-info btn-sm active" role="button" aria-pressed="true"><</a>
  51.                     <a href="{{ path('formations.sort', {champ:'publishedAt', ordre:'DESC'}) }}" class="btn btn-info btn-sm active" role="button" aria-pressed="true">></a>                    
  52.                 </th>
  53.                 <th class="text-center align-top" scope="col">
  54.                     &nbsp;
  55.                 </th>
  56.             </tr>
  57.         </thead>
  58.         <tbody>
  59.             {% for formation in formations %}
  60.                 <tr class="align-middle">
  61.                     <td>
  62.                         <h5 class="text-info">
  63.                             {{ formation.title }}
  64.                         </h5>
  65.                     </td>
  66.                     <td class="text-left">
  67.                         {{ formation.playlist.name }}                  
  68.                     </td>                    
  69.                     <td class="text-left">
  70.                         {% for categorie in formation.categories %}
  71.                             {{ categorie.name }}<br />
  72.                         {% endfor %}
  73.                     </td>                    
  74.                     <td class="text-center">
  75.                         {{ formation.publishedatstring }}
  76.                     </td>
  77.                     <td class="text-center">
  78.                         {% if formation.miniature %}
  79.                             <a href="{{ path('formations.showone', {id:formation.id}) }}">
  80.                                 <img src="{{ formation.miniature }}" alt="miniature">
  81.                             </a>
  82.                         {% endif %}
  83.                     </td>
  84.                 </tr>
  85.             {% endfor %}
  86.         </tbody>
  87.     </table>
  88. {% endblock %}