liste.html.twig 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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') }}"><i class="fa fa-plus-square fa-lg"></i> 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-secondary"></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-secondary">
  60. {{ vu_icone | raw }}
  61. </a>
  62. </td>
  63. <td>
  64. {% if film.authered is defined %}
  65. {% if film.authered.activeNow %}
  66. <i class="fa fa-user text-success"></i>
  67. {% else %}
  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. {#
  108. <td>{% if not film.lien == "" %}<a target="_blank" href="{{ film.lien }}"><i class="fa fa-external-link fa-lg"></i></a>{% endif %}</td>
  109. <td>
  110. <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>
  111. {% 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 %}
  112. </td>
  113. #}
  114. </tr>
  115. {% endfor %}
  116. </tbody>
  117. </table>
  118. </div>
  119. {% endblock %}