add_tmdb.html.twig 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. {% extends 'videotheque/base.html.twig' %}
  2. {% block title %}
  3. {% if titre is defined %}{{ parent() }} - {{ titre }}{% else %}{{ parent() }}{% endif %}
  4. {% endblock %}
  5. {% block titre %}
  6. {% if titre is defined %}{{ titre }}{% else %}{{ parent() }}{% endif %}
  7. {% endblock %}
  8. {% block body %}
  9. {#{{ form(form) }}#}
  10. <form class="mb-3" action="{{ path('videotheque_ajouter_tmdb') }}">
  11. <div class="input-group">
  12. <input class="form-control" name="query" type="text" placeholder="{{ "search_in_tmdb" | trans}}" aria-label="Recherche" {% if recherche != "" %}value="{{ recherche }}"{% endif %}>
  13. <button class="btn btn-primary" type="submit">{{ "Rechercher" | trans }}</button>
  14. </div>
  15. </form>
  16. <div class="">
  17. {% if nbFilms > 0 %}
  18. <span class="fw-light small">{{ nbFilms }} résultat{{ nbFilms > 1 ? 's' }}</span>
  19. <nav aria-label="...">
  20. <ul class="pagination">
  21. <li class="page-item {{ page == 1 ? 'disabled'}}">
  22. <a class="page-link" href="{{ path('videotheque_ajouter_tmdb', {'query': recherche, 'page': page - 1} ) }}">{{ "Previous" | trans }}</a>
  23. </li>
  24. {% for p in 1..nbPages %}
  25. <li class="page-item {{ page == p ? 'active'}}" {{ page == p ? 'aria-current="page"'}}>
  26. <a class="page-link" href="{{ path('videotheque_ajouter_tmdb', {'query': recherche, 'page': p } ) }}">{{ p }}</a>
  27. </li>
  28. {% endfor %}
  29. <li class="page-item {{ page == nbPages ? 'disabled'}}">
  30. <a class="page-link" href="{{ path('videotheque_ajouter_tmdb', {'query': recherche, 'page': page + 1} ) }}">{{ "Next" | trans }}</a>
  31. </li>
  32. </ul>
  33. </nav>
  34. {% endif %}
  35. </div>
  36. <table class="table table-bordered table-hover table-striped table-sm align-middle">
  37. <thead>
  38. <tr>
  39. <th>&nbsp;</th>
  40. <th>Titre</th>
  41. <th>Date de sortie</th>
  42. <th>Résumé</th>
  43. <th>Genre</th>
  44. <th>Realisateur</th>
  45. </tr>
  46. </thead>
  47. <tbody>
  48. {% if nbFilms == 0 %}
  49. <tr>
  50. <td colspan="6" class="text-center">Pas de résultat</td>
  51. <tr>
  52. {% endif %}
  53. {% for idtmdb, film in films %}
  54. <tr>
  55. <td><a type="button" class="btn btn-primary" href="{{ path('videotheque_ajouter', {'idtmdb': idtmdb }) }}">Créér</a></td>
  56. <td>{{ film.titre }}</td>
  57. <td>{% if film.dateSortie %}{{ film.dateSortie | date ('d/m/Y')}}{% endif %}</td>
  58. <td>{{ film.information }}</td>
  59. <td>{% for genre in film.genres %}<span class="badge bg-info me-1">{{ genre.name }}</span>{% endfor %}</td>
  60. <td>{% for realisateur in film.realisateurs %}<span class="badge bg-info me-1">{{ realisateur.nomComplet }}</span>{% endfor %}</td>
  61. </tr>
  62. {% endfor %}
  63. </tbody>
  64. </table>
  65. {% endblock %}