voirfilm.html.twig 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. {% extends "videotheque/base.html.twig" %}
  2. {% block title %}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. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  73. <a href="{{ path('videotheque_listeparreal', {'id': realisateur.id}) }}">
  74. {% endif %}
  75. <span class="badge badge-info">{{ realisateur.nomComplet }}</span>
  76. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  77. </a>
  78. {% endif %}
  79. {% endfor %}
  80. </dd>
  81. <dt class="col-4">Genre</dt>
  82. <dd class="col-8">
  83. {% for genre in film.genres %}
  84. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  85. <a href="{{ path('videotheque_listepargenre', {'id': genre.id}) }}">
  86. {% endif %}
  87. <span class="badge badge-info">{{ genre.name }}</span>
  88. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  89. </a>
  90. {% endif %}
  91. {% endfor %}
  92. </dd>
  93. {% if film.lien is not null %}
  94. <dt class="col-4">Lien</dt>
  95. <dd class="col-8"><a href="{{ film.lien }}"><i class="fa fa-external-link"></i></a></dd>
  96. {% endif %}
  97. </dl>
  98. </div>
  99. <div class="card-footer">
  100. <dl class="row">
  101. <dt class="col-4">Suivi par</dt>
  102. <dd class="col-8">
  103. {% for user in film.usersWantToView %}
  104. <span>{{ user.username }}</span>&nbsp;
  105. {% endfor %}
  106. </dd>
  107. <dt class="col-4">Vu par</dt>
  108. <dd class="col-8">
  109. {% for user in film.usersWhoSeen %}
  110. <span>{{ user.username }}</span>&nbsp;
  111. {% endfor %}
  112. </dd>
  113. </dl>
  114. </div>
  115. </div>
  116. </div>
  117. <div class="col-sm-5">
  118. <div class="card border-info">
  119. <div class="card-header">
  120. <h5>Bande Annonce</h5>
  121. </div>
  122. <div class="card-body">
  123. {% if film.mediaVideo.video is defined %}
  124. <div class="embed-responsive embed-responsive-4by3">
  125. {{ film.mediaVideo.video|raw }}
  126. </div>
  127. {% else %}
  128. <p>Pas encore de bande annonce</p>
  129. {% endif %}
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. <div class="col-sm-4">
  136. <div class="card border-info">
  137. <div class="card-header">
  138. <h5>Commentaires</h5>
  139. </div>
  140. <div class="card-body">
  141. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  142. <p>
  143. <a data-toggle="collapse" role="button" href="#collapseCommentaire" aria-expanded="false" aria-controls="collapseCommentaire">Commenter <i class="fa fa-chevron-down"></i></a>
  144. </p>
  145. <div class="collapse" id="collapseCommentaire">
  146. {{ include('videotheque/form_commentaire.html.twig') }}
  147. </div>
  148. {% endif %}
  149. <div class="list-group">
  150. {% for commentaire in commentaires %}
  151. <div class="list-group-item">
  152. {#{% if commentaire.user == app.user %}
  153. <a type="button" data-toggle="modal" data-target="#supprcommentaire" class="float-lg-right" id="supp_commentaire" href="#"><i class="fa fa-trash" style="color: Tomato"></i></a>
  154. {% endif %}#}
  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 }}</p>
  170. {% endif %}
  171. </div>
  172. {% endfor %}
  173. </div>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. {% endblock %}
  179. {% block javascripts %}
  180. {% endblock %}