voirfilm.html.twig 8.5 KB

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