liste_tableaux.html.twig 5.0 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-show-clear="true"
  17. data-show-caption="false"
  18. data-theme="krajee-fa"
  19. data-toggle="star-filter"
  20. data-path="#tableFilms"
  21. style="display:none;"
  22. min=0
  23. max=5
  24. data-step=1
  25. data-size="sm"
  26. value="0">
  27. </p>
  28. </div>
  29. <div class="row">
  30. <table
  31. class="table table-bordered table-hover table-sm align-middle"
  32. data-toggle="table"
  33. data-pagination="false"
  34. >
  35. <thead class="">
  36. <tr>
  37. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  38. <th style="width:1em;"></th>
  39. <th style="width:1em;"></th>
  40. <th>Ajouté par</th>
  41. {% endif %}
  42. <th data-sortable="true">Titre</th>
  43. <th data-sortable="true">Genre</th>
  44. <th data-sortable="true">Réalisateur</th>
  45. <th data-sortable="true" style="width:5em;">Note</th>
  46. <th data-sortable="true" style="width:5em;">Année</th>
  47. <th data-sortable="true" style="width:6em;">Sortie</th>
  48. </tr>
  49. </thead>
  50. <tbody id="tableFilms">
  51. {% for film in listeFilms %}
  52. <tr data-auteur="{{ film.authered.nomComplet }}">
  53. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  54. <td>
  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. <a href="#" type="button"
  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. </a>
  72. </td>
  73. <td>
  74. {% if app.user.haveSeen(film) %}
  75. {% set vu_icone = '<i class="fa fa-eye fa-lg text-success"></i>' %}
  76. {% else %}
  77. {% set vu_icone = '<i class="fa fa-eye-slash fa-lg text-secondary"></i>' %}
  78. {% endif %}
  79. <a href="#" type="button"
  80. data-fonction="switch"
  81. data-path="{{ path('maliste_modifier_vus') }}"
  82. data-content="{{ film.id }}"
  83. data-icone-actif = "fa fa-eye fa-lg text-success"
  84. data-icone-inactif = "fa fa-eye-slash fa-lg text-secondary">
  85. {{ vu_icone | raw }}
  86. </a>
  87. </td>
  88. <td>
  89. {% if film.authered is defined %}
  90. {% if film.authered.activeNow %}
  91. <i class="fa fa-user text-success" data-bs-toggle="tooltip" title="En ligne"></i>
  92. {% else %}
  93. <i class="fa fa-user-o text-secondary" data-bs-toggle="tooltip" title="Hors ligne"></i>
  94. {% endif %}
  95. {{ film.authered.username }}
  96. {% endif %}
  97. </td>
  98. {% endif %}
  99. <td>
  100. <a href="{{ path('videotheque_voirfilm', {'id': film.id}) }}"><span data-bs-toggle="tooltip" data-placement="right" title="{{ film.information }}">{{ film.titre }}</span></a>
  101. {% if film.new %}<span class="badge bg-success">New</span>{% endif %}
  102. {% if film.nbComs %}<span class="badge bg-warning rounded-pill" data-bs-toggle="tooltip" title="{{ film.nbComs }} commentaire(s)">{{ film.nbComs }}</span>{% endif %}
  103. </td>
  104. <td>
  105. {% if film.genres is defined %}
  106. {% for genre in film.genres %}
  107. <a href="{{ path("videotheque_listepargenre", {"id": genre.id}) }}"><span class="badge bg-secondary">{{ genre.name }}</span></a>
  108. {% endfor %}
  109. {% endif %}
  110. </td>
  111. <td>
  112. {% if film.realisateurs is defined %}
  113. {% for realisateur in film.realisateurs %}
  114. <a href="{{ path('videotheque_listeparreal', {"id": realisateur.id}) }}"><span class="badge bg-info">{{ realisateur.nomComplet }}</span></a>
  115. {% endfor %}
  116. {% endif %}
  117. </td>
  118. <td>
  119. {% if film.note > 0 %}
  120. <input class="rating"
  121. data-disabled="true"
  122. data-show-clear="false"
  123. data-show-caption="false"
  124. data-theme="krajee-fa"
  125. style="display:none;"
  126. min=0
  127. max=5
  128. data-step=0.5
  129. data-size="xs"
  130. value="{{ film.note }}">
  131. {% endif %}
  132. </td>
  133. <td>{{ film.annee | date('Y') }}</td>
  134. <td>{% if film.dateSortie %}{{ film.dateSortie | date('d/m/y')}}{% endif %}</td>
  135. </tr>
  136. {% endfor %}
  137. </tbody>
  138. </table>
  139. </div>
  140. {% endblock %}