liste.html.twig 4.6 KB

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