liste_vignettes.html.twig 4.9 KB

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