voirfilm.html.twig 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. {% extends "@App/videotheque/base.html.twig" %}
  2. {% block title %}Fiche film{% endblock %}
  3. {% block titre %}{% endblock %}
  4. {% block body %}
  5. <div class="row">
  6. <div class="col-8">
  7. <h1>
  8. {% if film.usersWantToView.contains(app.user) %}
  9. <a href="#" class="boutonVoir" data-content="{{ film.id }}"><i class="fa fa-star"></i></a>
  10. {% else %}
  11. <a href="#" class="boutonVoir" data-content="{{ film.id }}"><i class="fa fa-star-o"></i></a>
  12. {% endif %}
  13. {{ film.titre }}
  14. {% if film.usersWhoSeen.contains(app.user) %}
  15. <a href="#" class="boutonVu" data-content="{{ film.id }}"><i class="badge badge-secondary">Pas vu</i><i class="badge badge-success">Vu</i></a>
  16. {#<a href="#" class="boutonVu" data-content="{{ film.id }}"><i class="badge badge-success">Vu</i></a>#}
  17. {% else %}
  18. <a href="#" class="boutonVu" data-content="{{ film.id }}"><i class="badge badge-danger">Pas vu</i><i class="badge badge-secondary">Vu</i></a>
  19. {#<a href="#" class="boutonVu" data-content="{{ film.id }}"><i class="badge badge-secondary">Pas vu</i></a>#}
  20. {% endif %}
  21. </h1>
  22. <div class="row">
  23. <div class="col-7">
  24. <div class="card border-info">
  25. <div class="card-header">
  26. <div class="row">
  27. <h5 class="col-11">Fiche technique</h5>
  28. <div class="col-1">
  29. <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>
  30. </div>
  31. </div>
  32. </div>
  33. <div class="card-body">
  34. <dl class="row">
  35. <dt class="col-4">Réalisateur(s)</dt>
  36. {% for realisateur in film.realisateurs %}
  37. <dd class="col-8"><a href="{{ path('realisateur_modifier', {'id': realisateur.id}) }}"><span class="badge badge-info">{{ realisateur.nomComplet }}</span></a></dd>
  38. {% endfor %}
  39. <dt class="col-4">Année</dt>
  40. <dd class="col-8">{{ film.annee | date('Y') }}</dd>
  41. <dt class="col-4">Genre</dt>
  42. {% for genre in film.genres %}
  43. <dd class="col-8"><a href="{{ path('genre_modifier', {'id': genre.id}) }}"><span class="badge badge-info">{{ genre.name }}</span></a></dd>
  44. {% endfor %}
  45. {% if film.lien is not null %}
  46. <dt class="col-4">Lien</dt>
  47. <dd class="col-8"><a href="{{ film.lien }}"><i class="fa fa-external-link"></i></a></dd>
  48. {% endif %}
  49. </dl>
  50. </div>
  51. <div class="card-footer">
  52. <dl class="row">
  53. <dt class="col-4">Suivi par</dt>
  54. <dd class="col-8">
  55. {% for user in film.usersWantToView %}
  56. <span>{{ user.username }}</span>&nbsp;
  57. {% endfor %}
  58. </dd>
  59. <dt class="col-4">Vu par</dt>
  60. <dd class="col-8">
  61. {% for user in film.usersWhoSeen %}
  62. <span>{{ user.username }}</span>&nbsp;
  63. {% endfor %}
  64. </dd>
  65. </dl>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="col-5">
  70. <div class="card border-info">
  71. <div class="card-header">
  72. <h5>Bande Annonce</h5>
  73. </div>
  74. <div class="card-body">
  75. {% if film.mediaVideo.video is defined %}
  76. <div style="height :200px ;width :300px;">
  77. {{ film.mediaVideo.video|raw }}
  78. </div>
  79. {% else %}
  80. <p>Pas encore de bande annonce</p>
  81. {% endif %}
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="col-4">
  88. <h2>Commentaires</h2>
  89. {{ include('@App/videotheque/form_commentaire.html.twig') }}
  90. <div class="list-group">
  91. {% for commentaire in commentaires %}
  92. <div class="list-group-item">
  93. {#{% if commentaire.user == app.user %}
  94. <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>
  95. {% endif %}#}
  96. <h5 class="mb-1"><strong>Posté par {{ commentaire.user.username }}</strong></h5>
  97. <p class="mb-1">{{ commentaire.contenu }}</p>
  98. </div>
  99. {% endfor %}
  100. </div>
  101. </div>
  102. </div>
  103. {% endblock %}
  104. {% block javascripts %}
  105. <script src="{{ asset('bundles/app/assets/suivifilms.js') }}"></script>
  106. <script>
  107. $(document).ready(function() {
  108. ecouterSuivi('boutonVoir', '', 'fa fa-star', '', 'fa fa-star-o', '{{ path('maliste_modifier_a_voir') }}');
  109. ecouterVu('boutonVu', 'badge badge-success', 'badge badge-danger', 'badge badge-secondary' ,'{{ path('maliste_modifier_vus') }}');
  110. });
  111. </script>
  112. {% endblock %}