hegresphere/templates/company/index.html.twig

51 lines
2.4 KiB
Twig
Raw Normal View History

2024-11-21 17:04:56 +01:00
{% extends 'base.html.twig' %}
2024-12-07 16:00:08 +01:00
{% block title %}Liste des Entreprises{% endblock %}
2024-11-21 17:04:56 +01:00
{% block body %}
2024-12-07 16:00:08 +01:00
<div class="container mx-auto p-6">
<h1 class="text-3xl font-bold mb-4">Liste des Entreprises</h1>
2024-11-21 17:04:56 +01:00
2024-12-07 16:00:08 +01:00
<div class="overflow-x-auto bg-white shadow-lg rounded-lg">
<table class="min-w-full table-auto">
<thead>
<tr class="bg-gray-800 text-white">
<th class="px-4 py-2 text-left">ID</th>
<th class="px-4 py-2 text-left">Nom de l'entreprise</th>
<th class="px-4 py-2 text-left">Actions</th>
</tr>
</thead>
<tbody>
{% for company in companies %}
<tr class="border-b">
<td class="px-4 py-2">{{ company.id }}</td>
<td class="px-4 py-2">{{ company.name }}</td>
<td class="px-4 py-2 flex items-center gap-4">
<a href="{{ path('app_company_show', {'id': company.id}) }}" class="text-teal-500 hover:text-teal-700">
<i class="fas fa-eye"></i> Voir
</a>
<a href="{{ path('app_company_edit', {'id': company.id}) }}" class="text-yellow-500 hover:text-yellow-700">
<i class="fas fa-edit"></i> Modifier
</a>
<form method="post" action="{{ path('app_company_delete', {'id': company.id}) }}" style="display:inline;">
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ company.id) }}">
<button type="submit" class="text-red-500 hover:text-red-700">
<i class="fas fa-trash-alt"></i> Supprimer
</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
2024-11-21 17:04:56 +01:00
2024-12-07 16:00:08 +01:00
<div class="mt-4">
<a href="{{ path('app_company_new') }}" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full">
<i class="fas fa-plus-circle"></i> Ajouter une nouvelle entreprise
</a>
</div>
</div>
2024-11-21 17:04:56 +01:00
{% endblock %}