voirfilm.html.twig 8.5 KB

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