voirfilm.html.twig 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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>
  105. <div class="col-sm-5">
  106. <div class="card border-info">
  107. <div class="card-header">
  108. <h5>Bande Annonce</h5>
  109. </div>
  110. <div class="card-body">
  111. {% if film.mediaVideo.video is defined %}
  112. <div class="embed-responsive embed-responsive-4by3">
  113. {{ film.mediaVideo.video|raw }}
  114. </div>
  115. {% else %}
  116. <p>Pas encore de bande annonce</p>
  117. {% endif %}
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. <div class="col-sm-4">
  124. <div class="card border-info">
  125. <div class="card-header">
  126. <h5>Commentaires</h5>
  127. </div>
  128. <div class="card-body">
  129. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  130. <p>
  131. <a data-toggle="collapse" role="button" href="#collapseCommentaire" aria-expanded="false" aria-controls="collapseCommentaire">Commenter <i class="fa fa-chevron-down"></i></a>
  132. </p>
  133. <div class="collapse" id="collapseCommentaire">
  134. {{ include('videotheque/form_commentaire.html.twig') }}
  135. </div>
  136. {% endif %}
  137. <div class="list-group">
  138. {% for commentaire in commentaires %}
  139. <div class="list-group-item">
  140. {#{% if commentaire.user == app.user %}
  141. <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>
  142. {% endif %}#}
  143. <p class="mb-1"><strong>Posté par {{ commentaire.user.username }}</strong></p>
  144. {% if commentaire.note > 0 %}
  145. <input class="rating"
  146. data-disabled="true"
  147. data-show-clear="false"
  148. data-show-caption="false"
  149. data-theme="krajee-fa"
  150. min=0
  151. max=5
  152. data-step=1
  153. data-size="xs"
  154. value="{{ commentaire.note }}">
  155. {% endif %}
  156. {% if commentaire.contenu != "" %}
  157. <p class="mb-1">{{ commentaire.contenu }}</p>
  158. {% endif %}
  159. </div>
  160. {% endfor %}
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. {% endblock %}
  167. {% block javascripts %}
  168. {% endblock %}