liste.html.twig 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. {#
  55. <th>Lien</th>
  56. <th>Actions</th>
  57. #}
  58. </tr>
  59. </thead>
  60. <tbody id="tableFilms">
  61. {% for film in listeFilms %}
  62. <tr data-auteur="{{ film.authered.nomComplet }}">
  63. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  64. <td>
  65. {% if app.user.wantToSee(film) %}
  66. {% set follow_icone = "fa fa-star fa-lg" %}
  67. {% set follow_texte = "Supprimer ce film de votre liste à voir" %}
  68. {% else %}
  69. {% set follow_icone = "fa fa-star-o fa-lg" %}
  70. {% set follow_texte = "Ajouter ce film à votre liste à voir" %}
  71. {% endif %}
  72. <a href="#" data-fonction="switch"
  73. data-icone-actif="fa fa-star fa-lg"
  74. data-icone-inactif="fa fa-star-o fa-lg"
  75. data-path="{{ path('maliste_modifier_a_voir') }}"
  76. data-toggle="tooltip"
  77. title="{{ follow_texte }}"
  78. data-content="{{ film.id }}">
  79. <i class="{{ follow_icone }}"></i>
  80. </a>
  81. </td>
  82. <td>
  83. {% if app.user.haveSeen(film) %}
  84. {% set vu_icone = '<i class="fa fa-eye fa-lg text-success"></i>' %}
  85. {% else %}
  86. {% set vu_icone = '<i class="fa fa-eye-slash fa-lg text-secondary"></i>' %}
  87. {% endif %}
  88. <a href="#" data-fonction="switch"
  89. data-path="{{ path('maliste_modifier_vus') }}"
  90. data-content="{{ film.id }}"
  91. data-icone-actif = "fa fa-eye fa-lg text-success"
  92. data-icone-inactif = "fa fa-eye-slash fa-lg text-secondary">
  93. {{ vu_icone | raw }}
  94. </a>
  95. </td>
  96. <td>
  97. {% if film.authered is defined %}
  98. {% if film.authered.activeNow %}
  99. <i class="fa fa-user text-success" data-toggle="tooltip" title="En ligne"></i>
  100. {% else %}
  101. <i class="fa fa-user-o text-secondary" data-toggle="tooltip" title="Hors ligne"></i>
  102. {% endif %}
  103. {{ film.authered.username }}
  104. {% endif %}
  105. </td>
  106. {% endif %}
  107. <td>
  108. <a href="{{ path('videotheque_voirfilm', {'id': film.id}) }}">{{ film.titre }}</a>
  109. {% if film.new %}<span class="badge badge-light">New</span>{% endif %}
  110. {% if film.nbComs %}<span class="badge badge-light" data-toggle="tooltip" data-original-title="{{ film.nbComs }} commentaire(s)">{{ film.nbComs }}</span>{% endif %}
  111. </td>
  112. <td>
  113. {% if film.genres is defined %}
  114. {% for genre in film.genres %}
  115. <a href="{{ path("videotheque_listepargenre", {"id": genre.id}) }}"><span class="badge badge-secondary">{{ genre.name }}</span></a>
  116. {% endfor %}
  117. {% endif %}
  118. </td>
  119. <td>
  120. {% if film.realisateurs is defined %}
  121. {% for realisateur in film.realisateurs %}
  122. <a href="{{ path('videotheque_listeparreal', {"id": realisateur.id}) }}"><span class="badge badge-info">{{ realisateur.nomComplet }}</span></a>
  123. {% endfor %}
  124. {% endif %}
  125. </td>
  126. <td>
  127. {% if film.note > 0 %}
  128. <input class="rating"
  129. data-disabled="true"
  130. data-show-clear="false"
  131. data-show-caption="false"
  132. data-theme="krajee-fa"
  133. min=0
  134. max=5
  135. data-step=0.5
  136. data-size="xs"
  137. value="{{ film.note }}">
  138. {% endif %}
  139. </td>
  140. <td>{{ film.annee | date('Y') }}</td>
  141. {#
  142. <td>{% if not film.lien == "" %}<a target="_blank" href="{{ film.lien }}"><i class="fa fa-external-link fa-lg"></i></a>{% endif %}</td>
  143. <td>
  144. <a data-toggle="tooltip" title="Modifier la fiche film" href="{{ path('videotheque_modifier', {'id': film.id}) }}"><i class="fa fa-edit fa-lg", style="color:DodgerBlue;"></i></a>
  145. {% if is_granted('ROLE_ADMIN') %}<a href="{{ path('videotheque_supprimer', {'id': film.id}) }}"><i class="fa fa-trash fa-lg", style="color:Tomato;"></i></a>{% endif %}
  146. </td>
  147. #}
  148. </tr>
  149. {% endfor %}
  150. </tbody>
  151. </table>
  152. </div>
  153. {% endblock %}