This commit is contained in:
Romain 2024-12-07 16:00:08 +01:00
parent 3d693511d0
commit 2ed64a3027
7 changed files with 215 additions and 136 deletions

1
.gitignore vendored
View File

@ -21,4 +21,5 @@
/assets/vendor/ /assets/vendor/
###< symfony/asset-mapper ### ###< symfony/asset-mapper ###
.idea .idea
/migrations/ /migrations/

View File

@ -1,13 +1,55 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %}Edit Company{% endblock %} {% block title %}Modifier l'entreprise{% endblock %}
{% block body %} {% 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 %} {% endblock %}

View File

@ -1,41 +1,50 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %}Company index{% endblock %} {% block title %}Liste des Entreprises{% endblock %}
{% block body %} {% 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"> <div class="overflow-x-auto bg-white shadow-lg rounded-lg">
<thead> <table class="min-w-full table-auto">
<tr> <thead>
<th>Id</th> <tr class="bg-gray-800 text-white">
<th>Name</th> <th class="px-4 py-2 text-left">ID</th>
<th>Address</th> <th class="px-4 py-2 text-left">Nom de l'entreprise</th>
<th>Tel</th> <th class="px-4 py-2 text-left">Actions</th>
<th>Mail</th> </tr>
<th>actions</th> </thead>
</tr> <tbody>
</thead> {% for company in companies %}
<tbody> <tr class="border-b">
{% for company in companies %} <td class="px-4 py-2">{{ company.id }}</td>
<tr> <td class="px-4 py-2">{{ company.name }}</td>
<td>{{ company.id }}</td> <td class="px-4 py-2 flex items-center gap-4">
<td>{{ company.name }}</td> <a href="{{ path('app_company_show', {'id': company.id}) }}" class="text-teal-500 hover:text-teal-700">
<td>{{ company.address }}</td> <i class="fas fa-eye"></i> Voir
<td>{{ company.tel }}</td> </a>
<td>{{ company.mail }}</td> <a href="{{ path('app_company_edit', {'id': company.id}) }}" class="text-yellow-500 hover:text-yellow-700">
<td> <i class="fas fa-edit"></i> Modifier
<a href="{{ path('app_company_show', {'id': company.id}) }}">show</a> </a>
<a href="{{ path('app_company_edit', {'id': company.id}) }}">edit</a> <form method="post" action="{{ path('app_company_delete', {'id': company.id}) }}" style="display:inline;">
</td> <input type="hidden" name="_method" value="DELETE">
</tr> <input type="hidden" name="_token" value="{{ csrf_token('delete' ~ company.id) }}">
{% else %} <button type="submit" class="text-red-500 hover:text-red-700">
<tr> <i class="fas fa-trash-alt"></i> Supprimer
<td colspan="6">no records found</td> </button>
</tr> </form>
{% endfor %} </td>
</tbody> </tr>
</table> {% 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 %} {% endblock %}

View File

@ -1,11 +1,47 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %}New Company{% endblock %} {% block title %}Nouvelle Entreprise{% endblock %}
{% block body %} {% 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 %} {% endblock %}

View File

@ -1,38 +1,56 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %}Company{% endblock %} {% block title %}Détail de l'entreprise{% endblock %}
{% block body %} {% 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"> <div class="bg-white shadow-md rounded-lg p-6">
<tbody> <table class="min-w-full">
<tr> <tbody>
<th>Id</th> <tr class="border-b">
<td>{{ company.id }}</td> <th class="px-6 py-4 text-lg font-medium text-gray-700">ID</th>
</tr> <td class="px-6 py-4 text-lg text-gray-900">{{ company.id }}</td>
<tr> </tr>
<th>Name</th> <tr class="border-b">
<td>{{ company.name }}</td> <th class="px-6 py-4 text-lg font-medium text-gray-700">Nom</th>
</tr> <td class="px-6 py-4 text-lg text-gray-900">{{ company.name }}</td>
<tr> </tr>
<th>Address</th> <tr class="border-b">
<td>{{ company.address }}</td> <th class="px-6 py-4 text-lg font-medium text-gray-700">Adresse</th>
</tr> <td class="px-6 py-4 text-lg text-gray-900">{{ company.address }}</td>
<tr> </tr>
<th>Tel</th> <tr class="border-b">
<td>{{ company.tel }}</td> <th class="px-6 py-4 text-lg font-medium text-gray-700">Téléphone</th>
</tr> <td class="px-6 py-4 text-lg text-gray-900">{{ company.tel }}</td>
<tr> </tr>
<th>Mail</th> <tr class="border-b">
<td>{{ company.mail }}</td> <th class="px-6 py-4 text-lg font-medium text-gray-700">Email</th>
</tr> <td class="px-6 py-4 text-lg text-gray-900">{{ company.mail }}</td>
</tbody> </tr>
</table> </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 %} {% endblock %}

