liste.html.twig 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. {% set follow_icone = "fa fa-star fa-lg" %}
  31. {% set follow_texte = "Supprimer ce film de votre liste à voir" %}
  32. {% else %}
  33. {% set follow_icone = "fa fa-star-o fa-lg" %}
  34. {% set follow_texte = "Ajouter ce film à votre liste à voir" %}
  35. {% endif %}
  36. <a href="#" data-fonction="switch"
  37. data-icone-actif="fa fa-star fa-lg"
  38. data-icone-inactif="fa fa-star-o fa-lg"
  39. data-path="{{ path('maliste_modifier_a_voir') }}"
  40. data-toggle="tooltip"
  41. title="{{ follow_texte }}"
  42. data-content="{{ film.id }}">
  43. <i class="{{ follow_icone }}"></i>
  44. </a>
  45. </td>
  46. <td>
  47. {% if app.user.haveSeen(film) %}
  48. {% set vu_icone = '<i class="fa fa-eye fa-lg text-success"></i>' %}
  49. {% else %}
  50. {% set vu_icone = '<i class="fa fa-eye-slash fa-lg text-danger"></i>' %}
  51. {% endif %}
  52. <a href="#" data-fonction="switch"
  53. data-path="{{ path('maliste_modifier_vus') }}"
  54. data-content="{{ film.id }}"
  55. data-icone-actif = "fa fa-eye fa-lg text-success"
  56. data-icone-inactif = "fa fa-eye-slash fa-lg text-danger">
  57. {{ vu_icone | raw }}
  58. </a>
  59. </td>
  60. <td>
  61. {% if film.authered is defined %}
  62. {% if film.authered.activeNow %}
  63. {#<span class="badge badge-success">En ligne</span>#}
  64. <i class="fa fa-user text-success"></i>
  65. {% else %}
  66. {#<span class="badge badge-secondary">Hors ligne</span>#}
  67. <i class="fa fa-user-o text-secondary"></i>
  68. {% endif %}
  69. {{ film.authered.username }}
  70. {% endif %}
  71. </td>
  72. <td>
  73. <a href="{{ path('videotheque_voirfilm', {'id': film.id}) }}">{{ film.titre }}</a>
  74. {% if film.new %}<span class="badge badge-light">New</span>{% endif %}
  75. {% if film.nbComs %}<span class="badge badge-light" data-toggle="tooltip" data-original-title="{{ film.nbComs }} commentaire(s)">{{ film.nbComs }}</span>{% endif %}
  76. </td>
  77. <td>
  78. {% if film.genres is defined %}
  79. {% for genre in film.genres %}
  80. <a href="{{ path("videotheque_listepargenre", {"id": genre.id}) }}"><span class="badge badge-secondary">{{ genre.name }}</span></a>
  81. {% endfor %}
  82. {% endif %}
  83. </td>
  84. <td>
  85. {% if film.realisateurs is defined %}
  86. {% for realisateur in film.realisateurs %}
  87. <a href="{{ path('videotheque_listeparreal', {"id": realisateur.id}) }}"><span class="badge badge-info">{{ realisateur.nomComplet }}</span> </a>
  88. {% endfor %}
  89. {% endif %}
  90. </td>
  91. <td>
  92. {% if film.note > 0 %}
  93. <input class="rating"
  94. data-disabled="true"
  95. data-show-clear="false"
  96. data-show-caption="false"
  97. data-theme="krajee-fa"
  98. min=0
  99. max=5
  100. data-step=0.5
  101. data-size="xs"
  102. value="{{ film.note }}">
  103. {% endif %}
  104. </td>
  105. <td>{{ film.annee | date('Y') }}</td>
  106. <td>{% if not film.lien == "" %}<a target="_blank" href="{{ film.lien }}"><i class="fa fa-external-link fa-lg"></i></a>{% endif %}</td>
  107. <td>
  108. <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>
  109. {% 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 %}
  110. </td>
  111. </tr>
  112. {% endfor %}
  113. </tbody>
  114. </table>
  115. {% endblock %}