voirfilm.html.twig 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. {% extends "videotheque/base.html.twig" %}
  2. {% block title %}{{ parent() }} - Fiche film - {{ film.titre }}{% endblock %}
  3. {% block titre %}
  4. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  5. {% if film.usersWantToView.contains(app.user) %}
  6. {% set follow_icone = "fa fa-bookmark" %}
  7. {% set follow_texte = "Supprimer ce film de votre liste à voir" %}
  8. {% else %}
  9. {% set follow_icone = "fa fa-bookmark-o text-secondary" %}
  10. {% set follow_texte = "Ajouter ce film à votre liste à voir" %}
  11. {% endif %}
  12. <a href="#"
  13. type="button"
  14. data-fonction="switch"
  15. data-icone-actif="fa fa-bookmark"
  16. data-icone-inactif="fa fa-bookmark-o text-secondary"
  17. data-path="{{ path('maliste_modifier_a_voir') }}"
  18. data-bs-toggle="tooltip"
  19. title="{{ follow_texte }}"
  20. data-content="{{ film.id }}">
  21. <i class="{{ follow_icone }}"></i></a>
  22. {% if film.usersWhoSeen.contains(app.user) %}
  23. {% set vu_icone = '<i class="fa fa-eye text-success"></i>' %}
  24. {% else %}
  25. {% set vu_icone = '<i class="fa fa-eye-slash text-secondary"></i>' %}
  26. {% endif %}
  27. <a href="#" type="button"
  28. data-fonction="switch"
  29. data-path="{{ path('maliste_modifier_vus') }}"
  30. data-content="{{ film.id }}"
  31. data-icone-actif = "fa fa-eye text-success"
  32. data-icone-inactif = "fa fa-eye-slash text-secondary">
  33. {{ vu_icone | raw }}</a>
  34. {% endif %}
  35. {{ film.titre }}
  36. {% if film.note > 0 %}
  37. <p>
  38. <input class="rating"
  39. data-disabled="true"
  40. data-show-clear="false"
  41. data-show-caption="false"
  42. data-theme="krajee-fa"
  43. min=0
  44. max=5
  45. style="display:none;"
  46. data-step=0.5
  47. data-size="xs"
  48. value="{{ film.note }}">
  49. </p>
  50. {% endif %}
  51. {% endblock %}
  52. {% block body %}
  53. {% if estEnSalle(film.dateSortie) %}
  54. <div class="text-center alert alert-success" role="alert">
  55. <i class="fa fa-film"></i> EN SALLE
  56. </div>
  57. {% endif %}
  58. {% if bientotEnSalle(film.dateSortie) %}
  59. <div class="text-center alert alert-info" role="alert">
  60. <i class="fa fa-clock-o"></i> BIENTOT EN SALLE
  61. </div>
  62. {% endif %}
  63. <div class="row">
  64. <div class="col">
  65. <div class="card shadow mb-4">
  66. <div class="card-header">
  67. <div class="d-flex">
  68. <h5 class="">Fiche technique</h5>
  69. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  70. <div class="ms-auto">
  71. <a data-bs-toggle="tooltip" title="Modifier la fiche du film" href="{{ path('videotheque_modifier', {'id': film.id}) }}"><i class="fa fa-edit fa-lg"></i></a>
  72. {% if is_granted('ROLE_ADMIN') %}<a href="{{ path('videotheque_supprimer', {'id': film.id}) }}"><i class="fa fa-trash fa-lg", style="color:Tomato;"></i></a>{% endif %}
  73. </div>
  74. {% endif %}
  75. </div>
  76. </div>
  77. <div class="card-body">
  78. <dl class="row">
  79. {% if film.annee %}
  80. <dt class="col-4">Année</dt>
  81. <dd class="col-8">{{ film.annee | date('Y') }}</dd>
  82. {% endif %}
  83. <dt class="col-4">Réalisateur(s)</dt>
  84. <dd class="col-8">
  85. {% for realisateur in film.realisateurs %}
  86. <a href="{{ path('videotheque_listeparreal', {'id': realisateur.id}) }}"><span class="badge bg-info text-dark">{{ realisateur.nomComplet }}</span></a>
  87. {% endfor %}
  88. </dd>
  89. <dt class="col-4">Genre</dt>
  90. <dd class="col-8">
  91. {% for genre in film.genres %}
  92. <a href="{{ path('videotheque_listepargenre', {'id': genre.id}) }}"><span class="badge bg-info text-dark">{{ genre.name }}</span></a>
  93. {% endfor %}
  94. </dd>
  95. {% if film.lien is not null %}
  96. <dt class="col-4">Lien</dt>
  97. <dd class="col-8"><a href="{{ film.lien }}"><i class="fa fa-external-link"></i></a></dd>
  98. {% endif %}
  99. {% if film.dateSortie %}
  100. <dt class="col-4">Sortie</dt>
  101. <dd class="col-8">
  102. {{ film.dateSortie | date('d/m/y')}}
  103. </dd>
  104. {% endif %}
  105. </dl>
  106. </div>
  107. <div class="card-footer">
  108. <dl class="row">
  109. <dt class="col-4">Suivi par</dt>
  110. <dd class="col-8">
  111. {% for user in film.usersWantToView %}
  112. <span>{{ user.username }}</span>&nbsp;
  113. {% endfor %}
  114. </dd>
  115. <dt class="col-4">Vu par</dt>
  116. <dd class="col-8">
  117. {% for user in film.usersWhoSeen %}
  118. <span>{{ user.username }}</span>&nbsp;
  119. {% endfor %}
  120. </dd>
  121. </dl>
  122. </div>
  123. </div>
  124. <div class="card shadow mb-4">
  125. <div class="card-header">
  126. <h5>Informations complémentaires</h5>
  127. </div>
  128. <div class="card-body">
  129. {% if film.information is not null %}
  130. <p>{{ film.information | nl2br }}</p>
  131. {% else %}
  132. <p>Pas d'information</p>
  133. {% endif %}
  134. </div>
  135. </div>
  136. </div>
  137. <div class="col-lg">
  138. <div class="card shadow mb-4">
  139. <div class="card-header">
  140. <h5>Bande Annonce</h5>
  141. </div>
  142. <div class="card-body text-center">
  143. {% for mediaVideo in film.mediaVideos %}
  144. <div class="ratio ratio-4x3 mb-3">
  145. {{ mediaVideo.video|raw }}
  146. </div>
  147. {% else %}
  148. <p>Pas encore de bande annonce</p>
  149. {% endfor %}
  150. </div>
  151. </div>
  152. </div>
  153. <div class="col">
  154. <div id="coms" class="card shadow mb-4">
  155. <div class="card-header">
  156. <h5>Commentaires</h5>
  157. </div>
  158. <div class="card-body" data-controller="collapser">
  159. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  160. <p>
  161. <a data-bs-toggle="collapse" role="button" href="#collapseCommentaire" aria-expanded="false" aria-controls="collapseCommentaire">Commenter <i data-collapser-target="button" class="fa fa-chevron-right"></i></a>
  162. </p>
  163. <div class="collapse" id="collapseCommentaire" data-collapser-target="collapse">
  164. {{ include('videotheque/form_commentaire.html.twig') }}
  165. </div>
  166. {% endif %}
  167. <div class="list-group">
  168. {% for commentaire in film.commentaires %}
  169. <div class="list-group-item">
  170. <p class="mb-1"><strong>Posté par {{ commentaire.user.username }}</strong></p>
  171. {% if commentaire.note > 0 %}
  172. <input class="rating"
  173. data-disabled="true"
  174. data-show-clear="false"
  175. data-show-caption="false"
  176. data-theme="krajee-fa"
  177. min=0
  178. max=5
  179. data-step=1
  180. data-size="xs"
  181. value="{{ commentaire.note }}">
  182. {% endif %}
  183. {% if commentaire.contenu != "" %}
  184. <p>{{ commentaire.contenu | show_links | raw | sanitize_html | nl2br }}</p>
  185. {% endif %}
  186. </div>
  187. {% endfor %}
  188. </div>
  189. </div>
  190. </div>
  191. </div>
  192. </div>
  193. {% endblock %}
  194. {% block javascripts %}
  195. {% endblock %}