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