voirfilm.html.twig 8.6 KB

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