Initial scaffold : Laravel 12 + PostgreSQL + auth + domaine métier (étapes 1-5)
- Laravel 12 sur PHP 8.5, Breeze (Blade/Tailwind/Alpine.js) - Docker Compose dev (PostgreSQL 18 + Redis) et prod (stack complète + nginx) - Migrations et models : lieux, sections, dépôts, source_types/fields, sources, relevés - Colonne JSONB data sur releves avec colonnes générées indexées (nom, prenom, date_evenement) - Index GIN pour la recherche fulltext - Enums : UserRole, SourceStatus (avec transitions), CalendarType, FieldType - RoleMiddleware (alias `role`) + helpers isAdmin/isSectionManager sur User - CRUD Lieux (arbre hiérarchique, calcul nom_long en cascade) - CRUD admin : Sections (+ gestion membres), Dépôts, Types de sources (+ champs dynamiques, drag & drop) - CRUD Sources : visibilité filtrée par rôle, assignation membres, workflow de statut Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<div class="flex items-center justify-between">
|
||||
<h2 class="text-xl font-semibold text-gray-800">Lieux</h2>
|
||||
@can('create', App\Models\Lieu::class)
|
||||
<a href="{{ route('lieux.create') }}"
|
||||
class="px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700">
|
||||
+ Nouveau lieu
|
||||
</a>
|
||||
@endcan
|
||||
</div>
|
||||
</x-slot>
|
||||
|
||||
<div class="py-8 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
|
||||
@if(session('success'))
|
||||
<div class="mb-4 p-4 bg-green-50 border border-green-200 text-green-800 rounded-md">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
@if(session('error'))
|
||||
<div class="mb-4 p-4 bg-red-50 border border-red-200 text-red-800 rounded-md">
|
||||
{{ session('error') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="bg-white shadow rounded-lg overflow-hidden">
|
||||
<table class="min-w-full divide-y divide-gray-200">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Lieu</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Code</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Parent</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Coordonnées</th>
|
||||
<th class="px-6 py-3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200">
|
||||
@forelse($lieux as $lieu)
|
||||
<tr class="hover:bg-gray-50">
|
||||
<td class="px-6 py-4">
|
||||
<a href="{{ route('lieux.show', $lieu) }}" class="font-medium text-indigo-600 hover:underline">
|
||||
{{ $lieu->nom }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500">{{ $lieu->code ?? '—' }}</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500">
|
||||
@if($lieu->parent)
|
||||
<a href="{{ route('lieux.show', $lieu->parent) }}" class="text-indigo-600 hover:underline">
|
||||
{{ $lieu->parent->nom }}
|
||||
</a>
|
||||
@else
|
||||
—
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500">
|
||||
@if($lieu->latitude && $lieu->longitude)
|
||||
{{ number_format($lieu->latitude, 4) }}, {{ number_format($lieu->longitude, 4) }}
|
||||
@else
|
||||
—
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-6 py-4 text-right text-sm space-x-3">
|
||||
@can('update', $lieu)
|
||||
<a href="{{ route('lieux.edit', $lieu) }}" class="text-gray-600 hover:text-indigo-600">Modifier</a>
|
||||
@endcan
|
||||
@can('delete', $lieu)
|
||||
<form method="POST" action="{{ route('lieux.destroy', $lieu) }}" class="inline"
|
||||
x-data
|
||||
@submit.prevent="if(confirm('Supprimer ce lieu ?')) $el.submit()">
|
||||
@csrf @method('DELETE')
|
||||
<button type="submit" class="text-red-500 hover:text-red-700">Supprimer</button>
|
||||
</form>
|
||||
@endcan
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="5" class="px-6 py-10 text-center text-gray-400">Aucun lieu enregistré.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@if($lieux->hasPages())
|
||||
<div class="px-6 py-4 border-t border-gray-200">
|
||||
{{ $lieux->links() }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
Reference in New Issue
Block a user