liste.html.twig 4.7 KB

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