FestinHegre/templates/tables/index.html.twig

87 lines
3.3 KiB
Twig

{% extends 'base.html.twig' %}
{% block title %}Tables index{% endblock %}
{% block head %}
<head>
<meta charset="UTF-8">
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
<link href="https://fonts.cdnfonts.com/css/brittany-signature" rel="stylesheet">
</head>
{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/ControllerVues/list.css') }}"> <!-- Ajout du fichier CSS -->
<link rel="stylesheet" href="{{ asset('css/Index/index.css') }}"> <!-- Ajout du fichier CSS -->
<link rel="stylesheet" href="{{ asset('css/Compte/index.css') }}"> <!-- Ajout du fichier CSS -->
<link rel="stylesheet" href="{{ asset('css/GestionUtilisateurs/GestionUtilisateurs.css') }}"> <!-- Ajout du fichier CSS -->
{% endblock %}
{% block container_modal %}
<div id="container_modal">
<h1>Tables index</h1>
<table>
<thead>
<tr>
<th>Numéro de Table</th>
<th>Client Assigné</th>
<th>Utilisateur Assigné</th>
<th>Libre ?</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for table in tables %}
<tr>
<td>{{ table.id }}</td>
<td>
{% for client in table.Clients %}
{{ client.nom }}{% if not loop.last %}, {% endif %}
{% else %}
Aucun
{% endfor %}
</td>
<td>
{% for utilisateur in table.utilisateurs %}
{{ utilisateur.nom }}{% if not loop.last %}, {% endif %}
{% else %}
Aucun
{% endfor %}
</td>
<td>
<form method="POST" action="{{ path('app_tables_update_statut', {'id': table.id}) }}">
<input type="checkbox" name="libre" value="1" {% if table.libre %}checked{% endif %}>
<button type="submit">Mettre à jour</button>
</form>
</td>
<td>
<a href="{{ path('app_tables_edit', {'id': table.id}) }}">Modifier</a>
<form method="post" action="{{ path('app_tables_delete', {'id': table.id}) }}" onsubmit="return confirm('Es-tu sûr de vouloir le supprimer ?');" style="display:inline;">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ table.id) }}">
<button type="submit">Supprimer</button>
</form>
</td>
</tr>
{% else %}
<tr>
<td colspan="5">Aucun enregistrement trouvé</td>
</tr>
{% endfor %}
</tbody>
</table>
<a onclick="addTable(this)" href="{{ path('app_tables_new')}}">Créer une tables</a>
</div>
{% endblock %}