View File

@ -44,33 +44,7 @@
<a class="text-teal-500 hover:underline" href="{{ path('app_announcement_list') }}">Voir tout</a> <a class="text-teal-500 hover:underline" href="{{ path('app_announcement_list') }}">Voir tout</a>
</div> </div>
<div class="space-y-6"> <div class="space-y-6">
{# Loop over recent offers (replace with dynamic data)
{% for offer in recent_offers %}
<div class="bg-white p-6 rounded-lg shadow flex justify-between items-center">
<div class="flex items-center space-x-4">
<div class="text-gray-500 text-sm">{{ offer.time_ago }}</div>
<div>
<h3 class="text-lg font-bold">{{ offer.title }}</h3>
<p class="text-gray-600">{{ offer.company }}</p>
<div class="flex items-center space-x-2 text-gray-500 text-sm mt-2">
<span class="flex items-center">
<i class="fas fa-briefcase mr-1"></i> {{ offer.category }}
</span>
<span class="flex items-center">
<i class="fas fa-clock mr-1"></i> {{ offer.type }}
</span>
<span class="flex items-center">
<i class="fas fa-dollar-sign mr-1"></i> {{ offer.salary }}
</span>
<span class="flex items-center">
<i class="fas fa-map-marker-alt mr-1"></i> {{ offer.location }}
</span>
</div>
</div>
</div>
<button class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded">Détails de l'offre</button>
</div>
{% endfor %}#}
</div> </div>
</section> </section>
{% endblock %} {% endblock %}

View File

@ -3,48 +3,47 @@
{% block title %}Modifier l'utilisateur{% endblock %} {% block title %}Modifier l'utilisateur{% endblock %}
{% block body %} {% block body %}
<div class="container mx-auto p-6"> <div class="container mx-auto p-6">
<h1 class="text-4xl font-semibold text-gray-800 mb-6">Modifier l'utilisateur</h1> <h1 class="text-4xl font-semibold text-gray-800 mb-6">Modifier l'utilisateur</h1>
<div class="bg-white shadow-md rounded-lg p-6"> <div class="bg-white shadow-md rounded-lg p-6">
{{ form_start(form) }} {{ form_start(form) }}
<div class="space-y-6"> <div class="space-y-6">
{{ form_row(form.nickname, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }} {{ form_row(form.nickname, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
{{ form_row(form.firstName, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }} {{ form_row(form.firstName, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
{{ form_row(form.lastName, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }} {{ form_row(form.lastName, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
{{ form_row(form.tel, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }} {{ form_row(form.tel, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
{{ form_row(form.address, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }} {{ form_row(form.address, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
{{ form_row(form.mail, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }} {{ form_row(form.mail, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
{{ form_row(form.password, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }} {{ form_row(form.password, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
</div> </div>
<div class="mt-6">
{{ form_widget(form) }} <div class="mt-6">
{{ form_widget(form) }}
</div>
<button type="submit" class="bg-teal-500 hover:bg-teal-600 text-white px-6 py-3 rounded-lg mt-4">
Mettre à jour
</button>
{{ form_end(form) }}
</div> </div>
<button type="submit" class="bg-teal-500 hover:bg-teal-600 text-white px-6 py-3 rounded-lg mt-4"> <div class="mt-6 flex justify-between items-center">
Mettre à jour <a href="{{ path('app_user_index') }}" class="text-teal-500 hover:text-teal-700 text-lg">
</button> <i class="fas fa-arrow-left"></i> Retour à la liste des utilisateurs
{{ form_end(form) }}
</div>
<div class="mt-6 flex justify-between items-center">
<a href="{{ path('app_user_index') }}" class="text-teal-500 hover:text-teal-700 text-lg">
<i class="fas fa-arrow-left"></i> Retour à la liste des utilisateurs
</a>
<div class="flex items-center space-x-4">
<a href="{{ path('app_user_show', {'id': user_app.id}) }}"
class="bg-yellow-500 hover:bg-yellow-600 text-white px-4 py-2 rounded-lg">
Voir l'utilisateur
</a> </a>
<a href="{{ path('app_user_delete', {'id': user_app.id}) }}" <div class="flex items-center space-x-4">
class="bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded-lg"> <a href="{{ path('app_user_show', {'id': user_app.id}) }}" class="bg-yellow-500 hover:bg-yellow-600 text-white px-4 py-2 rounded-lg">
Supprimer Voir l'utilisateur
</a> </a>
<a href="{{ path('app_user_delete', {'id': user_app.id}) }}" class="bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded-lg">
Supprimer
</a>
</div>
</div> </div>
</div> </div>
</div> {% endblock %}
{% endblock %}