voirfilm.html.twig 8.7 KB

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