liste.html.twig 5.1 KB

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