voirfilm.html.twig 7.9 KB

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