index.html.twig 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. {% extends 'bulma.html.twig' %}
  2. {% block title %}Administration > Jeux{% endblock %}
  3. {% block content %}
  4. <nav class="breadcrumb has-arrow-separator" aria-label="breadcrumbs">
  5. <ul>
  6. <li><a href="{{ path('app_main') }}">Accueil</a></li>
  7. <li><a href="{{ path('app_admin') }}">Administration</a></li>
  8. <li class="is-active"><a href="{{ path('app_admin_game') }}">Gestion des jeux</a></li>
  9. </ul>
  10. </nav>
  11. <div class="block">
  12. <h1 class="title">Gestion des jeux</h1>
  13. <p class="subtitle">Liste des jeux de rôle connus dans l'application.</p>
  14. </div>
  15. <div class="block">
  16. <div class="is-grouped">
  17. <a class="button is-primary" href="{{ path('app_admin_game_add') }}">Ajouter un jeu</a>
  18. </div>
  19. </div>
  20. <div class="block">
  21. <table id="datatable" {{ stimulus_controller('datatables') }} class="table is-striped is-hoverable is-fullwidth">
  22. <thead>
  23. <tr>
  24. <th>Nom du jeu</th>
  25. <th>Description</th>
  26. <th>Genres</th>
  27. <th>Validé?</th>
  28. <th>Actions</th>
  29. </tr>
  30. </thead>
  31. <tbody>
  32. {% for game in games %}
  33. <tr>
  34. <td><a href="{{ path('app_admin_game_edit', {id: game.id}) }}">{{ game.name }}</a></td>
  35. <td>{{ game.description }}</td>
  36. <td>{% for genre in game.genre %}<span class="tag is-info is-light">{{ genre.genre }}</span> {% endfor %}</td>
  37. <td>{% if game.isValidByAdmin %}<span class="icon"><twig:ux:icon name="bi:check"/></span>{% else %}<a href="{{ path('app_admin_game_valid', {id: game.id}) }}" class="button">Valider</a>{%endif%}</td>
  38. <td>
  39. <a class="button" href="{{ path('app_admin_game_edit', {id: game.id}) }}">Éditer</a>
  40. <a class="button is-danger" data-id="{{ path('app_admin_game_delete', {'id': game.id})}}" href="#" {{ stimulus_controller('admin_confirm') }}>Supprimer</a>
  41. </td>
  42. </tr>
  43. {% endfor %}
  44. </tbody>
  45. </table>
  46. </div>
  47. {% endblock %}