voirfilm.html.twig 8.5 KB

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