voirfilm.html.twig 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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. <dt class="col-4">Année</dt>
  80. <dd class="col-8">{{ film.annee | date('Y') }}</dd>
  81. <dt class="col-4">Réalisateur(s)</dt>
  82. <dd class="col-8">
  83. {% for realisateur in film.realisateurs %}
  84. <a href="{{ path('videotheque_listeparreal', {'id': realisateur.id}) }}"><span class="badge bg-info">{{ realisateur.nomComplet }}</span></a>
  85. {% endfor %}
  86. </dd>
  87. <dt class="col-4">Genre</dt>
  88. <dd class="col-8">
  89. {% for genre in film.genres %}
  90. <a href="{{ path('videotheque_listepargenre', {'id': genre.id}) }}"><span class="badge bg-info">{{ genre.name }}</span></a>
  91. {% endfor %}
  92. </dd>
  93. {% if film.lien is not null %}
  94. <dt class="col-4">Lien</dt>
  95. <dd class="col-8"><a href="{{ film.lien }}"><i class="fa fa-external-link"></i></a></dd>
  96. {% endif %}
  97. {% if film.dateSortie %}
  98. <dt class="col-4">Sortie</dt>
  99. <dd class="col-8">
  100. {{ film.dateSortie | date('d/m/y')}}
  101. </dd>
  102. {% endif %}
  103. </dl>
  104. </div>
  105. <div class="card-footer">
  106. <dl class="row">
  107. <dt class="col-4">Suivi par</dt>
  108. <dd class="col-8">
  109. {% for user in film.usersWantToView %}
  110. <span>{{ user.username }}</span>&nbsp;
  111. {% endfor %}
  112. </dd>
  113. <dt class="col-4">Vu par</dt>
  114. <dd class="col-8">
  115. {% for user in film.usersWhoSeen %}
  116. <span>{{ user.username }}</span>&nbsp;
  117. {% endfor %}
  118. </dd>
  119. </dl>
  120. </div>
  121. </div>
  122. <div class="card shadow mb-4">
  123. <div class="card-header">
  124. <h5>Informations complémentaires</h5>
  125. </div>
  126. <div class="card-body">
  127. {% if film.information is not null %}
  128. <p>{{ film.information | nl2br }}</p>
  129. {% else %}
  130. <p>Pas d'information</p>
  131. {% endif %}
  132. </div>
  133. </div>
  134. </div>
  135. <div class="col-lg">
  136. <div class="card shadow mb-4">
  137. <div class="card-header">
  138. <h5>Bande Annonce</h5>
  139. </div>
  140. <div class="card-body text-center">
  141. {% for mediaVideo in film.mediaVideos %}
  142. <div class="ratio ratio-4x3 mb-3">
  143. {{ mediaVideo.video|raw }}
  144. </div>
  145. {% else %}
  146. <p>Pas encore de bande annonce</p>
  147. {% endfor %}
  148. </div>
  149. </div>
  150. </div>
  151. <div class="col">
  152. <div id="coms" class="card shadow mb-4">
  153. <div class="card-header">
  154. <h5>Commentaires</h5>
  155. </div>
  156. <div class="card-body" data-controller="collapser">
  157. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  158. <p>
  159. <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>
  160. </p>
  161. <div class="collapse" id="collapseCommentaire" data-collapser-target="collapse">
  162. {{ include('videotheque/form_commentaire.html.twig') }}
  163. </div>
  164. {% endif %}
  165. <div class="list-group">
  166. {% for commentaire in film.commentaires %}
  167. <div class="list-group-item">
  168. <p class="mb-1"><strong>Posté par {{ commentaire.user.username }}</strong></p>
  169. {% if commentaire.note > 0 %}
  170. <input class="rating"
  171. data-disabled="true"
  172. data-show-clear="false"
  173. data-show-caption="false"
  174. data-theme="krajee-fa"
  175. min=0
  176. max=5
  177. data-step=1
  178. data-size="xs"
  179. value="{{ commentaire.note }}">
  180. {% endif %}
  181. {% if commentaire.contenu != "" %}
  182. <p>{{ commentaire.contenu | show_links | raw | sanitize_html | nl2br }}</p>
  183. {% endif %}
  184. </div>
  185. {% endfor %}
  186. </div>
  187. </div>
  188. </div>
  189. </div>
  190. </div>
  191. {% endblock %}
  192. {% block javascripts %}
  193. {% endblock %}