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