voirfilm.html.twig 8.8 KB

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