liste_tableaux.html.twig 4.3 KB

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