liste_vignettes.html.twig 5.2 KB

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