liste.html.twig 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. {% extends "videotheque/base.html.twig" %}
  2. {% block title %}
  3. {% if titre is defined %}{{ titre }}{% else %}{{ parent() }}{% endif %}
  4. {% endblock %}
  5. {% block titre %}
  6. {% if titre is defined %}{{ titre }}{% else %}{{ parent() }}{% endif %}
  7. {% endblock %}
  8. {% block body %}
  9. <p><a class="btn btn-primary" role="button" href="{{ path('videotheque_ajouter') }}">Ajouter un film</a></p>
  10. <table class="table table-bordered table-hover table-sm">
  11. <thead class="thead-dark">
  12. <tr>
  13. <th>Voir</th>
  14. <th>Vu</th>
  15. <th>Ajouté par</th>
  16. <th>Titre du film</th>
  17. <th>Genre</th>
  18. <th>Réalisateur</th>
  19. <th>Note moyenne</th>
  20. <th>Année</th>
  21. <th>Lien</th>
  22. <th>Actions</th>
  23. </tr>
  24. </thead>
  25. <tbody>
  26. {% for film in listeFilms %}
  27. <tr>
  28. <td>
  29. {% if app.user.wantToSee(film) %}
  30. <a href="#" class="boutonVoir" data-toggle="tooltip" title="Supprimer ce film de votre liste à voir" data-content="{{ film.id }}"><i class="fa fa-star fa-lg"></i></a>
  31. {% else %}
  32. <a href="#" class="boutonVoir" data-toggle="tooltip" title="Ajouter ce film à vos liste à voir" data-content="{{ film.id }}"><i class="fa fa-star-o fa-lg"></i></a>
  33. {% endif %}
  34. </td>
  35. <td>
  36. {% if app.user.haveSeen(film) %}
  37. <a href="#" class="boutonVu" data-content="{{ film.id }}"><i class="badge badge-secondary">Pas vu</i><i class="badge badge-success">Vu</i></a>
  38. {% else %}
  39. <a href="#" class="boutonVu" data-content="{{ film.id }}"><i class="badge badge-danger">Pas vu</i><i class="badge badge-secondary">Vu</i></a>
  40. {% endif %}
  41. </td>
  42. <td>
  43. {% if film.authered is defined %}
  44. {% if film.authered.activeNow %}
  45. {#<span class="badge badge-success">En ligne</span>#}
  46. <i class="fa fa-user text-success"></i>
  47. {% else %}
  48. {#<span class="badge badge-secondary">Hors ligne</span>#}
  49. <i class="fa fa-user-o text-secondary"></i>
  50. {% endif %}
  51. {{ film.authered.username }}
  52. {% endif %}
  53. </td>
  54. <td>
  55. <a href="{{ path('videotheque_voirfilm', {'id': film.id}) }}">{{ film.titre }}</a>
  56. {% if film.new %}<span class="badge badge-light">New</span>{% endif %}
  57. {% if film.nbComs %}<span class="badge badge-light" data-toggle="tooltip" data-original-title="{{ film.nbComs }} commentaire(s)">{{ film.nbComs }}</span>{% endif %}
  58. </td>
  59. <td>
  60. {% if film.genres is defined %}
  61. {% for genre in film.genres %}
  62. <a href="{{ path("videotheque_listepargenre", {"id": genre.id}) }}"><span class="badge badge-secondary">{{ genre.name }}</span></a>
  63. {% endfor %}
  64. {% endif %}
  65. </td>
  66. <td>
  67. {% if film.realisateurs is defined %}
  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. {% endif %}
  72. </td>
  73. <td>
  74. {% if film.note > 0 %}
  75. <input class="rating"
  76. data-disabled="true"
  77. data-show-clear="false"
  78. data-show-caption="false"
  79. data-theme="krajee-fa"
  80. min=0
  81. max=5
  82. data-step=0.5
  83. data-size="xs"
  84. value="{{ film.note }}">
  85. {% endif %}
  86. </td>
  87. <td>{{ film.annee | date('Y') }}</td>
  88. <td>{% if not film.lien == "" %}<a target="_blank" href="{{ film.lien }}"><i class="fa fa-external-link fa-lg"></i></a>{% endif %}</td>
  89. <td>
  90. <a data-toggle="tooltip" title="Modifier la fiche film" href="{{ path('videotheque_modifier', {'id': film.id}) }}"><i class="fa fa-edit fa-lg", style="color:DodgerBlue;"></i></a>
  91. {% 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 %}
  92. </td>
  93. </tr>
  94. {% endfor %}
  95. </tbody>
  96. </table>
  97. {% endblock %}
  98. {% block javascripts %}
  99. <script src="{{ asset('bundles/app/assets/suivifilms.js') }}"></script>
  100. <script>
  101. $(document).ready(function() {
  102. ecouterSuivi('boutonVoir', '', 'fa fa-star fa-lg', '', 'fa fa-star-o fa-lg', '{{ path('maliste_modifier_a_voir') }}');
  103. ecouterVu('boutonVu', 'badge badge-success', 'badge badge-danger', 'badge badge-secondary' ,'{{ path('maliste_modifier_vus') }}');
  104. });
  105. </script>
  106. {% endblock %}