Spaces:
Running
Running
| {% extends "base.html" %} | |
| {% block title %}Gérer les Catégories - {{ super() }}{% endblock %} | |
| {% block content %} | |
| <h2 class="mb-4">Gérer les Catégories</h2> | |
| <div class="d-flex gap-2 mb-4"> | |
| <a href="{{ url_for('admin_home') }}" class="btn btn-secondary">Retour à l'admin</a> | |
| <a href="{{ url_for('admin_new_category') }}" class="btn btn-primary">Nouvelle Catégorie</a> | |
| </div> | |
| <div class="table-responsive"> | |
| <table class="table table-striped table-hover"> | |
| <thead class="table-dark"> | |
| <tr> | |
| <th>ID</th> | |
| <th>Nom</th> | |
| <th>Sujet</th> | |
| <th>Actions</th> | |
| </tr> | |
| </thead> | |
| <tbody> | |
| {% for category in categories %} | |
| <tr> | |
| <td>{{ category.id }}</td> | |
| <td>{{ category.name }}</td> | |
| <td>{{ category.subject.name }}</td> | |
| <td> | |
| <div class="btn-group" role="group"> | |
| <a href="{{ url_for('admin_edit_category', category_id=category.id) }}" class="btn btn-sm btn-outline-primary">Éditer</a> | |
| <form method="post" action="{{ url_for('admin_delete_category', category_id=category.id) }}" style="display:inline;" onsubmit="return confirm('Êtes-vous sûr de vouloir supprimer cette catégorie ?')"> | |
| <button type="submit" class="btn btn-sm btn-outline-danger">Supprimer</button> | |
| </form> | |
| </div> | |
| </td> | |
| </tr> | |
| {% endfor %} | |
| </tbody> | |
| </table> | |
| </div> | |
| {% endblock %} |