voirfilm.html.twig 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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">Année</dt>
  36. <dd class="col-8">{{ film.annee | date('Y') }}</dd>
  37. <dt class="col-4">Réalisateur(s)</dt>
  38. <dd class="col-8">
  39. {% for realisateur in film.realisateurs %}
  40. <a href="{{ path('videotheque_listeparreal', {'id': realisateur.id}) }}"><span class="badge badge-info">{{ realisateur.nomComplet }}</span></a>
  41. {% endfor %}
  42. </dd>
  43. <dt class="col-4">Genre</dt>
  44. <dd class="col-8">
  45. {% for genre in film.genres %}
  46. <a href="{{ path('videotheque_listepargenre', {'id': genre.id}) }}"><span class="badge badge-info">{{ genre.name }}</span></a>
  47. {% endfor %}
  48. </dd>
  49. {% if film.lien is not null %}
  50. <dt class="col-4">Lien</dt>
  51. <dd class="col-8"><a href="{{ film.lien }}"><i class="fa fa-external-link"></i></a></dd>
  52. {% endif %}
  53. </dl>
  54. </div>
  55. <div class="card-footer">
  56. <dl class="row">
  57. <dt class="col-4">Suivi par</dt>
  58. <dd class="col-8">
  59. {% for user in film.usersWantToView %}
  60. <span>{{ user.username }}</span>&nbsp;
  61. {% endfor %}
  62. </dd>
  63. <dt class="col-4">Vu par</dt>
  64. <dd class="col-8">
  65. {% for user in film.usersWhoSeen %}
  66. <span>{{ user.username }}</span>&nbsp;
  67. {% endfor %}
  68. </dd>
  69. </dl>
  70. </div>
  71. </div>
  72. </div>
  73. <div class="col-5">
  74. <div class="card border-info">
  75. <div class="card-header">
  76. <h5>Bande Annonce</h5>
  77. </div>
  78. <div class="card-body">
  79. {% if film.mediaVideo.video is defined %}
  80. <div class="embed-responsive embed-responsive-4by3">
  81. {{ film.mediaVideo.video|raw }}
  82. </div>
  83. {% else %}
  84. <p>Pas encore de bande annonce</p>
  85. {% endif %}
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. <div class="col-4">
  92. <h2>Commentaires</h2>
  93. {{ include('@App/videotheque/form_commentaire.html.twig') }}
  94. <div class="list-group">
  95. {% for commentaire in commentaires %}
  96. <div class="list-group-item">
  97. {#{% if commentaire.user == app.user %}
  98. <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>
  99. {% endif %}#}
  100. <h5 class="mb-1"><strong>Posté par {{ commentaire.user.username }}</strong></h5>
  101. <p class="mb-1">{{ commentaire.contenu }}</p>
  102. </div>
  103. {% endfor %}
  104. </div>
  105. </div>
  106. </div>
  107. {% endblock %}
  108. {% block javascripts %}
  109. <script src="{{ asset('bundles/app/assets/suivifilms.js') }}"></script>
  110. <script>
  111. $(document).ready(function() {
  112. ecouterSuivi('boutonVoir', '', 'fa fa-star', '', 'fa fa-star-o', '{{ path('maliste_modifier_a_voir') }}');
  113. ecouterVu('boutonVu', 'badge badge-success', 'badge badge-danger', 'badge badge-secondary' ,'{{ path('maliste_modifier_vus') }}');
  114. });
  115. </script>
  116. {% endblock %}