liste.html.twig 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. {# Des filtres ? #}
  18. </div>
  19. {% if note is defined %}
  20. <div class="col-3 text-right">
  21. <p>Filtrer par film au dessus de
  22. <input class="rating"
  23. data-disabled="false"
  24. data-show-clear="true"
  25. data-show-caption="false"
  26. data-theme="krajee-fa"
  27. data-toggle="star-filter"
  28. data-path="#tableFilms"
  29. min=0
  30. max=5
  31. data-step=1
  32. data-size="sm"
  33. value="0">
  34. </p>
  35. </div>
  36. {% endif %}
  37. </div>
  38. </div>
  39. <div class="table-responsive">
  40. <table class="table table-bordered table-hover table-sm">
  41. <thead class="thead-dark">
  42. <tr>
  43. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  44. <th>Voir</th>
  45. <th>Vu</th>
  46. <th>Ajouté par</th>
  47. {% endif %}
  48. <th>Titre du film</th>
  49. <th>Genre</th>
  50. <th>Réalisateur</th>
  51. <th>Note moyenne</th>
  52. <th>Année</th>
  53. </tr>
  54. </thead>
  55. <tbody id="tableFilms">
  56. {% for film in listeFilms %}
  57. <tr data-auteur="{{ film.authered.nomComplet }}">
  58. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  59. <td>
  60. {% if app.user.wantToSee(film) %}
  61. {% set follow_icone = "fa fa-star fa-lg" %}
  62. {% set follow_texte = "Supprimer ce film de votre liste à voir" %}
  63. {% else %}
  64. {% set follow_icone = "fa fa-star-o fa-lg" %}
  65. {% set follow_texte = "Ajouter ce film à votre liste à voir" %}
  66. {% endif %}
  67. <a href="#" data-fonction="switch"
  68. data-icone-actif="fa fa-star fa-lg"
  69. data-icone-inactif="fa fa-star-o fa-lg"
  70. data-path="{{ path('maliste_modifier_a_voir') }}"
  71. data-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="#" data-fonction="switch"
  84. data-path="{{ path('maliste_modifier_vus') }}"
  85. data-content="{{ film.id }}"
  86. data-icone-actif = "fa fa-eye fa-lg text-success"
  87. data-icone-inactif = "fa fa-eye-slash fa-lg text-secondary">
  88. {{ vu_icone | raw }}
  89. </a>
  90. </td>
  91. <td>
  92. {% if film.authered is defined %}
  93. {% if film.authered.activeNow %}
  94. <i class="fa fa-user text-success" data-toggle="tooltip" title="En ligne"></i>
  95. {% else %}
  96. <i class="fa fa-user-o text-secondary" data-toggle="tooltip" title="Hors ligne"></i>
  97. {% endif %}
  98. {{ film.authered.username }}
  99. {% endif %}
  100. </td>
  101. {% endif %}
  102. <td>
  103. <a href="{{ path('videotheque_voirfilm', {'id': film.id}) }}">{{ film.titre }}</a>
  104. {% if film.new %}<span class="badge badge-light">New</span>{% endif %}
  105. {% if film.nbComs %}<span class="badge badge-light" data-toggle="tooltip" data-original-title="{{ film.nbComs }} commentaire(s)">{{ film.nbComs }}</span>{% endif %}
  106. </td>
  107. <td>
  108. {% if film.genres is defined %}
  109. {% for genre in film.genres %}
  110. <a href="{{ path("videotheque_listepargenre", {"id": genre.id}) }}"><span class="badge badge-secondary">{{ genre.name }}</span></a>
  111. {% endfor %}
  112. {% endif %}
  113. </td>
  114. <td>
  115. {% if film.realisateurs is defined %}
  116. {% for realisateur in film.realisateurs %}
  117. <a href="{{ path('videotheque_listeparreal', {"id": realisateur.id}) }}"><span class="badge badge-info">{{ realisateur.nomComplet }}</span></a>
  118. {% endfor %}
  119. {% endif %}
  120. </td>
  121. <td>
  122. {% if film.note > 0 %}
  123. <input class="rating"
  124. data-disabled="true"
  125. data-show-clear="false"
  126. data-show-caption="false"
  127. data-theme="krajee-fa"
  128. min=0
  129. max=5
  130. data-step=0.5
  131. data-size="xs"
  132. value="{{ film.note }}">
  133. {% endif %}
  134. </td>
  135. <td>{{ film.annee | date('Y') }}</td>
  136. </tr>
  137. {% endfor %}
  138. </tbody>
  139. </table>
  140. </div>
  141. {% endblock %}