liste_tableaux.html.twig 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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 estEnSalle(film.dateSortie) %}<span class="badge text-bg-success">En salle</span>{% endif %}
  79. {% if bientotEnSalle(film.dateSortie) %}<span class="badge text-bg-info">Bientot</span>{% endif %}
  80. {% if film.nbComs %}<span class="badge text-bg-warning rounded-pill" data-bs-toggle="tooltip" title="{{ film.nbComs }} commentaire(s)">{{ film.nbComs }}</span>{% endif %}
  81. </td>
  82. <td>
  83. {% if film.genres is defined %}
  84. {% for genre in film.genres %}
  85. <a href="{{ path("videotheque_listepargenre", {"id": genre.id}) }}"><span class="badge bg-secondary">{{ genre.name }}</span></a>
  86. {% endfor %}
  87. {% endif %}
  88. </td>
  89. <td>
  90. {% if film.realisateurs is defined %}
  91. {% for realisateur in film.realisateurs %}
  92. <a href="{{ path('videotheque_listeparreal', {"id": realisateur.id}) }}"><span class="badge bg-info">{{ realisateur.nomComplet }}</span></a>
  93. {% endfor %}
  94. {% endif %}
  95. </td>
  96. <td>
  97. {% if film.note > 0 %}
  98. <input class="rating"
  99. data-disabled="true"
  100. data-show-clear="false"
  101. data-show-caption="false"
  102. data-theme="krajee-fa"
  103. style="display:none;"
  104. min=0
  105. max=5
  106. data-step=0.5
  107. data-size="xs"
  108. value="{{ film.note }}">
  109. {% endif %}
  110. </td>
  111. <td>{{ film.annee | date('Y') }}</td>
  112. <td>{% if film.dateSortie %}{{ film.dateSortie | date('d/m/y')}}{% endif %}</td>
  113. </tr>
  114. {% endfor %}
  115. </tbody>
  116. </table>
  117. {% endblock %}