voirfilm.html.twig 8.4 KB

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