liste.html.twig 5.0 KB

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