liste.html.twig 4.3 KB

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