Mode sombre, option désactivation mises à jour, user-picker avec recherche

- Dark mode complet : darkMode:'class' Tailwind, sélecteur clair/sombre/auto
  dans la navigation (mémorisé dans localStorage, sans flash au chargement) ;
  53 vues et 8 composants Breeze mis à jour avec classes dark:
- Composant user-picker : fenêtre modale avec recherche temps réel (nom/email)
  remplace les <select> d'ajout de membres dans sections et sources
- Paramètres : option "Désactiver la vérification automatique des mises à jour"
  (case à cochage auto-soumise, route POST parametres/updates)
- Panneau "Paramètres généraux" remonté en tête de la page de paramètres
- README recentré sur l'installation manuelle hébergement PHP+MySQL
- VERSION 1.0.1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-04 19:46:22 +02:00
parent 07ab2a7063
commit f530f55577
73 changed files with 1288 additions and 913 deletions
+18 -18
View File
@@ -1,23 +1,23 @@
<div class="space-y-5">
<div>
<label for="nom" class="block text-sm font-medium text-gray-700">Nom <span class="text-red-500">*</span></label>
<label for="nom" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Nom <span class="text-red-500">*</span></label>
<input type="text" id="nom" name="nom" value="{{ old('nom', $source?->nom) }}" required
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 @error('nom') border-red-500 @enderror">
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 @error('nom') border-red-500 @enderror">
@error('nom') <p class="mt-1 text-sm text-red-600">{{ $message }}</p> @enderror
</div>
<div>
<label for="description" class="block text-sm font-medium text-gray-700">Description</label>
<label for="description" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Description</label>
<textarea id="description" name="description" rows="3"
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">{{ old('description', $source?->description) }}</textarea>
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">{{ old('description', $source?->description) }}</textarea>
</div>
{{-- Section propriétaire --}}
@if($sections->isNotEmpty())
<div>
<label for="section_id" class="block text-sm font-medium text-gray-700">Section</label>
<label for="section_id" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Section</label>
<select id="section_id" name="section_id"
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 text-sm">
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 text-sm">
<option value=""> Aucune (globale) </option>
@foreach($sections as $sec)
<option value="{{ $sec->id }}" {{ old('section_id', $source?->section_id) == $sec->id ? 'selected' : '' }}>
@@ -31,9 +31,9 @@
<div class="grid grid-cols-2 gap-4">
<div>
<label for="source_type_id" class="block text-sm font-medium text-gray-700">Type de source <span class="text-red-500">*</span></label>
<label for="source_type_id" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Type de source <span class="text-red-500">*</span></label>
<select id="source_type_id" name="source_type_id" required
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 @error('source_type_id') border-red-500 @enderror">
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 @error('source_type_id') border-red-500 @enderror">
<option value=""> Choisir </option>
@foreach($sourceTypes as $st)
<option value="{{ $st->id }}" {{ old('source_type_id', $source?->source_type_id) == $st->id ? 'selected' : '' }}>
@@ -45,9 +45,9 @@
</div>
<div>
<label for="depot_id" class="block text-sm font-medium text-gray-700">Dépôt d'archives</label>
<label for="depot_id" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Dépôt d'archives</label>
<select id="depot_id" name="depot_id"
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
<option value=""> Aucun </option>
@foreach($depots as $depot)
<option value="{{ $depot->id }}" {{ old('depot_id', $source?->depot_id) == $depot->id ? 'selected' : '' }}>
@@ -83,33 +83,33 @@
{{-- Période couverte --}}
<div class="grid grid-cols-2 gap-4">
<div>
<label for="annee_debut" class="block text-sm font-medium text-gray-700">Année de début</label>
<label for="annee_debut" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Année de début</label>
<input type="number" id="annee_debut" name="annee_debut"
value="{{ old('annee_debut', $source?->annee_debut) }}"
min="1000" max="2100" placeholder="ex : 1820"
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 @error('annee_debut') border-red-500 @enderror">
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 @error('annee_debut') border-red-500 @enderror">
@error('annee_debut') <p class="mt-1 text-sm text-red-600">{{ $message }}</p> @enderror
</div>
<div>
<label for="annee_fin" class="block text-sm font-medium text-gray-700">Année de fin</label>
<label for="annee_fin" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Année de fin</label>
<input type="number" id="annee_fin" name="annee_fin"
value="{{ old('annee_fin', $source?->annee_fin) }}"
min="1000" max="2100" placeholder="ex : 1870"
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 @error('annee_fin') border-red-500 @enderror">
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 @error('annee_fin') border-red-500 @enderror">
@error('annee_fin') <p class="mt-1 text-sm text-red-600">{{ $message }}</p> @enderror
</div>
</div>
<div class="grid grid-cols-2 gap-4">
<div>
<label for="cote" class="block text-sm font-medium text-gray-700">Cote</label>
<label for="cote" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Cote</label>
<input type="text" id="cote" name="cote" value="{{ old('cote', $source?->cote) }}"
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
</div>
<div>
<label for="auteur" class="block text-sm font-medium text-gray-700">Auteur</label>
<label for="auteur" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Auteur</label>
<input type="text" id="auteur" name="auteur" value="{{ old('auteur', $source?->auteur) }}"
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
</div>
</div>
</div>
+3 -3
View File
@@ -1,13 +1,13 @@
<x-app-layout>
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800">Nouvelle source</h2></x-slot>
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Nouvelle source</h2></x-slot>
<div class="py-8 max-w-2xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="bg-white shadow rounded-lg p-6">
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6">
<form method="POST" action="{{ route('sources.store') }}">
@csrf
@include('sources._form', ['source' => null])
<div class="mt-6 flex gap-4">
<button type="submit" class="px-5 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700">Créer</button>
<a href="{{ route('sources.index') }}" class="text-sm text-gray-500 self-center hover:text-gray-700">Annuler</a>
<a href="{{ route('sources.index') }}" class="text-sm text-gray-500 dark:text-gray-400 self-center hover:text-gray-700 dark:hover:text-gray-300">Annuler</a>
</div>
</form>
</div>
+3 -3
View File
@@ -1,13 +1,13 @@
<x-app-layout>
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800">Modifier : {{ $source->nom }}</h2></x-slot>
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Modifier : {{ $source->nom }}</h2></x-slot>
<div class="py-8 max-w-2xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="bg-white shadow rounded-lg p-6">
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6">
<form method="POST" action="{{ route('sources.update', $source) }}">
@csrf @method('PUT')
@include('sources._form', ['source' => $source])
<div class="mt-6 flex gap-4">
<button type="submit" class="px-5 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700">Enregistrer</button>
<a href="{{ route('sources.show', $source) }}" class="text-sm text-gray-500 self-center hover:text-gray-700">Annuler</a>
<a href="{{ route('sources.show', $source) }}" class="text-sm text-gray-500 dark:text-gray-400 self-center hover:text-gray-700 dark:hover:text-gray-300">Annuler</a>
</div>
</form>
</div>
+38 -38
View File
@@ -1,7 +1,7 @@
<x-app-layout>
<x-slot name="header">
<div class="flex items-center justify-between">
<h2 class="text-xl font-semibold text-gray-800">Sources</h2>
<h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Sources</h2>
@can('create', App\Models\Source::class)
<a href="{{ route('sources.create') }}"
class="px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700">+ Nouvelle source</a>
@@ -11,22 +11,22 @@
<div class="py-8 max-w-7xl 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>
<div class="p-4 bg-green-50 dark:bg-green-900/30 border border-green-200 dark:border-green-700 text-green-800 dark:text-green-200 rounded-md">{{ session('success') }}</div>
@endif
{{-- Filtres --}}
@php
$hasFilters = request()->anyFilled(['status', 'source_type_id', 'lieu_id', 'annee_debut', 'annee_fin']);
@endphp
<div class="bg-white shadow rounded-lg p-5">
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-5">
<form method="GET" action="{{ route('sources.index') }}">
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
{{-- Statut --}}
<div>
<label class="block text-xs font-medium text-gray-600 mb-1">Statut</label>
<label class="block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1">Statut</label>
<select name="status"
class="block w-full rounded-md border-gray-300 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
class="block w-full rounded-md border-gray-300 dark:border-gray-600 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
<option value=""> Tous </option>
@foreach(\App\Enums\SourceStatus::cases() as $s)
<option value="{{ $s->value }}" {{ request('status') === $s->value ? 'selected' : '' }}>
@@ -38,9 +38,9 @@
{{-- Type de source --}}
<div>
<label class="block text-xs font-medium text-gray-600 mb-1">Type de source</label>
<label class="block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1">Type de source</label>
<select name="source_type_id"
class="block w-full rounded-md border-gray-300 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
class="block w-full rounded-md border-gray-300 dark:border-gray-600 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
<option value=""> Tous </option>
@foreach($sourceTypes as $st)
<option value="{{ $st->id }}" {{ request('source_type_id') == $st->id ? 'selected' : '' }}>
@@ -52,18 +52,18 @@
{{-- Année de début --}}
<div>
<label class="block text-xs font-medium text-gray-600 mb-1">Période de</label>
<label class="block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1">Période de</label>
<input type="number" name="annee_debut" value="{{ request('annee_debut') }}"
min="1000" max="2100" placeholder="ex : 1820"
class="block w-full rounded-md border-gray-300 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
class="block w-full rounded-md border-gray-300 dark:border-gray-600 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
</div>
{{-- Année de fin --}}
<div>
<label class="block text-xs font-medium text-gray-600 mb-1">Période à</label>
<label class="block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1">Période à</label>
<input type="number" name="annee_fin" value="{{ request('annee_fin') }}"
min="1000" max="2100" placeholder="ex : 1870"
class="block w-full rounded-md border-gray-300 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
class="block w-full rounded-md border-gray-300 dark:border-gray-600 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
</div>
</div>
@@ -85,10 +85,10 @@
</button>
@if($hasFilters)
<a href="{{ route('sources.index') }}"
class="px-4 py-2 border border-gray-300 text-gray-600 text-sm rounded-md hover:bg-gray-50">
class="px-4 py-2 border border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-400 text-sm rounded-md hover:bg-gray-50 dark:hover:bg-gray-700">
Effacer les filtres
</a>
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-xs bg-indigo-100 text-indigo-700">
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-xs bg-indigo-100 dark:bg-indigo-900/50 text-indigo-700">
filtres actifs
</span>
@endif
@@ -97,30 +97,30 @@
</div>
{{-- Tableau --}}
<div class="bg-white shadow rounded-lg overflow-hidden">
<table class="min-w-full divide-y divide-gray-200 text-sm">
<thead class="bg-gray-50">
<div class="bg-white dark:bg-gray-800 shadow rounded-lg overflow-hidden">
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 text-sm">
<thead class="bg-gray-50 dark:bg-gray-700">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Nom</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Type</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Statut</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Lieu</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Période</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Relevés</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Dépôt</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Nom</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Type</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Statut</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Lieu</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Période</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Relevés</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Dépôt</th>
<th class="px-6 py-3"></th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
<tbody class="divide-y divide-gray-200 dark:divide-gray-700">
@forelse($sources as $source)
@php
$statusColors = [
'a_faire' => 'bg-gray-100 text-gray-600',
'en_cours' => 'bg-blue-100 text-blue-700',
'a_valider' => 'bg-yellow-100 text-yellow-700',
'termine' => 'bg-green-100 text-green-700',
'a_faire' => 'bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400',
'en_cours' => 'bg-blue-100 dark:bg-blue-900/50 text-blue-700',
'a_valider' => 'bg-yellow-100 dark:bg-yellow-900/50 text-yellow-700',
'termine' => 'bg-green-100 dark:bg-green-900/50 text-green-700',
];
$color = $statusColors[$source->status->value] ?? 'bg-gray-100 text-gray-600';
$color = $statusColors[$source->status->value] ?? 'bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400';
$periode = match(true) {
$source->annee_debut && $source->annee_fin => $source->annee_debut . ' ' . $source->annee_fin,
(bool)$source->annee_debut => 'depuis ' . $source->annee_debut,
@@ -128,32 +128,32 @@
default => '—',
};
@endphp
<tr class="hover:bg-gray-50">
<tr class="hover:bg-gray-50 dark:hover:bg-gray-700">
<td class="px-6 py-4 font-medium">
<a href="{{ route('sources.show', $source) }}" class="text-indigo-600 hover:underline">{{ $source->nom }}</a>
@if($source->cote) <span class="ml-2 text-xs text-gray-400">{{ $source->cote }}</span> @endif
@if($source->cote) <span class="ml-2 text-xs text-gray-400 dark:text-gray-500">{{ $source->cote }}</span> @endif
</td>
<td class="px-6 py-4 text-gray-500">{{ $source->sourceType->nom }}</td>
<td class="px-6 py-4 text-gray-500 dark:text-gray-400">{{ $source->sourceType->nom }}</td>
<td class="px-6 py-4">
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium {{ $color }}">
{{ $source->status->label() }}
</span>
</td>
<td class="px-6 py-4 text-gray-500 max-w-[180px] truncate" title="{{ $source->lieu?->nom_long ?? $source->lieu?->nom }}">
<td class="px-6 py-4 text-gray-500 dark:text-gray-400 max-w-[180px] truncate" title="{{ $source->lieu?->nom_long ?? $source->lieu?->nom }}">
{{ $source->lieu?->nom ?? '—' }}
</td>
<td class="px-6 py-4 text-gray-500 whitespace-nowrap">{{ $periode }}</td>
<td class="px-6 py-4 text-gray-500">{{ $source->releves_count }}</td>
<td class="px-6 py-4 text-gray-500">{{ $source->depot?->nom ?? '—' }}</td>
<td class="px-6 py-4 text-gray-500 dark:text-gray-400 whitespace-nowrap">{{ $periode }}</td>
<td class="px-6 py-4 text-gray-500 dark:text-gray-400">{{ $source->releves_count }}</td>
<td class="px-6 py-4 text-gray-500 dark:text-gray-400">{{ $source->depot?->nom ?? '—' }}</td>
<td class="px-6 py-4 text-right text-sm space-x-3">
@can('update', $source)
<a href="{{ route('sources.edit', $source) }}" class="text-gray-600 hover:text-indigo-600">Modifier</a>
<a href="{{ route('sources.edit', $source) }}" class="text-gray-600 dark:text-gray-400 hover:text-indigo-600">Modifier</a>
@endcan
</td>
</tr>
@empty
<tr>
<td colspan="8" class="px-6 py-10 text-center text-gray-400">
<td colspan="8" class="px-6 py-10 text-center text-gray-400 dark:text-gray-500">
@if($hasFilters) Aucune source ne correspond aux filtres.
@else Aucune source disponible. @endif
</td>
+32 -33
View File
@@ -2,15 +2,15 @@
<x-slot name="header">
<div class="flex items-center justify-between">
<div>
<h2 class="text-xl font-semibold text-gray-800">{{ $source->nom }}</h2>
<h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">{{ $source->nom }}</h2>
@if($source->cote)
<p class="text-sm text-gray-500 mt-0.5">Cote : {{ $source->cote }}</p>
<p class="text-sm text-gray-500 dark:text-gray-400 mt-0.5">Cote : {{ $source->cote }}</p>
@endif
</div>
<div class="flex items-center gap-3">
@can('update', $source)
<a href="{{ route('sources.edit', $source) }}"
class="px-4 py-2 bg-white border border-gray-300 text-gray-700 text-sm rounded-md hover:bg-gray-50">Modifier</a>
class="px-4 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 text-sm rounded-md hover:bg-gray-50 dark:hover:bg-gray-700">Modifier</a>
@endcan
@can('delete', $source)
<form method="POST" action="{{ route('sources.destroy', $source) }}"
@@ -26,7 +26,7 @@
<div class="py-8 max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 space-y-6">
@foreach(['success','error'] as $flash)
@if(session($flash))
<div class="p-4 rounded-md {{ $flash === 'success' ? 'bg-green-50 border border-green-200 text-green-800' : 'bg-red-50 border border-red-200 text-red-800' }}">
<div class="p-4 rounded-md {{ $flash === 'success' ? 'bg-green-50 dark:bg-green-900/30 border border-green-200 dark:border-green-700 text-green-800 dark:text-green-200' : 'bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-700 text-red-800 dark:text-red-200' }}">
{{ session($flash) }}
</div>
@endif
@@ -34,33 +34,33 @@
<div class="grid grid-cols-3 gap-6">
{{-- Fiche source --}}
<div class="col-span-2 bg-white shadow rounded-lg divide-y divide-gray-100 text-sm">
<div class="col-span-2 bg-white dark:bg-gray-800 shadow rounded-lg divide-y divide-gray-100 dark:divide-gray-700 text-sm">
@foreach([
['Type', $source->sourceType->nom],
['Dépôt', $source->depot?->nom ?? '—'],
['Auteur', $source->auteur ?? '—'],
] as [$label, $val])
<div class="px-6 py-4 grid grid-cols-3 gap-4">
<dt class="font-medium text-gray-500">{{ $label }}</dt>
<dd class="col-span-2 text-gray-900">{{ $val }}</dd>
<dt class="font-medium text-gray-500 dark:text-gray-400">{{ $label }}</dt>
<dd class="col-span-2 text-gray-900 dark:text-white">{{ $val }}</dd>
</div>
@endforeach
@if($source->description)
<div class="px-6 py-4 grid grid-cols-3 gap-4">
<dt class="font-medium text-gray-500">Description</dt>
<dd class="col-span-2 text-gray-900 whitespace-pre-line">{{ $source->description }}</dd>
<dt class="font-medium text-gray-500 dark:text-gray-400">Description</dt>
<dd class="col-span-2 text-gray-900 dark:text-white whitespace-pre-line">{{ $source->description }}</dd>
</div>
@endif
</div>
{{-- Statut + transitions --}}
<div class="bg-white shadow rounded-lg p-6 space-y-4">
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 space-y-4">
@php
$statusColors = ['a_faire'=>'gray','en_cours'=>'blue','a_valider'=>'yellow','termine'=>'green'];
$color = $statusColors[$source->status->value] ?? 'gray';
@endphp
<div>
<p class="text-xs font-medium text-gray-500 uppercase mb-2">Statut</p>
<p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase mb-2">Statut</p>
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-{{ $color }}-100 text-{{ $color }}-700">
{{ $source->status->label() }}
</span>
@@ -70,14 +70,14 @@
@php $transitions = $source->status->transitions(); @endphp
@if(count($transitions))
<div class="space-y-2">
<p class="text-xs font-medium text-gray-500 uppercase">Changer le statut</p>
<p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Changer le statut</p>
@foreach($transitions as $next)
@if($source->canTransitionTo($next, auth()->user()))
<form method="POST" action="{{ route('sources.transition', $source) }}">
@csrf
<input type="hidden" name="status" value="{{ $next->value }}">
<button type="submit"
class="w-full text-left px-3 py-2 text-sm border border-gray-200 rounded-md hover:bg-gray-50 hover:border-indigo-300 transition-colors">
class="w-full text-left px-3 py-2 text-sm border border-gray-200 dark:border-gray-700 rounded-md hover:bg-gray-50 dark:hover:bg-gray-700 hover:border-indigo-300 transition-colors">
{{ $next->label() }}
</button>
</form>
@@ -91,17 +91,17 @@
{{-- Membres assignés --}}
@can('assignMembre', $source)
<div class="bg-white shadow rounded-lg overflow-hidden">
<div class="px-6 py-4 border-b border-gray-200 font-medium text-gray-900">
<div class="bg-white dark:bg-gray-800 shadow rounded-lg overflow-hidden">
<div class="px-6 py-4 border-b border-gray-200 dark:border-gray-700 font-medium text-gray-900 dark:text-white">
Membres assignés ({{ $source->membres->count() }})
</div>
@if($source->membres->isNotEmpty())
<table class="min-w-full divide-y divide-gray-200 text-sm">
<tbody class="divide-y divide-gray-200">
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700 text-sm">
<tbody class="divide-y divide-gray-200 dark:divide-gray-700">
@foreach($source->membres as $membre)
<tr>
<td class="px-6 py-3">{{ $membre->name }}</td>
<td class="px-6 py-3 text-gray-500">{{ $membre->email }}</td>
<td class="px-6 py-3 text-gray-500 dark:text-gray-400">{{ $membre->email }}</td>
<td class="px-6 py-3 text-right">
<form method="POST" action="{{ route('sources.membres.remove', [$source, $membre]) }}"
x-data @submit.prevent="if(confirm('Retirer ce membre ?')) $el.submit()">
@@ -114,27 +114,26 @@
</tbody>
</table>
@endif
<div class="px-6 py-4 bg-gray-50 border-t border-gray-200">
<form method="POST" action="{{ route('sources.membres.add', $source) }}" class="flex gap-3 items-end">
<div class="px-6 py-4 bg-gray-50 dark:bg-gray-700 border-t border-gray-200 dark:border-gray-700">
<form method="POST" action="{{ route('sources.membres.add', $source) }}"
@submit.prevent="if ($el.querySelector('[name=user_id]').value) $el.submit()">
@csrf
<div class="flex-1">
<label class="block text-xs font-medium text-gray-600 mb-1">Ajouter un membre</label>
<select name="user_id" class="block w-full rounded-md border-gray-300 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
@foreach($availableUsers as $u)
<option value="{{ $u->id }}">{{ $u->name }} ({{ $u->email }})</option>
@endforeach
</select>
<div class="flex flex-col sm:flex-row gap-3 items-stretch sm:items-end">
<div class="flex-1">
<label class="block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1">Ajouter un membre</label>
<x-user-picker :users="$availableUsers" placeholder="Rechercher un membre à assigner…" required />
</div>
<button type="submit" class="px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 shrink-0">Assigner</button>
</div>
<button type="submit" class="px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700">Assigner</button>
</form>
</div>
</div>
@endcan
{{-- Liste des relevés (aperçu) --}}
<div class="bg-white shadow rounded-lg overflow-hidden">
<div class="px-6 py-4 border-b border-gray-200 flex items-center justify-between">
<h3 class="font-medium text-gray-900">Relevés ({{ $source->releves->count() }})</h3>
<div class="bg-white dark:bg-gray-800 shadow rounded-lg overflow-hidden">
<div class="px-6 py-4 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between">
<h3 class="font-medium text-gray-900 dark:text-white">Relevés ({{ $source->releves->count() }})</h3>
@can('create', [App\Models\Releve::class, $source])
<a href="{{ route('sources.releves.create', $source) }}"
class="px-3 py-1.5 bg-indigo-600 text-white text-xs rounded-md hover:bg-indigo-700">
@@ -143,9 +142,9 @@
@endcan
</div>
@if($source->releves->isEmpty())
<p class="px-6 py-8 text-center text-gray-400 text-sm">Aucun relevé pour cette source.</p>
<p class="px-6 py-8 text-center text-gray-400 dark:text-gray-500 text-sm">Aucun relevé pour cette source.</p>
@else
<p class="px-6 py-4 text-sm text-gray-500">
<p class="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">
<a href="{{ route('sources.releves.index', $source) }}" class="text-indigo-600 hover:underline">
Voir les {{ $source->releves->count() }} relevé(s)
</a>