liste_tableaux.html.twig 4.7 KB

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