liste_tableaux.html.twig 4.7 KB

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