la derniere goute de pluie d'eau froide

This commit is contained in:
bourgoino 2024-12-06 08:06:44 +01:00
parent f7c08a5c98
commit a0e50bf187
6 changed files with 178 additions and 77 deletions

View File

@ -62,7 +62,7 @@ class Company
return $this;
}
public function getAddress(): ?stringz
public function getAddress(): ?string
{
return $this->address;
}

View File

@ -1,13 +1,55 @@
{% extends 'base.html.twig' %}
{% block title %}Edit Company{% endblock %}
{% block title %}Modifier l'entreprise{% endblock %}
{% block body %}
<h1>Edit Company</h1>
<div class="container mx-auto p-6">
<h1 class="text-3xl font-bold mb-4">Modifier l'entreprise</h1>
{{ include('company/_form.html.twig', {'button_label': 'Update'}) }}
<div class="bg-white shadow-md rounded-lg p-6">
{{ form_start(form) }}
<a href="{{ path('app_company_index') }}">back to list</a>
<div class="mb-4">
<label for="company_name" class="block text-lg font-medium text-gray-700 mb-2">Nom de l'entreprise</label>
<div class="mt-1">
{{ form_widget(form.name, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
</div>
</div>
{{ include('company/_delete_form.html.twig') }}
<div class="mb-4">
<label for="company_address" class="block text-lg font-medium text-gray-700 mb-2">Adresse</label>
<div class="mt-1">
{{ form_widget(form.address, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
</div>
</div>
<div class="mb-4">
<label for="company_tel" class="block text-lg font-medium text-gray-700 mb-2">Téléphone</label>
<div class="mt-1">
{{ form_widget(form.tel, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
</div>
</div>
<div class="mb-4">
<label for="company_mail" class="block text-lg font-medium text-gray-700 mb-2">Email</label>
<div class="mt-1">
{{ form_widget(form.mail, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
</div>
</div>
<div class="mt-6">
<button type="submit" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full w-full">
Mettre à jour l'entreprise
</button>
</div>
{{ form_end(form) }}
</div>
<div class="mt-6">
<a href="{{ path('app_company_index') }}" class="text-teal-500 hover:text-teal-700">
<i class="fas fa-arrow-left"></i> Retour à la liste des entreprises
</a>
</div>
</div>
{% endblock %}

View File

@ -1,41 +1,50 @@
{% extends 'base.html.twig' %}
{% block title %}Company index{% endblock %}
{% block title %}Liste des Entreprises{% endblock %}
{% block body %}
<h1>Company index</h1>
<div class="container mx-auto p-6">
<h1 class="text-3xl font-bold mb-4">Liste des Entreprises</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Address</th>
<th>Tel</th>
<th>Mail</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for company in companies %}
<tr>
<td>{{ company.id }}</td>
<td>{{ company.name }}</td>
<td>{{ company.address }}</td>
<td>{{ company.tel }}</td>
<td>{{ company.mail }}</td>
<td>
<a href="{{ path('app_company_show', {'id': company.id}) }}">show</a>
<a href="{{ path('app_company_edit', {'id': company.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="6">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<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>
<a href="{{ path('app_company_new') }}">Create new</a>
<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>
{% endblock %}

View File

@ -1,11 +1,47 @@
{% extends 'base.html.twig' %}
{% block title %}New Company{% endblock %}
{% block title %}Nouvelle Entreprise{% endblock %}
{% block body %}
<h1>Create new Company</h1>
<div class="container mx-auto p-6">
<h1 class="text-3xl font-bold mb-6">Créer une nouvelle entreprise</h1>
{{ include('company/_form.html.twig') }}
<div class="bg-white shadow-md rounded-lg p-6">
{{ form_start(form) }}
<a href="{{ path('app_company_index') }}">back to list</a>
<div class="mb-4">
<label for="company_name" class="block text-lg font-medium text-gray-700 mb-2">Nom de l'entreprise</label>
{{ form_widget(form.name, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
</div>
<div class="mb-4">
<label for="company_address" class="block text-lg font-medium text-gray-700 mb-2">Adresse de l'entreprise</label>
{{ form_widget(form.address, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
</div>
<div class="mb-4">
<label for="company_tel" class="block text-lg font-medium text-gray-700 mb-2">Numéro de téléphone</label>
{{ form_widget(form.tel, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
</div>
<div class="mb-4">
<label for="company_mail" class="block text-lg font-medium text-gray-700 mb-2">Email de l'entreprise</label>
{{ form_widget(form.mail, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
</div>
<div class="mt-6">
<button type="submit" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full w-full">
Créer l'entreprise
</button>
</div>
{{ form_end(form) }}
</div>
<div class="mt-4">
<a href="{{ path('app_company_index') }}" class="text-teal-500 hover:text-teal-700">
<i class="fas fa-arrow-left"></i> Retour à la liste des entreprises
</a>
</div>
</div>
{% endblock %}

View File

@ -1,38 +1,56 @@
{% extends 'base.html.twig' %}
{% block title %}Company{% endblock %}
{% block title %}Détail de l'entreprise{% endblock %}
{% block body %}
<h1>Company</h1>
<div class="container mx-auto p-6">
<h1 class="text-3xl font-bold mb-4">Détail de l'entreprise</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ company.id }}</td>
</tr>
<tr>
<th>Name</th>
<td>{{ company.name }}</td>
</tr>
<tr>
<th>Address</th>
<td>{{ company.address }}</td>
</tr>
<tr>
<th>Tel</th>
<td>{{ company.tel }}</td>
</tr>
<tr>
<th>Mail</th>
<td>{{ company.mail }}</td>
</tr>
</tbody>
</table>
<div class="bg-white shadow-md rounded-lg p-6">
<table class="min-w-full">
<tbody>
<tr class="border-b">
<th class="px-6 py-4 text-lg font-medium text-gray-700">ID</th>
<td class="px-6 py-4 text-lg text-gray-900">{{ company.id }}</td>
</tr>
<tr class="border-b">
<th class="px-6 py-4 text-lg font-medium text-gray-700">Nom</th>
<td class="px-6 py-4 text-lg text-gray-900">{{ company.name }}</td>
</tr>
<tr class="border-b">
<th class="px-6 py-4 text-lg font-medium text-gray-700">Adresse</th>
<td class="px-6 py-4 text-lg text-gray-900">{{ company.address }}</td>
</tr>
<tr class="border-b">
<th class="px-6 py-4 text-lg font-medium text-gray-700">Téléphone</th>
<td class="px-6 py-4 text-lg text-gray-900">{{ company.tel }}</td>
</tr>
<tr class="border-b">
<th class="px-6 py-4 text-lg font-medium text-gray-700">Email</th>
<td class="px-6 py-4 text-lg text-gray-900">{{ company.mail }}</td>
</tr>
</tbody>
</table>
</div>
<a href="{{ path('app_company_index') }}">back to list</a>
<div class="mt-6 flex justify-between">
<a href="{{ path('app_company_index') }}" class="text-teal-500 hover:text-teal-700">
<i class="fas fa-arrow-left"></i> Retour à la liste des entreprises
</a>
<a href="{{ path('app_company_edit', {'id': company.id}) }}">edit</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 cette entreprise
</a>
</div>
{{ include('company/_delete_form.html.twig') }}
<div class="mt-6">
<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 cette entreprise
</button>
</form>
</div>
</div>
{% endblock %}

View File

@ -6,7 +6,6 @@
<div class="container mx-auto p-6">
<h1 class="text-3xl font-bold mb-4">Liste des Diplômes</h1>
<!-- Tableau des diplômes -->
<div class="overflow-x-auto bg-white shadow-lg rounded-lg">
<table class="min-w-full table-auto">
<thead>
@ -27,12 +26,10 @@
<i class="fas fa-eye"></i> Voir
</a>
<!-- Modifier le diplôme -->
<a href="{{ path('app_degree_edit', {'id': degree.id}) }}" class="text-yellow-500 hover:text-yellow-700 mr-3">
<i class="fas fa-edit"></i> Modifier
</a>
<!-- Formulaire pour supprimer le diplôme -->
<form method="post" action="{{ path('app_degree_delete', {'id': degree.id}) }}" style="display:inline;">
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ degree.id) }}">
@ -47,7 +44,6 @@
</table>
</div>
<!-- Lien pour ajouter un nouveau diplôme -->
<div class="mt-4">
<a href="{{ path('app_degree_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 un nouveau diplôme