voirfilm.html.twig 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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. </dl>
  85. </div>
  86. <div class="card-footer">
  87. <dl class="row">
  88. <dt class="col-4">Suivi par</dt>
  89. <dd class="col-8">
  90. {% for user in film.usersWantToView %}
  91. <span>{{ user.username }}</span>&nbsp;
  92. {% endfor %}
  93. </dd>
  94. <dt class="col-4">Vu par</dt>
  95. <dd class="col-8">
  96. {% for user in film.usersWhoSeen %}
  97. <span>{{ user.username }}</span>&nbsp;
  98. {% endfor %}
  99. </dd>
  100. </dl>
  101. </div>
  102. </div>
  103. <div class="card border-info mb-3">
  104. <div class="card-header">
  105. <h5>Informations complémentaires</h5>
  106. </div>
  107. <div class="card-body">
  108. {% if film.information is not null %}
  109. <p>{{ film.information | nl2br }}</p>
  110. {% else %}
  111. <p>Pas d'information</p>
  112. {% endif %}
  113. </div>
  114. </div>
  115. </div>
  116. <div class="col-lg">
  117. <div class="card border-info mb-3">
  118. <div class="card-header">
  119. <h5>Bande Annonce</h5>
  120. </div>
  121. <div class="card-body text-center">
  122. {% if film.mediaVideo.video is defined %}
  123. <div class="embed-responsive embed-responsive-4by3">
  124. {{ film.mediaVideo.video|raw }}
  125. </div>
  126. {% else %}
  127. <p>Pas encore de bande annonce</p>
  128. {% endif %}
  129. </div>
  130. </div>
  131. </div>
  132. <div class="col">
  133. <div id="coms" class="card border-info mb-3">
  134. <div class="card-header">
  135. <h5>Commentaires</h5>
  136. </div>
  137. <div class="card-body">
  138. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  139. <p>
  140. <a data-bs-toggle="collapse" role="button" href="#collapseCommentaire" aria-expanded="false" aria-controls="collapseCommentaire">Commenter <i class="fa fa-chevron-down"></i></a>
  141. </p>
  142. <div class="collapse" id="collapseCommentaire">
  143. {{ include('videotheque/form_commentaire.html.twig') }}
  144. </div>
  145. {% endif %}
  146. <div class="list-group">
  147. {% for commentaire in film.commentaires %}
  148. <div class="list-group-item">
  149. <p class="mb-1"><strong>Posté par {{ commentaire.user.username }}</strong></p>
  150. {% if commentaire.note > 0 %}
  151. <input class="rating"
  152. data-disabled="true"
  153. data-show-clear="false"
  154. data-show-caption="false"
  155. data-theme="krajee-fa"
  156. min=0
  157. max=5
  158. data-step=1
  159. data-size="xs"
  160. value="{{ commentaire.note }}">
  161. {% endif %}
  162. {% if commentaire.contenu != "" %}
  163. <p class="mb-1">{{ commentaire.contenu | nl2br }}</p>
  164. {% endif %}
  165. </div>
  166. {% endfor %}
  167. </div>
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. {% endblock %}
  173. {% block javascripts %}
  174. {% endblock %}