liste_vignettes.html.twig 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. <tr>
  64. <th style="width: 9em;">Année</th>
  65. <td>{{ film.annee | date('Y') }}</td>
  66. <tr>
  67. <tr>
  68. <th>Réalisateur(s)</th>
  69. <td>
  70. {% for realisateur in film.realisateurs %}
  71. <a href="{{ path('videotheque_listeparreal', {'id': realisateur.id}) }}"><span class="badge bg-info rounded-pill text-dark">{{ realisateur.nomComplet }}</span></a>
  72. {% endfor %}
  73. </td>
  74. </tr>
  75. <tr>
  76. <th>Genre</th>
  77. <td>
  78. {% for genre in film.genres %}
  79. <a href="{{ path('videotheque_listepargenre', {'id': genre.id}) }}"><span class="badge bg-success rounded-pill">{{ genre.name }}</span></a>
  80. {% endfor %}
  81. </td>
  82. </tr>
  83. {% if film.information %}
  84. <tr>
  85. <th>Informations</th>
  86. <td>{{ film.information | nl2br }}</td>
  87. </tr>
  88. {% endif %}
  89. {% if film.dateSortie %}
  90. <tr>
  91. <th>Date de sortie</th>
  92. <td>{{ film.dateSortie | date('d/m/y')}}</td>
  93. </tr>
  94. {% endif %}
  95. </tbody>
  96. </table>
  97. </div>
  98. <div class="card-footer d-flex justify-content-between">
  99. <div class="d-flex">
  100. <div class="me-3">
  101. <input class="rating"
  102. data-theme="krajee-fa"
  103. data-language="fr"
  104. data-display-only="true"
  105. data-show-caption="false"
  106. style="display:none;"
  107. min=0
  108. max=5
  109. data-step=0.5
  110. data-size="xs"
  111. value="{{ film.note }}">
  112. </div>
  113. <div class="me-3">
  114. {% if film.nbComs %}
  115. <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>
  116. {% endif %}
  117. </div>
  118. <div class="">
  119. {% if film.new %}<span class="badge text-bg-secondary">New</span>{% endif %}
  120. {% if estEnSalle(film.dateSortie) %}<span class="badge text-bg-success">En salle</span>{% endif %}
  121. {% if bientotEnSalle(film.dateSortie) %}<span class="badge text-bg-info">Bientot</span>{% endif %}
  122. </div>
  123. </div>
  124. <div class="">
  125. {% if film.authered is defined %}
  126. Ajouté par
  127. {{ film.authered.username }}
  128. {% if film.authered.activeNow %}
  129. <i class="fa fa-user text-success" data-bs-toggle="tooltip" title="En ligne"></i>
  130. {% else %}
  131. <i class="fa fa-user-o text-secondary" data-bs-toggle="tooltip" title="Hors ligne"></i>
  132. {% endif %}
  133. {% endif %}
  134. </div>
  135. </div>
  136. </article>
  137. {% endfor %}
  138. </section>
  139. {% endblock %}