liste_vignettes.html.twig 5.3 KB

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