liste_vignettes.html.twig 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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. <div class="d-flex justify-content-between">
  10. <div class="">
  11. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  12. <p><a class="btn btn-primary" role="button" href="{{ path('videotheque_ajouter') }}"><i class="fa fa-plus-square fa-lg"></i> Ajouter un film</a></p>
  13. {% endif %}
  14. </div>
  15. <div class="">
  16. <p>Filtrer par film au dessus de
  17. <input class="rating"
  18. data-disabled="false"
  19. data-language="fr"
  20. data-show-clear="true"
  21. data-show-caption="false"
  22. data-theme="krajee-fa"
  23. data-toggle="star-filter"
  24. data-path="#tableFilms"
  25. style="display:none;"
  26. min=0
  27. max=5
  28. data-step=1
  29. data-size="sm"
  30. value="0">
  31. </p>
  32. </div>
  33. </div>
  34. <section id="tableFilms">
  35. {% for film in listeFilms %}
  36. <article class="card border-primary mb-4" data-controller="collapser" data-auteur="{{ film.authered.nomComplet }}">
  37. <div class="card-header d-flex justify-content-between">
  38. <h3 class="card-title"><a class="" href="{{ path('videotheque_voirfilm', {'id': film.id}) }}"><span data-bs-toggle="tooltip" data-placement="right" title="{{ film.information }}">{{ film.titre }}</span></a>
  39. {% if film.new %}<span class="badge bg-success">New</span>{% endif %}
  40. </h3>
  41. <div class="d-flex">
  42. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  43. <div class="me-3">
  44. {% if app.user.haveSeen(film) %}
  45. {% set vu_icone = '<i class="fa fa-eye fa-lg text-success"></i>' %}
  46. {% else %}
  47. {% set vu_icone = '<i class="fa fa-eye-slash fa-lg text-secondary"></i>' %}
  48. {% endif %}
  49. <button type="button"
  50. class="btn"
  51. data-fonction="switch"
  52. data-path="{{ path('maliste_modifier_vus') }}"
  53. data-content="{{ film.id }}"
  54. data-icone-actif = "fa fa-eye fa-lg text-success"
  55. data-icone-inactif = "fa fa-eye-slash fa-lg text-secondary">
  56. {{ vu_icone | raw }}
  57. </button>
  58. </div>
  59. <div class="me-3">
  60. {% if app.user.wantToSee(film) %}
  61. {% set follow_icone = "fa fa-bookmark fa-lg" %}
  62. {% set follow_texte = "Supprimer ce film de votre liste à voir" %}
  63. {% else %}
  64. {% set follow_icone = "fa fa-bookmark-o text-secondary fa-lg" %}
  65. {% set follow_texte = "Ajouter ce film à votre liste à voir" %}
  66. {% endif %}
  67. <button type="button"
  68. class="btn text-primary"
  69. data-fonction="switch"
  70. data-icone-actif="fa fa-bookmark fa-lg"
  71. data-icone-inactif="fa fa-bookmark-o text-secondary fa-lg"
  72. data-path="{{ path('maliste_modifier_a_voir') }}"
  73. data-bs-toggle="tooltip"
  74. title="{{ follow_texte }}"
  75. data-content="{{ film.id }}">
  76. <i class="{{ follow_icone }}"></i>
  77. </button>
  78. </div>
  79. {% endif %}
  80. <div class="">
  81. <button class="btn text-primary" data-bs-toggle="collapse" data-bs-target="#collapse-id-{{ film.id }}"><i data-collapser-target="button" class="fa fa-chevron-circle-right fa-lg"></i></button>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="card-body collapse" id="collapse-id-{{ film.id }}" data-collapser-target="collapse">
  86. <table class="table">
  87. <tbody>
  88. <tr>
  89. <th style="width: 9em;">Année</th>
  90. <td>{{ film.annee | date('Y') }}</td>
  91. <tr>
  92. <tr>
  93. <th>Réalisateur(s)</th>
  94. <td>
  95. {% for realisateur in film.realisateurs %}
  96. <a href="{{ path('videotheque_listeparreal', {'id': realisateur.id}) }}"><span class="badge bg-info rounded-pill text-dark">{{ realisateur.nomComplet }}</span></a>
  97. {% endfor %}
  98. </td>
  99. </tr>
  100. <tr>
  101. <th>Genre</th>
  102. <td>
  103. {% for genre in film.genres %}
  104. <a href="{{ path('videotheque_listepargenre', {'id': genre.id}) }}"><span class="badge bg-success rounded-pill">{{ genre.name }}</span></a>
  105. {% endfor %}
  106. </td>
  107. </tr>
  108. {% if film.information %}
  109. <tr>
  110. <th>Informations</th>
  111. <td>{{ film.information | nl2br }}</td>
  112. </tr>
  113. {% endif %}
  114. {% if film.dateSortie %}
  115. <tr>
  116. <th>Date de sortie</th>
  117. <td>{{ film.dateSortie | date('d/m/y')}}</td>
  118. </tr>
  119. {% endif %}
  120. </tbody>
  121. </table>
  122. </div>
  123. <div class="card-footer d-flex justify-content-between">
  124. <div class="d-flex">
  125. <div class="me-3">
  126. <input class="rating"
  127. data-theme="krajee-fa"
  128. data-language="fr"
  129. data-display-only="true"
  130. data-show-caption="false"
  131. style="display:none;"
  132. min=0
  133. max=5
  134. data-step=0.5
  135. data-size="xs"
  136. value="{{ film.note }}">
  137. </div>
  138. <div class="">
  139. {% if film.nbComs %}
  140. <a href="{{ path('videotheque_voirfilm', {'id': film.id}) }}#coms"><span class="badge bg-warning text-dark">{{ film.nbComs }} commentaire{% if film.nbComs > 1 %}s{% endif %}</span></a>
  141. {% endif %}
  142. </div>
  143. </div>
  144. <div class="">
  145. {% if film.authered is defined %}
  146. Ajouté par
  147. {{ film.authered.username }}
  148. {% if film.authered.activeNow %}
  149. <i class="fa fa-user text-success" data-bs-toggle="tooltip" title="En ligne"></i>
  150. {% else %}
  151. <i class="fa fa-user-o text-secondary" data-bs-toggle="tooltip" title="Hors ligne"></i>
  152. {% endif %}
  153. {% endif %}
  154. </div>
  155. </div>
  156. </article>
  157. {% endfor %}
  158. </section>
  159. {% endblock %}