liste.html.twig 4.6 KB

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