liste.html.twig 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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-fluid">
  10. <div class="row">
  11. <div class="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="col-6">
  17. <input type="text" id="filtre" placeholder="Filtre" data-target="#tableFilms">
  18. <div id="placeHolder"></div>
  19. </div>
  20. {% if note is defined %}
  21. <div class="col-3 text-right">
  22. <p>Filtrer par film au dessus de
  23. <input class="rating"
  24. data-disabled="false"
  25. data-show-clear="true"
  26. data-show-caption="false"
  27. data-theme="krajee-fa"
  28. data-toggle="star-filter"
  29. data-path="{{ path('videotheque_liste') }}"
  30. min=0
  31. max=5
  32. data-step=1
  33. data-size="sm"
  34. value="{{ note }}">
  35. </p>
  36. </div>
  37. {% endif %}
  38. </div>
  39. </div>
  40. <div class="table-responsive">
  41. <table class="table table-bordered table-hover table-sm">
  42. <thead class="thead-dark">
  43. <tr>
  44. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  45. <th>Voir</th>
  46. <th>Vu</th>
  47. <th>Ajouté par</th>
  48. {% endif %}
  49. <th>Titre du film</th>
  50. <th>Genre</th>
  51. <th>Réalisateur</th>
  52. <th>Note moyenne</th>
  53. <th>Année</th>
  54. </tr>
  55. </thead>
  56. <tbody id="tableFilms">
  57. {% for film in listeFilms %}
  58. <tr data-auteur="{{ film.authered.nomComplet }}">
  59. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  60. <td>
  61. {% if app.user.wantToSee(film) %}
  62. {% set follow_icone = "fa fa-star fa-lg" %}
  63. {% set follow_texte = "Supprimer ce film de votre liste à voir" %}
  64. {% else %}
  65. {% set follow_icone = "fa fa-star-o fa-lg" %}
  66. {% set follow_texte = "Ajouter ce film à votre liste à voir" %}
  67. {% endif %}
  68. <a href="#" data-fonction="switch"
  69. data-icone-actif="fa fa-star fa-lg"
  70. data-icone-inactif="fa fa-star-o fa-lg"
  71. data-path="{{ path('maliste_modifier_a_voir') }}"
  72. data-toggle="tooltip"
  73. title="{{ follow_texte }}"
  74. data-content="{{ film.id }}">
  75. <i class="{{ follow_icone }}"></i>
  76. </a>
  77. </td>
  78. <td>
  79. {% if app.user.haveSeen(film) %}
  80. {% set vu_icone = '<i class="fa fa-eye fa-lg text-success"></i>' %}
  81. {% else %}
  82. {% set vu_icone = '<i class="fa fa-eye-slash fa-lg text-secondary"></i>' %}
  83. {% endif %}
  84. <a href="#" 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-toggle="tooltip" title="En ligne"></i>
  96. {% else %}
  97. <i class="fa fa-user-o text-secondary" data-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}) }}">{{ film.titre }}</a>
  105. {% if film.new %}<span class="badge badge-light">New</span>{% endif %}
  106. {% if film.nbComs %}<span class="badge badge-light" data-toggle="tooltip" data-original-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 badge-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 badge-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. min=0
  130. max=5
  131. data-step=0.5
  132. data-size="xs"
  133. value="{{ film.note }}">
  134. {% endif %}
  135. </td>
  136. <td>{{ film.annee | date('Y') }}</td>
  137. </tr>
  138. {% endfor %}
  139. </tbody>
  140. </table>
  141. </div>
  142. {% endblock %}