add_tmdb.html.twig 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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-borderless table-sm align-middle">
  37. <thead>
  38. <tr class="border-bottom">
  39. <th>&nbsp;</th>
  40. <th>Titre</th>
  41. <th>Date de sortie</th>
  42. <th>Genre</th>
  43. <th>Realisateur</th>
  44. </tr>
  45. </thead>
  46. <tbody>
  47. {% if nbFilms == 0 %}
  48. <tr>
  49. <td colspan="5" class="text-center">Pas de résultat</td>
  50. <tr>
  51. {% endif %}
  52. {% for idtmdb, film in films %}
  53. <tr class="{{ film.information ? '' : 'border-bottom' }}">
  54. <td><a type="button" class="btn btn-primary" href="{{ path('videotheque_ajouter', {'idtmdb': idtmdb }) }}">Créér</a></td>
  55. <td>{{ film.titre }}</td>
  56. <td>{% if film.dateSortie %}{{ film.dateSortie | date ('d/m/Y')}}{% endif %}</td>
  57. <td>{% for genre in film.genres %}<span class="badge bg-info me-1">{{ genre.name }}</span>{% endfor %}</td>
  58. <td>{% for realisateur in film.realisateurs %}<span class="badge bg-info me-1">{{ realisateur.nomComplet }}</span>{% endfor %}</td>
  59. </tr>
  60. {% if film.information %}
  61. <tr data-controller="collapser" class="border-bottom">
  62. <td colspan="5">
  63. <div class="d-flex">
  64. <a class="ms-auto" href="#collapseResume-{{ idtmdb }}" role="button" data-bs-target="#collapseResume-{{ idtmdb }}" data-bs-toggle="collapse" aria-expanded="false" aria-controls="collapseResume-{{ idtmdb }}">
  65. Résumé
  66. <i class="fa fa-chevron-right fa-xs" data-collapser-target="button"></i>
  67. </a>
  68. </div>
  69. <div id="collapseResume-{{ idtmdb }}" class="collapse" data-collapser-target="collapse">
  70. {{ film.information }}
  71. </div>
  72. </td>
  73. </tr>
  74. {% endif %}
  75. {% endfor %}
  76. </tbody>
  77. </table>
  78. {% endblock %}