voirfilm.html.twig 8.8 KB

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