liste_tableaux.html.twig 5.0 KB

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