liste.html.twig 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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="follow"
  37. data-icactif="fa fa-star fa-lg"
  38. data-icinactif="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="badge badge-secondary">Pas vu</i><i class="badge badge-success">Vu</i>' %}
  49. {% else %}
  50. {% set vu_icone = '<i class="badge badge-danger">Pas vu</i><i class="badge badge-secondary">Vu</i>' %}
  51. {% endif %}
  52. <a href="#" data-fonction="seen"
  53. data-path="{{ path('maliste_modifier_vus') }}"
  54. data-content="{{ film.id }}"
  55. data-neutre = "badge badge-secondary"
  56. data-vu = "badge badge-success"
  57. data-pasvu = "badge badge-danger">
  58. {{ vu_icone | raw }}
  59. </a>
  60. </td>
  61. <td>
  62. {% if film.authered is defined %}
  63. {% if film.authered.activeNow %}
  64. {#<span class="badge badge-success">En ligne</span>#}
  65. <i class="fa fa-user text-success"></i>
  66. {% else %}
  67. {#<span class="badge badge-secondary">Hors ligne</span>#}
  68. <i class="fa fa-user-o text-secondary"></i>
  69. {% endif %}
  70. {{ film.authered.username }}
  71. {% endif %}
  72. </td>
  73. <td>
  74. <a href="{{ path('videotheque_voirfilm', {'id': film.id}) }}">{{ film.titre }}</a>
  75. {% if film.new %}<span class="badge badge-light">New</span>{% endif %}
  76. {% if film.nbComs %}<span class="badge badge-light" data-toggle="tooltip" data-original-title="{{ film.nbComs }} commentaire(s)">{{ film.nbComs }}</span>{% endif %}
  77. </td>
  78. <td>
  79. {% if film.genres is defined %}
  80. {% for genre in film.genres %}
  81. <a href="{{ path("videotheque_listepargenre", {"id": genre.id}) }}"><span class="badge badge-secondary">{{ genre.name }}</span></a>
  82. {% endfor %}
  83. {% endif %}
  84. </td>
  85. <td>
  86. {% if film.realisateurs is defined %}
  87. {% for realisateur in film.realisateurs %}
  88. <a href="{{ path('videotheque_listeparreal', {"id": realisateur.id}) }}"><span class="badge badge-info">{{ realisateur.nomComplet }}</span> </a>
  89. {% endfor %}
  90. {% endif %}
  91. </td>
  92. <td>
  93. {% if film.note > 0 %}
  94. <input class="rating"
  95. data-disabled="true"
  96. data-show-clear="false"
  97. data-show-caption="false"
  98. data-theme="krajee-fa"
  99. min=0
  100. max=5
  101. data-step=0.5
  102. data-size="xs"
  103. value="{{ film.note }}">
  104. {% endif %}
  105. </td>
  106. <td>{{ film.annee | date('Y') }}</td>
  107. <td>{% if not film.lien == "" %}<a target="_blank" href="{{ film.lien }}"><i class="fa fa-external-link fa-lg"></i></a>{% endif %}</td>
  108. <td>
  109. <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>
  110. {% 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 %}
  111. </td>
  112. </tr>
  113. {% endfor %}
  114. </tbody>
  115. </table>
  116. {% endblock %}