liste.html.twig 4.5 KB

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