Files
mesreleves-php/resources/views/sources/_form.blade.php
T
yann64 f530f55577 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>
2026-06-04 19:46:22 +02:00

116 lines
6.4 KiB
PHP

<div class="space-y-5">
<div>
<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 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 dark:text-gray-300">Description</label>
<textarea id="description" name="description" rows="3"
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 dark:text-gray-300">Section</label>
<select id="section_id" name="section_id"
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' : '' }}>
{{ $sec->nom }}
</option>
@endforeach
</select>
@error('section_id') <p class="mt-1 text-sm text-red-600">{{ $message }}</p> @enderror
</div>
@endif
<div class="grid grid-cols-2 gap-4">
<div>
<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 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' : '' }}>
{{ $st->nom }}
</option>
@endforeach
</select>
@error('source_type_id') <p class="mt-1 text-sm text-red-600">{{ $message }}</p> @enderror
</div>
<div>
<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 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' : '' }}>
{{ $depot->nom }}
</option>
@endforeach
</select>
</div>
</div>
{{-- Lieu géographique couvert par la source --}}
@php
$lieuIdForm = old('lieu_id', $source?->lieu_id);
$lieuDispForm = '';
if ($lieuIdForm) {
$lieuObj = ($source?->lieu_id == $lieuIdForm && $source?->lieu)
? $source->lieu
: \App\Models\Lieu::find($lieuIdForm, ['id', 'nom', 'nom_long']);
$lieuDispForm = $lieuObj?->nom_long ?? $lieuObj?->nom ?? '';
}
@endphp
<div>
<x-lieu-picker
name="lieu_id"
label="Lieu couvert"
:value="$lieuIdForm"
:display-value="$lieuDispForm"
placeholder="— Aucun lieu —"
/>
@error('lieu_id') <p class="mt-1 text-sm text-red-600">{{ $message }}</p> @enderror
</div>
{{-- 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 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 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 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 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 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 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 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 dark:border-gray-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
</div>
</div>
</div>