liste_tableaux.html.twig 4.4 KB

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