liste.html.twig 4.5 KB

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