liste_tableaux.html.twig 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. {% extends "videotheque/base.html.twig" %}
  2. {% block stylesheets %}
  3. {{ encore_entry_link_tags('vuejs') }}
  4. {% endblock %}
  5. {% block javascripts %}
  6. {{ encore_entry_script_tags('vuejs') }}
  7. {% endblock %}
  8. {% block title %}
  9. {% if titre is defined %}{{ parent() }} - {{ titre }}{% else %}{{ parent() }}{% endif %}
  10. {% endblock %}
  11. {% block titre %}
  12. {% if titre is defined %}{{ titre }}{% else %}{{ parent() }}{% endif %}
  13. {% endblock %}
  14. {% block body %}
  15. <div class="d-flex justify-content-between flex-wrap">
  16. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  17. <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>
  18. {% endif %}
  19. <p>Filtrer par film au dessus de
  20. <input class="rating"
  21. data-disabled="false"
  22. data-show-clear="true"
  23. data-show-caption="false"
  24. data-theme="krajee-fa"
  25. data-toggle="star-filter"
  26. data-path="#tableFilms"
  27. style="display:none;"
  28. min=0
  29. max=5
  30. data-step=1
  31. data-size="sm"
  32. value="0">
  33. </p>
  34. </div>
  35. <div id="vue-app" class="">
  36. <table
  37. class="table table-bordered table-hover table-sm align-middle">
  38. <thead class="">
  39. <tr>
  40. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  41. <th style="width:1em;"></th>
  42. <th style="width:1em;"></th>
  43. <th>Ajouté par</th>
  44. {% endif %}
  45. <th>Titre</th>
  46. <th>Genre</th>
  47. <th>Réalisateur</th>
  48. <th style="width:5em;">Note</th>
  49. <th style="width:5em;">Année</th>
  50. <th style="width:6em;">Sortie</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. <Seen
  59. class="fa-lg"
  60. content="{{ film.id }}"
  61. :initial-state="{{ app.user in film.usersWantToView ? "true" : "false" }}"
  62. path="{{ path('maliste_modifier_a_voir') }}"
  63. state-on="fa fa-bookmark text-primary"
  64. text-on="Supprimer ce film de votre liste à voir"
  65. state-off="fa fa-bookmark-o text-secondary"
  66. text-off="Ajouter ce film à votre liste à voir"
  67. >
  68. </Seen>
  69. </td>
  70. <td>
  71. <Seen
  72. class="fa-lg"
  73. content="{{ film.id }}"
  74. :initial-state="{{ app.user in film.usersWhoSeen ? "true" : "false" }}"
  75. path="{{ path('maliste_modifier_vus') }}"
  76. state-on="fa fa-eye text-success"
  77. text-on="Marquer ce film comme non vu"
  78. state-off="fa fa-eye-slash text-secondary"
  79. text-off="Marquer ce film comme vu"
  80. >
  81. </Seen>
  82. </td>
  83. <td>
  84. {% if film.authered is defined %}
  85. {% if film.authered.activeNow %}
  86. <i class="fa fa-user text-success" data-bs-toggle="tooltip" title="En ligne"></i>
  87. {% else %}
  88. <i class="fa fa-user-o text-secondary" data-bs-toggle="tooltip" title="Hors ligne"></i>
  89. {% endif %}
  90. {{ film.authered.username }}
  91. {% endif %}
  92. </td>
  93. {% endif %}
  94. <td>
  95. <a href="{{ path('videotheque_voirfilm', {'id': film.id}) }}"><span data-bs-toggle="tooltip" data-placement="right" title="{{ film.information }}">{{ film.titre }}</span></a>
  96. {% if film.new %}<span class="badge bg-success">New</span>{% endif %}
  97. {% if film.nbComs %}<span class="badge bg-warning rounded-pill" data-bs-toggle="tooltip" title="{{ film.nbComs }} commentaire(s)">{{ film.nbComs }}</span>{% endif %}
  98. </td>
  99. <td>
  100. {% if film.genres is defined %}
  101. {% for genre in film.genres %}
  102. <a href="{{ path("videotheque_listepargenre", {"id": genre.id}) }}"><span class="badge bg-secondary">{{ genre.name }}</span></a>
  103. {% endfor %}
  104. {% endif %}
  105. </td>
  106. <td>
  107. {% if film.realisateurs is defined %}
  108. {% for realisateur in film.realisateurs %}
  109. <a href="{{ path('videotheque_listeparreal', {"id": realisateur.id}) }}"><span class="badge bg-info">{{ realisateur.nomComplet }}</span></a>
  110. {% endfor %}
  111. {% endif %}
  112. </td>
  113. <td>
  114. {% if film.note > 0 %}
  115. <input class="rating"
  116. data-disabled="true"
  117. data-show-clear="false"
  118. data-show-caption="false"
  119. data-theme="krajee-fa"
  120. style="display:none;"
  121. min=0
  122. max=5
  123. data-step=0.5
  124. data-size="xs"
  125. value="{{ film.note }}">
  126. {% endif %}
  127. </td>
  128. <td>{{ film.annee | date('Y') }}</td>
  129. <td>{% if film.dateSortie %}{{ film.dateSortie | date('d/m/y')}}{% endif %}</td>
  130. </tr>
  131. {% endfor %}
  132. </tbody>
  133. </table>
  134. </div>
  135. {% endblock %}