liste_vignettes.html.twig 5.3 KB

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