7609d35287
- 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>
98 lines
4.3 KiB
PHP
98 lines
4.3 KiB
PHP
<x-app-layout>
|
|
<x-slot name="header">
|
|
<div class="flex items-center justify-between">
|
|
<h2 class="text-xl font-semibold text-gray-800">{{ $lieu->nom }}</h2>
|
|
<div class="flex gap-3">
|
|
@can('update', $lieu)
|
|
<a href="{{ route('lieux.edit', $lieu) }}"
|
|
class="px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700">
|
|
Modifier
|
|
</a>
|
|
@endcan
|
|
@can('delete', $lieu)
|
|
<form method="POST" action="{{ route('lieux.destroy', $lieu) }}"
|
|
x-data @submit.prevent="if(confirm('Supprimer ce lieu ?')) $el.submit()">
|
|
@csrf @method('DELETE')
|
|
<button type="submit"
|
|
class="px-4 py-2 bg-red-600 text-white text-sm rounded-md hover:bg-red-700">
|
|
Supprimer
|
|
</button>
|
|
</form>
|
|
@endcan
|
|
</div>
|
|
</div>
|
|
</x-slot>
|
|
|
|
<div class="py-8 max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 space-y-6">
|
|
|
|
@if(session('success'))
|
|
<div class="p-4 bg-green-50 border border-green-200 text-green-800 rounded-md">
|
|
{{ session('success') }}
|
|
</div>
|
|
@endif
|
|
|
|
{{-- Fiche --}}
|
|
<div class="bg-white shadow rounded-lg divide-y divide-gray-100">
|
|
<div class="px-6 py-4 grid grid-cols-3 gap-4 text-sm">
|
|
<dt class="font-medium text-gray-500">Nom complet</dt>
|
|
<dd class="col-span-2 text-gray-900">{{ $lieu->nom_long ?? $lieu->nom }}</dd>
|
|
</div>
|
|
@if($lieu->code)
|
|
<div class="px-6 py-4 grid grid-cols-3 gap-4 text-sm">
|
|
<dt class="font-medium text-gray-500">Code</dt>
|
|
<dd class="col-span-2 text-gray-900">{{ $lieu->code }}</dd>
|
|
</div>
|
|
@endif
|
|
<div class="px-6 py-4 grid grid-cols-3 gap-4 text-sm">
|
|
<dt class="font-medium text-gray-500">Lieu parent</dt>
|
|
<dd class="col-span-2">
|
|
@if($lieu->parent)
|
|
<a href="{{ route('lieux.show', $lieu->parent) }}" class="text-indigo-600 hover:underline">
|
|
{{ $lieu->parent->nom_long ?? $lieu->parent->nom }}
|
|
</a>
|
|
@else
|
|
<span class="text-gray-400">Lieu racine</span>
|
|
@endif
|
|
</dd>
|
|
</div>
|
|
@if($lieu->latitude && $lieu->longitude)
|
|
<div class="px-6 py-4 grid grid-cols-3 gap-4 text-sm">
|
|
<dt class="font-medium text-gray-500">Coordonnées</dt>
|
|
<dd class="col-span-2 text-gray-900">{{ $lieu->latitude }}, {{ $lieu->longitude }}</dd>
|
|
</div>
|
|
@endif
|
|
@if($lieu->note)
|
|
<div class="px-6 py-4 grid grid-cols-3 gap-4 text-sm">
|
|
<dt class="font-medium text-gray-500">Note</dt>
|
|
<dd class="col-span-2 text-gray-900 whitespace-pre-line">{{ $lieu->note }}</dd>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
|
|
{{-- Enfants --}}
|
|
@if($lieu->enfants->isNotEmpty())
|
|
<div class="bg-white shadow rounded-lg overflow-hidden">
|
|
<div class="px-6 py-4 border-b border-gray-200">
|
|
<h3 class="font-medium text-gray-900">Subdivisions ({{ $lieu->enfants->count() }})</h3>
|
|
</div>
|
|
<ul class="divide-y divide-gray-100">
|
|
@foreach($lieu->enfants->sortBy('nom') as $enfant)
|
|
<li class="px-6 py-3">
|
|
<a href="{{ route('lieux.show', $enfant) }}" class="text-indigo-600 hover:underline">
|
|
{{ $enfant->nom }}
|
|
</a>
|
|
@if($enfant->code)
|
|
<span class="ml-2 text-xs text-gray-400">({{ $enfant->code }})</span>
|
|
@endif
|
|
</li>
|
|
@endforeach
|
|
</ul>
|
|
</div>
|
|
@endif
|
|
|
|
<div>
|
|
<a href="{{ route('lieux.index') }}" class="text-sm text-indigo-600 hover:underline">← Retour à la liste</a>
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|