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