liste.html.twig 4.6 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. {% endif %}
  70. </div>
  71. <div class="card-body">
  72. <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>
  73. {% if film.new %}<span class="badge bg-success">New</span>{% endif %}
  74. </h3>
  75. <div class="d-flex">
  76. <div class="me-3">
  77. <input class="rating"
  78. data-theme="krajee-fa"
  79. data-language="fr"
  80. data-display-only="true"
  81. data-show-caption="false"
  82. min=0
  83. max=5
  84. data-step=0.5
  85. data-size="xs"
  86. value="{{ film.note }}">
  87. </div>
  88. <div class="">
  89. {% if film.nbComs %}
  90. <a href="{{ path('videotheque_voirfilm', {'id': film.id}) }}#coms"><span class="badge bg-warning text-dark">{{ film.nbComs }} commentaire{% if film.nbComs > 1 %}s{% endif %}</span></a>
  91. {% endif %}
  92. </div>
  93. </div>
  94. <table class="table">
  95. <tbody>
  96. <tr>
  97. <th style="width: 9em;">Année</th>
  98. <td>{{ film.annee | date('Y') }}</td>
  99. <tr>
  100. <tr>
  101. <th>Réalisateur(s)</th>
  102. <td>
  103. {% for realisateur in film.realisateurs %}
  104. <a href="{{ path('videotheque_listeparreal', {'id': realisateur.id}) }}"><span class="badge bg-info rounded-pill text-dark">{{ realisateur.nomComplet }}</span></a>
  105. {% endfor %}
  106. </td>
  107. </tr>
  108. <tr>
  109. <th>Genre</th>
  110. <td>
  111. {% for genre in film.genres %}
  112. <a href="{{ path('videotheque_listepargenre', {'id': genre.id}) }}"><span class="badge bg-success rounded-pill">{{ genre.name }}</span></a>
  113. {% endfor %}
  114. </td>
  115. </tr>
  116. </tbody>
  117. </table>
  118. </div>
  119. <div class="card-footer text-end">
  120. {% if film.authered is defined %}
  121. Ajouté par
  122. {{ film.authered.username }}
  123. {% if film.authered.activeNow %}
  124. <i class="fa fa-user text-success" data-bs-toggle="tooltip" title="En ligne"></i>
  125. {% else %}
  126. <i class="fa fa-user-o text-secondary" data-bs-toggle="tooltip" title="Hors ligne"></i>
  127. {% endif %}
  128. {% endif %}
  129. </div>
  130. </article>
  131. {% endfor %}
  132. </section>
  133. {% endblock %}