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:
@@ -1,20 +1,20 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<h2 class="text-xl font-semibold text-gray-800">Tableau de bord — Administration</h2>
|
||||
<h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Tableau de bord — Administration</h2>
|
||||
</x-slot>
|
||||
|
||||
<div class="py-8 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 space-y-8">
|
||||
|
||||
{{-- Bandeau mise à jour disponible --}}
|
||||
@if($updateAvailable)
|
||||
<div class="bg-indigo-50 border border-indigo-300 rounded-xl p-4 flex items-center justify-between gap-4">
|
||||
<div class="bg-indigo-50 dark:bg-indigo-900/30 border border-indigo-300 rounded-xl p-4 flex items-center justify-between gap-4">
|
||||
<div class="flex items-center gap-3">
|
||||
<svg class="w-5 h-5 text-indigo-500 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<svg class="w-5 h-5 text-indigo-500 dark:text-indigo-400 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"/>
|
||||
</svg>
|
||||
<div>
|
||||
<p class="text-sm font-semibold text-indigo-800">
|
||||
<p class="text-sm font-semibold text-indigo-800 dark:text-indigo-200">
|
||||
Mise à jour disponible : v{{ $latestRelease['version'] }}
|
||||
<span class="ml-2 font-normal text-indigo-600">(installé : v{{ $installedVersion }})</span>
|
||||
</p>
|
||||
@@ -35,10 +35,10 @@
|
||||
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
|
||||
@php
|
||||
$statusCards = [
|
||||
['label' => 'À faire', 'key' => 'a_faire', 'color' => 'bg-gray-50 border-gray-200 text-gray-700'],
|
||||
['label' => 'À faire', 'key' => 'a_faire', 'color' => 'bg-gray-50 dark:bg-gray-700 border-gray-200 dark:border-gray-700 text-gray-700 dark:text-gray-300'],
|
||||
['label' => 'En cours', 'key' => 'en_cours', 'color' => 'bg-blue-50 border-blue-200 text-blue-700'],
|
||||
['label' => 'À valider', 'key' => 'a_valider', 'color' => 'bg-yellow-50 border-yellow-200 text-yellow-700'],
|
||||
['label' => 'Terminé', 'key' => 'termine', 'color' => 'bg-green-50 border-green-200 text-green-700'],
|
||||
['label' => 'À valider', 'key' => 'a_valider', 'color' => 'bg-yellow-50 border-yellow-200 dark:border-yellow-700 text-yellow-700'],
|
||||
['label' => 'Terminé', 'key' => 'termine', 'color' => 'bg-green-50 dark:bg-green-900/30 border-green-200 dark:border-green-700 text-green-700'],
|
||||
];
|
||||
@endphp
|
||||
@foreach($statusCards as $card)
|
||||
@@ -53,19 +53,19 @@
|
||||
|
||||
{{-- Ligne de métriques secondaires --}}
|
||||
<div class="grid grid-cols-3 gap-4">
|
||||
<div class="bg-white border border-gray-200 rounded-xl p-5 flex items-center gap-4">
|
||||
<div class="p-3 bg-indigo-100 rounded-lg">
|
||||
<div class="bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl p-5 flex items-center gap-4">
|
||||
<div class="p-3 bg-indigo-100 dark:bg-indigo-900/50 rounded-lg">
|
||||
<svg class="w-6 h-6 text-indigo-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-2xl font-bold text-gray-900">{{ number_format($totalReleves) }}</p>
|
||||
<p class="text-sm text-gray-500">relevé{{ $totalReleves > 1 ? 's' : '' }} saisi{{ $totalReleves > 1 ? 's' : '' }}</p>
|
||||
<p class="text-2xl font-bold text-gray-900 dark:text-white">{{ number_format($totalReleves) }}</p>
|
||||
<p class="text-sm text-gray-500 dark:text-gray-400">relevé{{ $totalReleves > 1 ? 's' : '' }} saisi{{ $totalReleves > 1 ? 's' : '' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white border border-gray-200 rounded-xl p-5 flex items-center gap-4">
|
||||
<div class="bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl p-5 flex items-center gap-4">
|
||||
<div class="p-3 bg-purple-100 rounded-lg">
|
||||
<svg class="w-6 h-6 text-purple-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
@@ -73,18 +73,18 @@
|
||||
</svg>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-2xl font-bold text-gray-900">{{ $totalUsers }}</p>
|
||||
<p class="text-sm text-gray-500">utilisateur{{ $totalUsers > 1 ? 's' : '' }}</p>
|
||||
<p class="text-2xl font-bold text-gray-900 dark:text-white">{{ $totalUsers }}</p>
|
||||
<p class="text-sm text-gray-500 dark:text-gray-400">utilisateur{{ $totalUsers > 1 ? 's' : '' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white border border-gray-200 rounded-xl p-5">
|
||||
<p class="text-xs font-medium text-gray-500 uppercase mb-3">Répartition des rôles</p>
|
||||
<div class="bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl p-5">
|
||||
<p class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase mb-3">Répartition des rôles</p>
|
||||
<div class="space-y-2">
|
||||
@foreach(\App\Enums\UserRole::cases() as $role)
|
||||
@php $count = (int)($usersByRole[$role->value] ?? 0); @endphp
|
||||
<div class="flex items-center justify-between text-sm">
|
||||
<span class="text-gray-600">{{ $role->label() }}</span>
|
||||
<span class="font-semibold text-gray-900">{{ $count }}</span>
|
||||
<span class="text-gray-600 dark:text-gray-400">{{ $role->label() }}</span>
|
||||
<span class="font-semibold text-gray-900 dark:text-white">{{ $count }}</span>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@@ -93,16 +93,16 @@
|
||||
|
||||
{{-- Activité mensuelle (6 derniers mois) --}}
|
||||
@if($activiteMensuelle->isNotEmpty())
|
||||
<div class="bg-white border border-gray-200 rounded-xl p-6">
|
||||
<h3 class="text-sm font-semibold text-gray-700 uppercase tracking-wide mb-4">Relevés saisis — 6 derniers mois</h3>
|
||||
<div class="bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl p-6">
|
||||
<h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300 uppercase tracking-wide mb-4">Relevés saisis — 6 derniers mois</h3>
|
||||
@php $maxReleves = $activiteMensuelle->max('total') ?: 1; @endphp
|
||||
<div class="flex items-end gap-3 h-24">
|
||||
@foreach($activiteMensuelle as $mois)
|
||||
@php $h = max(4, round(($mois->total / $maxReleves) * 96)); @endphp
|
||||
<div class="flex-1 flex flex-col items-center gap-1">
|
||||
<span class="text-xs text-gray-500">{{ $mois->total }}</span>
|
||||
<div class="w-full bg-indigo-500 rounded-t" style="height: {{ $h }}px" title="{{ $mois->mois }} : {{ $mois->total }}"></div>
|
||||
<span class="text-xs text-gray-400 whitespace-nowrap">{{ $mois->mois }}</span>
|
||||
<span class="text-xs text-gray-500 dark:text-gray-400">{{ $mois->total }}</span>
|
||||
<div class="w-full bg-indigo-50 dark:bg-indigo-900/300 rounded-t" style="height: {{ $h }}px" title="{{ $mois->mois }} : {{ $mois->total }}"></div>
|
||||
<span class="text-xs text-gray-400 dark:text-gray-500 whitespace-nowrap">{{ $mois->mois }}</span>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@@ -118,8 +118,8 @@
|
||||
['label' => 'Types de lieux', 'route' => 'admin.lieu-types.index', 'icon' => 'M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z'],
|
||||
] as $link)
|
||||
<a href="{{ route($link['route']) }}"
|
||||
class="flex items-center gap-3 px-4 py-3 bg-white border border-gray-200 rounded-xl hover:border-indigo-300 hover:shadow-sm transition-all text-sm text-gray-700 font-medium">
|
||||
<svg class="w-5 h-5 text-gray-400 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
class="flex items-center gap-3 px-4 py-3 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl hover:border-indigo-300 hover:shadow-sm transition-all text-sm text-gray-700 dark:text-gray-300 font-medium">
|
||||
<svg class="w-5 h-5 text-gray-400 dark:text-gray-500 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="{{ $link['icon'] }}"/>
|
||||
</svg>
|
||||
{{ $link['label'] }}
|
||||
@@ -130,57 +130,57 @@
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
|
||||
{{-- Sources à valider --}}
|
||||
<div class="bg-white border border-gray-200 rounded-xl p-6">
|
||||
<div class="bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl p-6">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<h3 class="text-sm font-semibold text-gray-700 uppercase tracking-wide">En attente de validation</h3>
|
||||
<h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300 uppercase tracking-wide">En attente de validation</h3>
|
||||
<a href="{{ route('sources.index', ['status' => 'a_valider']) }}"
|
||||
class="text-xs text-indigo-600 hover:underline">Voir tout</a>
|
||||
</div>
|
||||
@forelse($sourcesAValider as $source)
|
||||
<div class="flex items-center justify-between py-2 border-b border-gray-100 last:border-0">
|
||||
<div class="flex items-center justify-between py-2 border-b border-gray-100 dark:border-gray-700 last:border-0">
|
||||
<div>
|
||||
<a href="{{ route('sources.show', $source) }}"
|
||||
class="text-sm font-medium text-indigo-600 hover:underline">{{ $source->nom }}</a>
|
||||
<p class="text-xs text-gray-400">{{ $source->sourceType->nom }}</p>
|
||||
<p class="text-xs text-gray-400 dark:text-gray-500">{{ $source->sourceType->nom }}</p>
|
||||
</div>
|
||||
<span class="text-xs text-gray-400 whitespace-nowrap">
|
||||
<span class="text-xs text-gray-400 dark:text-gray-500 whitespace-nowrap">
|
||||
{{ $source->updated_at->diffForHumans() }}
|
||||
</span>
|
||||
</div>
|
||||
@empty
|
||||
<p class="text-sm text-gray-400 py-4 text-center">Aucune source en attente.</p>
|
||||
<p class="text-sm text-gray-400 dark:text-gray-500 py-4 text-center">Aucune source en attente.</p>
|
||||
@endforelse
|
||||
</div>
|
||||
|
||||
{{-- Relevés récents --}}
|
||||
<div class="bg-white border border-gray-200 rounded-xl p-6">
|
||||
<div class="bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl p-6">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<h3 class="text-sm font-semibold text-gray-700 uppercase tracking-wide">Derniers relevés saisis</h3>
|
||||
<h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300 uppercase tracking-wide">Derniers relevés saisis</h3>
|
||||
<a href="{{ route('recherche') }}" class="text-xs text-indigo-600 hover:underline">Recherche</a>
|
||||
</div>
|
||||
@forelse($relevesRecents as $releve)
|
||||
<div class="flex items-center justify-between py-2 border-b border-gray-100 last:border-0">
|
||||
<div class="flex items-center justify-between py-2 border-b border-gray-100 dark:border-gray-700 last:border-0">
|
||||
<div class="min-w-0">
|
||||
<a href="{{ route('releves.show', $releve) }}"
|
||||
class="text-sm font-medium text-gray-900 hover:text-indigo-600 truncate block">
|
||||
class="text-sm font-medium text-gray-900 dark:text-white hover:text-indigo-600 truncate block">
|
||||
{{ $releve->nom ?? '—' }}
|
||||
@if($releve->prenom) {{ $releve->prenom }} @endif
|
||||
</a>
|
||||
<p class="text-xs text-gray-400">
|
||||
<p class="text-xs text-gray-400 dark:text-gray-500">
|
||||
{{ $releve->source->nom }} · {{ $releve->createur?->name ?? '?' }}
|
||||
</p>
|
||||
</div>
|
||||
<span class="text-xs text-gray-400 whitespace-nowrap ml-3">
|
||||
<span class="text-xs text-gray-400 dark:text-gray-500 whitespace-nowrap ml-3">
|
||||
{{ $releve->created_at->diffForHumans() }}
|
||||
</span>
|
||||
</div>
|
||||
@empty
|
||||
<p class="text-sm text-gray-400 py-4 text-center">Aucun relevé pour l'instant.</p>
|
||||
<p class="text-sm text-gray-400 dark:text-gray-500 py-4 text-center">Aucun relevé pour l'instant.</p>
|
||||
@endforelse
|
||||
</div>
|
||||
</div>
|
||||
{{-- Version --}}
|
||||
<div class="flex items-center justify-end gap-2 text-xs text-gray-400 pt-2">
|
||||
<div class="flex items-center justify-end gap-2 text-xs text-gray-400 dark:text-gray-500 pt-2">
|
||||
<span>MesRelevés v{{ $installedVersion }}</span>
|
||||
@if(! $updateAvailable)
|
||||
<span class="inline-flex items-center gap-1 text-green-600">
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
<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', $depot?->nom) }}" required
|
||||
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">
|
||||
@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', $depot?->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', $depot?->description) }}</textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label for="adresse_postale" class="block text-sm font-medium text-gray-700">Adresse postale</label>
|
||||
<label for="adresse_postale" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Adresse postale</label>
|
||||
<input type="text" id="adresse_postale" name="adresse_postale" value="{{ old('adresse_postale', $depot?->adresse_postale) }}"
|
||||
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="url" class="block text-sm font-medium text-gray-700">Site internet</label>
|
||||
<label for="url" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Site internet</label>
|
||||
<input type="url" id="url" name="url" value="{{ old('url', $depot?->url) }}"
|
||||
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">
|
||||
@error('url') <p class="mt-1 text-sm text-red-600">{{ $message }}</p> @enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800">Nouveau dépôt</h2></x-slot>
|
||||
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Nouveau dépôt</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('admin.depots.store') }}">
|
||||
@csrf
|
||||
@include('admin.depots._form', ['depot' => 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('admin.depots.index') }}" class="text-sm text-gray-500 self-center hover:text-gray-700">Annuler</a>
|
||||
<a href="{{ route('admin.depots.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>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800">Modifier : {{ $depot->nom }}</h2></x-slot>
|
||||
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Modifier : {{ $depot->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('admin.depots.update', $depot) }}">
|
||||
@csrf @method('PUT')
|
||||
@include('admin.depots._form', ['depot' => $depot])
|
||||
<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('admin.depots.show', $depot) }}" class="text-sm text-gray-500 self-center hover:text-gray-700">Annuler</a>
|
||||
<a href="{{ route('admin.depots.show', $depot) }}" 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>
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<div class="flex items-center justify-between">
|
||||
<h2 class="text-xl font-semibold text-gray-800">Dépôts d'archives</h2>
|
||||
<h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Dépôts d'archives</h2>
|
||||
<a href="{{ route('admin.depots.create') }}" class="px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700">+ Nouveau dépôt</a>
|
||||
</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">
|
||||
@if(session('success')) <div class="mb-4 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
|
||||
@if(session('error')) <div class="mb-4 p-4 bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-700 text-red-800 dark:text-red-200 rounded-md">{{ session('error') }}</div> @endif
|
||||
<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">
|
||||
<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">Sources</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Site</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">Sources</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Site</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($depots as $depot)
|
||||
<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('admin.depots.show', $depot) }}" class="text-indigo-600 hover:underline">{{ $depot->nom }}</a>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500">{{ $depot->sources_count }}</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500">
|
||||
<td class="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">{{ $depot->sources_count }}</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">
|
||||
@if($depot->url) <a href="{{ $depot->url }}" target="_blank" class="text-indigo-600 hover:underline truncate max-w-xs block">{{ $depot->url }}</a>
|
||||
@else —
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-6 py-4 text-right text-sm space-x-3">
|
||||
<a href="{{ route('admin.depots.edit', $depot) }}" class="text-gray-600 hover:text-indigo-600">Modifier</a>
|
||||
<a href="{{ route('admin.depots.edit', $depot) }}" class="text-gray-600 dark:text-gray-400 hover:text-indigo-600">Modifier</a>
|
||||
<form method="POST" action="{{ route('admin.depots.destroy', $depot) }}" class="inline"
|
||||
x-data @submit.prevent="if(confirm('Supprimer ce dépôt ?')) $el.submit()">
|
||||
@csrf @method('DELETE')
|
||||
@@ -40,7 +40,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="4" class="px-6 py-10 text-center text-gray-400">Aucun dépôt.</td></tr>
|
||||
<tr><td colspan="4" class="px-6 py-10 text-center text-gray-400 dark:text-gray-500">Aucun dépôt.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<div class="flex items-center justify-between">
|
||||
<h2 class="text-xl font-semibold text-gray-800">{{ $depot->nom }}</h2>
|
||||
<h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">{{ $depot->nom }}</h2>
|
||||
<a href="{{ route('admin.depots.edit', $depot) }}" class="px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700">Modifier</a>
|
||||
</div>
|
||||
</x-slot>
|
||||
<div class="py-8 max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 space-y-6">
|
||||
<div class="bg-white shadow rounded-lg divide-y divide-gray-100 text-sm">
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg divide-y divide-gray-100 dark:divide-gray-700 text-sm">
|
||||
@if($depot->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">{{ $depot->description }}</dd></div>
|
||||
<div class="px-6 py-4 grid grid-cols-3 gap-4"><dt class="font-medium text-gray-500 dark:text-gray-400">Description</dt><dd class="col-span-2">{{ $depot->description }}</dd></div>
|
||||
@endif
|
||||
@if($depot->adresse_postale)
|
||||
<div class="px-6 py-4 grid grid-cols-3 gap-4"><dt class="font-medium text-gray-500">Adresse</dt><dd class="col-span-2">{{ $depot->adresse_postale }}</dd></div>
|
||||
<div class="px-6 py-4 grid grid-cols-3 gap-4"><dt class="font-medium text-gray-500 dark:text-gray-400">Adresse</dt><dd class="col-span-2">{{ $depot->adresse_postale }}</dd></div>
|
||||
@endif
|
||||
@if($depot->url)
|
||||
<div class="px-6 py-4 grid grid-cols-3 gap-4"><dt class="font-medium text-gray-500">Site</dt><dd class="col-span-2"><a href="{{ $depot->url }}" target="_blank" class="text-indigo-600 hover:underline">{{ $depot->url }}</a></dd></div>
|
||||
<div class="px-6 py-4 grid grid-cols-3 gap-4"><dt class="font-medium text-gray-500 dark:text-gray-400">Site</dt><dd class="col-span-2"><a href="{{ $depot->url }}" target="_blank" class="text-indigo-600 hover:underline">{{ $depot->url }}</a></dd></div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if($depot->sources->isNotEmpty())
|
||||
<div class="bg-white shadow rounded-lg overflow-hidden">
|
||||
<div class="px-6 py-4 border-b font-medium text-gray-900">Sources ({{ $depot->sources->count() }})</div>
|
||||
<ul class="divide-y divide-gray-100">
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg overflow-hidden">
|
||||
<div class="px-6 py-4 border-b font-medium text-gray-900 dark:text-white">Sources ({{ $depot->sources->count() }})</div>
|
||||
<ul class="divide-y divide-gray-100 dark:divide-gray-700">
|
||||
@foreach($depot->sources as $source)
|
||||
<li class="px-6 py-3 text-sm text-gray-700">{{ $source->nom }}</li>
|
||||
<li class="px-6 py-3 text-sm text-gray-700 dark:text-gray-300">{{ $source->nom }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<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', $lieuType?->nom) }}" required
|
||||
placeholder="ex : Pays, Région, Département, Ville…"
|
||||
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="ordre" class="block text-sm font-medium text-gray-700">Ordre d'affichage <span class="text-red-500">*</span></label>
|
||||
<label for="ordre" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Ordre d'affichage <span class="text-red-500">*</span></label>
|
||||
<input type="number" id="ordre" name="ordre" value="{{ old('ordre', $lieuType?->ordre ?? 0) }}"
|
||||
min="0" max="999" required
|
||||
class="mt-1 block w-32 rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
|
||||
<p class="mt-1 text-xs text-gray-400">Les valeurs les plus basses apparaissent en premier (ex : Pays=0, Région=10, Département=20, Ville=30…)</p>
|
||||
class="mt-1 block w-32 rounded-md border-gray-300 dark:border-gray-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
|
||||
<p class="mt-1 text-xs text-gray-400 dark:text-gray-500">Les valeurs les plus basses apparaissent en premier (ex : Pays=0, Région=10, Département=20, Ville=30…)</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800">Nouveau type de lieu</h2></x-slot>
|
||||
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Nouveau type de lieu</h2></x-slot>
|
||||
<div class="py-8 max-w-lg 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('admin.lieu-types.store') }}">
|
||||
@csrf
|
||||
@include('admin.lieu-types._form', ['lieuType' => 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('admin.lieu-types.index') }}" class="text-sm text-gray-500 self-center hover:text-gray-700">Annuler</a>
|
||||
<a href="{{ route('admin.lieu-types.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>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800">Modifier : {{ $lieuType->nom }}</h2></x-slot>
|
||||
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Modifier : {{ $lieuType->nom }}</h2></x-slot>
|
||||
<div class="py-8 max-w-lg 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('admin.lieu-types.update', $lieuType) }}">
|
||||
@csrf @method('PUT')
|
||||
@include('admin.lieu-types._form', ['lieuType' => $lieuType])
|
||||
<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('admin.lieu-types.index') }}" class="text-sm text-gray-500 self-center hover:text-gray-700">Annuler</a>
|
||||
<a href="{{ route('admin.lieu-types.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>
|
||||
|
||||
@@ -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">Types de lieux</h2>
|
||||
<h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Types de lieux</h2>
|
||||
<a href="{{ route('admin.lieu-types.create') }}"
|
||||
class="px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700">+ Nouveau type</a>
|
||||
</div>
|
||||
@@ -10,31 +10,31 @@
|
||||
<div class="py-8 max-w-3xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
@foreach(['success','error'] as $flash)
|
||||
@if(session($flash))
|
||||
<div class="mb-4 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="mb-4 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
|
||||
@endforeach
|
||||
|
||||
<div class="bg-white shadow rounded-lg overflow-hidden">
|
||||
<table class="min-w-full divide-y divide-gray-200">
|
||||
<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">
|
||||
<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">Ordre</th>
|
||||
<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">Lieux</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Ordre</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">Lieux</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($lieuTypes as $lt)
|
||||
<tr class="hover:bg-gray-50">
|
||||
<td class="px-6 py-4 text-sm text-gray-400 w-16">{{ $lt->ordre }}</td>
|
||||
<td class="px-6 py-4 font-medium text-gray-900">{{ $lt->nom }}</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500">{{ $lt->lieux_count }}</td>
|
||||
<tr class="hover:bg-gray-50 dark:hover:bg-gray-700">
|
||||
<td class="px-6 py-4 text-sm text-gray-400 dark:text-gray-500 w-16">{{ $lt->ordre }}</td>
|
||||
<td class="px-6 py-4 font-medium text-gray-900 dark:text-white">{{ $lt->nom }}</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">{{ $lt->lieux_count }}</td>
|
||||
<td class="px-6 py-4 text-right text-sm space-x-3">
|
||||
<a href="{{ route('admin.lieu-types.edit', $lt) }}"
|
||||
class="text-gray-600 hover:text-indigo-600">Modifier</a>
|
||||
class="text-gray-600 dark:text-gray-400 hover:text-indigo-600">Modifier</a>
|
||||
<form method="POST" action="{{ route('admin.lieu-types.destroy', $lt) }}" class="inline"
|
||||
x-data @submit.prevent="if(confirm('Supprimer ce type ?')) $el.submit()">
|
||||
@csrf @method('DELETE')
|
||||
@@ -44,7 +44,7 @@
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="4" class="px-6 py-10 text-center text-gray-400">
|
||||
<td colspan="4" class="px-6 py-10 text-center text-gray-400 dark:text-gray-500">
|
||||
Aucun type de lieu défini.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -1,23 +1,76 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<h2 class="text-xl font-semibold text-gray-800">Paramètres du site</h2>
|
||||
<h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Paramètres du site</h2>
|
||||
</x-slot>
|
||||
|
||||
<div class="py-8 max-w-2xl 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
|
||||
|
||||
{{-- Paramètres généraux (titre + inscriptions) --}}
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 space-y-6">
|
||||
<h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300 uppercase tracking-wide">Paramètres généraux</h3>
|
||||
|
||||
<form method="POST" action="{{ route('admin.parametres.update') }}" class="space-y-5">
|
||||
@csrf
|
||||
|
||||
{{-- Titre du site --}}
|
||||
<div>
|
||||
<label for="site_name" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
||||
Titre du site
|
||||
</label>
|
||||
<input type="text" id="site_name" name="site_name"
|
||||
value="{{ old('site_name', \App\Services\SiteSettingsService::get('site_name')) }}"
|
||||
placeholder="{{ config('app.name', 'MesRelevés') }}"
|
||||
maxlength="100"
|
||||
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">
|
||||
<p class="mt-1 text-xs text-gray-400 dark:text-gray-500">
|
||||
Affiché dans la navigation, les e-mails et les exports.
|
||||
Laisser vide pour utiliser la valeur par défaut
|
||||
(« {{ config('app.name', 'MesRelevés') }} »).
|
||||
</p>
|
||||
@error('site_name')
|
||||
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
{{-- Inscriptions --}}
|
||||
<div class="pt-4 border-t border-gray-100 dark:border-gray-700">
|
||||
<p class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Inscription publique des comptes</p>
|
||||
<p class="text-xs text-gray-500 dark:text-gray-400 mb-3">
|
||||
Autorise ou non les visiteurs à créer un compte via la page d'inscription.
|
||||
Quand désactivée, seul un administrateur peut créer des comptes.
|
||||
</p>
|
||||
<label class="flex items-center gap-3 cursor-pointer">
|
||||
<input type="hidden" name="registration_enabled" value="0">
|
||||
<input type="checkbox" name="registration_enabled" value="1"
|
||||
{{ $registrationEnabled ? 'checked' : '' }}
|
||||
class="w-4 h-4 text-indigo-600 border-gray-300 dark:border-gray-600 rounded focus:ring-indigo-500">
|
||||
<span class="text-sm text-gray-700 dark:text-gray-300">Autoriser l'inscription de nouveaux comptes</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button type="submit"
|
||||
class="px-5 py-2 bg-indigo-600 text-white text-sm font-medium rounded-md hover:bg-indigo-700">
|
||||
Enregistrer
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{{-- Logo --}}
|
||||
<div class="bg-white shadow rounded-lg p-6 space-y-5">
|
||||
<h3 class="text-sm font-semibold text-gray-700 uppercase tracking-wide">Logo du site</h3>
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 space-y-5">
|
||||
<h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300 uppercase tracking-wide">Logo du site</h3>
|
||||
|
||||
@if($logoUrl)
|
||||
<div class="flex items-center gap-6">
|
||||
<img src="{{ $logoUrl }}" alt="Logo actuel" class="h-20 w-auto object-contain rounded border border-gray-200 p-2">
|
||||
<img src="{{ $logoUrl }}" alt="Logo actuel" class="h-20 w-auto object-contain rounded border border-gray-200 dark:border-gray-700 p-2">
|
||||
<div>
|
||||
<p class="text-sm text-gray-600 mb-2">Logo actuel</p>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400 mb-2">Logo actuel</p>
|
||||
<form method="POST" action="{{ route('admin.parametres.logo.delete') }}"
|
||||
x-data @submit.prevent="if(confirm('Supprimer le logo ?')) $el.submit()">
|
||||
@csrf @method('DELETE')
|
||||
@@ -26,19 +79,19 @@
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<p class="text-sm text-gray-400">Aucun logo configuré — le nom de l'application est affiché.</p>
|
||||
<p class="text-sm text-gray-400 dark:text-gray-500">Aucun logo configuré — le nom de l'application est affiché.</p>
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{ route('admin.parametres.logo.update') }}"
|
||||
enctype="multipart/form-data" class="space-y-4">
|
||||
@csrf
|
||||
<div>
|
||||
<label for="logo" class="block text-sm font-medium text-gray-700 mb-1">
|
||||
<label for="logo" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
||||
{{ $logoUrl ? 'Remplacer le logo' : 'Téléverser un logo' }}
|
||||
</label>
|
||||
<input type="file" id="logo" name="logo" accept="image/*"
|
||||
class="block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-medium file:bg-indigo-50 file:text-indigo-700 hover:file:bg-indigo-100">
|
||||
<p class="mt-1 text-xs text-gray-400">PNG, JPG, SVG ou WebP · max 2 Mo · format recommandé : carré ou paysage, fond transparent</p>
|
||||
class="block w-full text-sm text-gray-500 dark:text-gray-400 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-medium file:bg-indigo-50 file:text-indigo-700 hover:file:bg-indigo-100">
|
||||
<p class="mt-1 text-xs text-gray-400 dark:text-gray-500">PNG, JPG, SVG ou WebP · max 2 Mo · format recommandé : carré ou paysage, fond transparent</p>
|
||||
@error('logo') <p class="mt-1 text-sm text-red-600">{{ $message }}</p> @enderror
|
||||
</div>
|
||||
<button type="submit"
|
||||
@@ -50,7 +103,7 @@
|
||||
|
||||
{{-- SMTP --}}
|
||||
@php $smtp = \App\Services\SiteSettingsService::smtpConfig(); @endphp
|
||||
<div class="bg-white shadow rounded-lg p-6 space-y-5"
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 space-y-5"
|
||||
x-data="{
|
||||
host: '{{ $smtp['host'] ?? '' }}',
|
||||
port: '{{ $smtp['port'] ?? 587 }}',
|
||||
@@ -98,13 +151,13 @@
|
||||
|
||||
<div class="flex items-start justify-between">
|
||||
<div>
|
||||
<h3 class="text-sm font-semibold text-gray-700 uppercase tracking-wide">Serveur SMTP</h3>
|
||||
<p class="text-xs text-gray-400 mt-0.5">
|
||||
<h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300 uppercase tracking-wide">Serveur SMTP</h3>
|
||||
<p class="text-xs text-gray-400 dark:text-gray-500 mt-0.5">
|
||||
Quand configuré, la connexion nécessitera un code PIN envoyé par e-mail (2FA).
|
||||
</p>
|
||||
</div>
|
||||
@if(\App\Services\SiteSettingsService::smtpConfigured())
|
||||
<span class="inline-flex items-center gap-1.5 text-xs text-green-700 bg-green-50 border border-green-200 px-2.5 py-1 rounded-full">
|
||||
<span class="inline-flex items-center gap-1.5 text-xs text-green-700 bg-green-50 dark:bg-green-900/30 border border-green-200 dark:border-green-700 px-2.5 py-1 rounded-full">
|
||||
<svg class="w-3 h-3 fill-current" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
@@ -118,24 +171,24 @@
|
||||
|
||||
<div class="grid grid-cols-3 gap-4">
|
||||
<div class="col-span-2">
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Hôte SMTP</label>
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Hôte SMTP</label>
|
||||
<input type="text" name="smtp_host" x-model="host"
|
||||
placeholder="smtp.exemple.fr"
|
||||
class="w-full rounded-md border-gray-300 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
|
||||
class="w-full rounded-md border-gray-300 dark:border-gray-600 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
|
||||
@error('smtp_host') <p class="mt-1 text-xs text-red-600">{{ $message }}</p> @enderror
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Port</label>
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Port</label>
|
||||
<input type="number" name="smtp_port" x-model="port"
|
||||
class="w-full rounded-md border-gray-300 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
|
||||
class="w-full rounded-md border-gray-300 dark:border-gray-600 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
|
||||
@error('smtp_port') <p class="mt-1 text-xs text-red-600">{{ $message }}</p> @enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Chiffrement</label>
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Chiffrement</label>
|
||||
<select name="smtp_encryption" x-model="encryption"
|
||||
class="w-full rounded-md border-gray-300 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
|
||||
class="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="tls">TLS / STARTTLS (port 587 recommandé)</option>
|
||||
<option value="ssl">SSL (port 465)</option>
|
||||
<option value="">Aucun (déconseillé)</option>
|
||||
@@ -144,39 +197,39 @@
|
||||
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Identifiant</label>
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Identifiant</label>
|
||||
<input type="text" name="smtp_username" x-model="username"
|
||||
autocomplete="off"
|
||||
class="w-full rounded-md border-gray-300 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
|
||||
class="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>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Mot de passe</label>
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Mot de passe</label>
|
||||
<input type="password" name="smtp_password" x-model="password"
|
||||
autocomplete="new-password"
|
||||
class="w-full rounded-md border-gray-300 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500"
|
||||
class="w-full rounded-md border-gray-300 dark:border-gray-600 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500"
|
||||
placeholder="{{ \App\Services\SiteSettingsService::smtpConfigured() ? '(inchangé si vide)' : '' }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-4 pt-2 border-t border-gray-100">
|
||||
<div class="grid grid-cols-2 gap-4 pt-2 border-t border-gray-100 dark:border-gray-700">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Adresse d'expéditeur</label>
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Adresse d'expéditeur</label>
|
||||
<input type="email" name="smtp_from_address" x-model="fromAddress"
|
||||
placeholder="noreply@exemple.fr"
|
||||
class="w-full rounded-md border-gray-300 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
|
||||
class="w-full rounded-md border-gray-300 dark:border-gray-600 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
|
||||
@error('smtp_from_address') <p class="mt-1 text-xs text-red-600">{{ $message }}</p> @enderror
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Nom d'expéditeur</label>
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Nom d'expéditeur</label>
|
||||
<input type="text" name="smtp_from_name" x-model="fromName"
|
||||
class="w-full rounded-md border-gray-300 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
|
||||
class="w-full rounded-md border-gray-300 dark:border-gray-600 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
|
||||
@error('smtp_from_name') <p class="mt-1 text-xs text-red-600">{{ $message }}</p> @enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Résultat test --}}
|
||||
<div x-show="tested" x-cloak class="p-3 rounded-lg text-sm flex items-start gap-2"
|
||||
:class="testOk ? 'bg-green-50 border border-green-200 text-green-800' : 'bg-red-50 border border-red-200 text-red-800'">
|
||||
:class="testOk ? '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'">
|
||||
<span x-text="testOk ? '✓' : '✗'" class="font-bold shrink-0"></span>
|
||||
<span x-text="testMsg" class="break-all"></span>
|
||||
</div>
|
||||
@@ -210,26 +263,26 @@
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{{-- Version --}}
|
||||
<div class="bg-white shadow rounded-lg p-6 space-y-4">
|
||||
<h3 class="text-sm font-semibold text-gray-700 uppercase tracking-wide">Version du logiciel</h3>
|
||||
{{-- Version du logiciel --}}
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 space-y-4">
|
||||
<h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300 uppercase tracking-wide">Version du logiciel</h3>
|
||||
|
||||
@if($updateAvailable)
|
||||
<div class="flex items-start gap-3 p-4 bg-indigo-50 border border-indigo-200 rounded-lg">
|
||||
<svg class="w-5 h-5 text-indigo-500 shrink-0 mt-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<div class="flex items-start gap-3 p-4 bg-indigo-50 dark:bg-indigo-900/30 border border-indigo-200 dark:border-indigo-700 rounded-lg">
|
||||
<svg class="w-5 h-5 text-indigo-500 dark:text-indigo-400 shrink-0 mt-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"/>
|
||||
</svg>
|
||||
<div>
|
||||
<p class="text-sm font-semibold text-indigo-800">
|
||||
<p class="text-sm font-semibold text-indigo-800 dark:text-indigo-200">
|
||||
Mise à jour disponible : v{{ $latestRelease['version'] }}
|
||||
</p>
|
||||
@if($latestRelease['published_at'])
|
||||
<p class="text-xs text-indigo-500 mt-0.5">
|
||||
<p class="text-xs text-indigo-500 dark:text-indigo-400 mt-0.5">
|
||||
Publié {{ \Carbon\Carbon::parse($latestRelease['published_at'])->diffForHumans() }}
|
||||
</p>
|
||||
@endif
|
||||
<p class="text-xs text-indigo-600 mt-2 font-mono bg-indigo-100 inline-block px-2 py-1 rounded">
|
||||
<p class="text-xs text-indigo-600 mt-2 font-mono bg-indigo-100 dark:bg-indigo-900/50 inline-block px-2 py-1 rounded">
|
||||
php artisan app:update
|
||||
</p>
|
||||
</div>
|
||||
@@ -238,16 +291,16 @@
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<p class="text-sm text-gray-700 font-medium">MesRelevés v{{ $installedVersion }}</p>
|
||||
<p class="text-sm text-gray-700 dark:text-gray-300 font-medium">MesRelevés v{{ $installedVersion }}</p>
|
||||
@php $installedAt = storage_path('installed'); @endphp
|
||||
@if(file_exists($installedAt))
|
||||
<p class="text-xs text-gray-400 mt-0.5">
|
||||
<p class="text-xs text-gray-400 dark:text-gray-500 mt-0.5">
|
||||
Installé le {{ \Carbon\Carbon::createFromTimestamp(filemtime($installedAt))->isoFormat('LL') }}
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
@if(! $updateAvailable)
|
||||
<span class="inline-flex items-center gap-1.5 text-xs text-green-700 bg-green-50 border border-green-200 px-3 py-1.5 rounded-full">
|
||||
@if(! $updateAvailable && ! $updatesDisabled)
|
||||
<span class="inline-flex items-center gap-1.5 text-xs text-green-700 bg-green-50 dark:bg-green-900/30 border border-green-200 dark:border-green-700 px-3 py-1.5 rounded-full">
|
||||
<svg class="w-3.5 h-3.5" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
@@ -255,59 +308,41 @@
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Option désactiver les mises à jour --}}
|
||||
<div class="pt-4 border-t border-gray-100 dark:border-gray-700">
|
||||
<form method="POST" action="{{ route('admin.parametres.updates') }}">
|
||||
@csrf
|
||||
<div class="flex items-start gap-3">
|
||||
<div class="flex items-center h-5 mt-0.5">
|
||||
<input type="hidden" name="updates_disabled" value="0">
|
||||
<input type="checkbox" id="updates_disabled" name="updates_disabled" value="1"
|
||||
{{ $updatesDisabled ? 'checked' : '' }}
|
||||
onchange="this.form.submit()"
|
||||
class="w-4 h-4 text-amber-600 border-gray-300 dark:border-gray-600 rounded focus:ring-amber-500">
|
||||
</div>
|
||||
<div>
|
||||
<label for="updates_disabled" class="text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer">
|
||||
Désactiver la vérification automatique des mises à jour
|
||||
</label>
|
||||
<p class="text-xs text-gray-400 dark:text-gray-500 mt-0.5">
|
||||
Quand coché, le site ne contacte plus le serveur distant pour vérifier l'existence
|
||||
d'une nouvelle version. Utile en environnement sans accès Internet ou en production
|
||||
isolée.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@if($updatesDisabled)
|
||||
<p class="mt-2 ml-7 text-xs text-amber-600 flex items-center gap-1">
|
||||
<svg class="w-3.5 h-3.5 shrink-0" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
Vérification des mises à jour désactivée — les nouvelles versions ne seront pas signalées.
|
||||
</p>
|
||||
@endif
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Titre du site + Inscriptions (formulaire commun) --}}
|
||||
<div class="bg-white shadow rounded-lg p-6 space-y-6">
|
||||
<h3 class="text-sm font-semibold text-gray-700 uppercase tracking-wide">Paramètres généraux</h3>
|
||||
|
||||
<form method="POST" action="{{ route('admin.parametres.update') }}" class="space-y-5">
|
||||
@csrf
|
||||
|
||||
{{-- Titre du site --}}
|
||||
<div>
|
||||
<label for="site_name" class="block text-sm font-medium text-gray-700 mb-1">
|
||||
Titre du site
|
||||
</label>
|
||||
<input type="text" id="site_name" name="site_name"
|
||||
value="{{ old('site_name', \App\Services\SiteSettingsService::get('site_name')) }}"
|
||||
placeholder="{{ config('app.name', 'MesRelevés') }}"
|
||||
maxlength="100"
|
||||
class="block w-full rounded-md border-gray-300 shadow-sm text-sm
|
||||
focus:border-indigo-500 focus:ring-indigo-500">
|
||||
<p class="mt-1 text-xs text-gray-400">
|
||||
Affiché dans la navigation, les e-mails et les exports.
|
||||
Laisser vide pour utiliser la valeur par défaut
|
||||
(« {{ config('app.name', 'MesRelevés') }} »).
|
||||
</p>
|
||||
@error('site_name')
|
||||
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
{{-- Inscriptions --}}
|
||||
<div class="pt-4 border-t border-gray-100">
|
||||
<p class="text-sm font-medium text-gray-700 mb-2">Inscription publique des comptes</p>
|
||||
<p class="text-xs text-gray-500 mb-3">
|
||||
Autorise ou non les visiteurs à créer un compte via la page d'inscription.
|
||||
Quand désactivée, seul un administrateur peut créer des comptes.
|
||||
</p>
|
||||
<label class="flex items-center gap-3 cursor-pointer">
|
||||
<input type="hidden" name="registration_enabled" value="0">
|
||||
<input type="checkbox" name="registration_enabled" value="1"
|
||||
{{ $registrationEnabled ? 'checked' : '' }}
|
||||
class="w-4 h-4 text-indigo-600 border-gray-300 rounded focus:ring-indigo-500">
|
||||
<span class="text-sm text-gray-700">Autoriser l'inscription de nouveaux comptes</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button type="submit"
|
||||
class="px-5 py-2 bg-indigo-600 text-white text-sm font-medium rounded-md hover:bg-indigo-700">
|
||||
Enregistrer
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<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', $section?->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>
|
||||
|
||||
@@ -16,22 +16,22 @@
|
||||
/>
|
||||
|
||||
<div>
|
||||
<label for="adresse" class="block text-sm font-medium text-gray-700">Adresse</label>
|
||||
<label for="adresse" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Adresse</label>
|
||||
<input type="text" id="adresse" name="adresse" value="{{ old('adresse', $section?->adresse) }}"
|
||||
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="email_contact" class="block text-sm font-medium text-gray-700">Email de contact</label>
|
||||
<label for="email_contact" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Email de contact</label>
|
||||
<input type="email" id="email_contact" name="email_contact" value="{{ old('email_contact', $section?->email_contact) }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 @error('email_contact') 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('email_contact') border-red-500 @enderror">
|
||||
@error('email_contact') <p class="mt-1 text-sm text-red-600">{{ $message }}</p> @enderror
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="url" class="block text-sm font-medium text-gray-700">Site internet</label>
|
||||
<label for="url" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Site internet</label>
|
||||
<input type="url" id="url" name="url" value="{{ old('url', $section?->url) }}"
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 @error('url') 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('url') border-red-500 @enderror">
|
||||
@error('url') <p class="mt-1 text-sm text-red-600">{{ $message }}</p> @enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800">Nouvelle section</h2></x-slot>
|
||||
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Nouvelle section</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('admin.sections.store') }}">
|
||||
@csrf
|
||||
@include('admin.sections._form', ['section' => 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('admin.sections.index') }}" class="text-sm text-gray-500 hover:text-gray-700 self-center">Annuler</a>
|
||||
<a href="{{ route('admin.sections.index') }}" class="text-sm text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 self-center">Annuler</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800">Modifier : {{ $section->nom }}</h2></x-slot>
|
||||
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Modifier : {{ $section->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('admin.sections.update', $section) }}">
|
||||
@csrf @method('PUT')
|
||||
@include('admin.sections._form', ['section' => $section])
|
||||
<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('admin.sections.show', $section) }}" class="text-sm text-gray-500 hover:text-gray-700 self-center">Annuler</a>
|
||||
<a href="{{ route('admin.sections.show', $section) }}" class="text-sm text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 self-center">Annuler</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -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">Sections locales</h2>
|
||||
<h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Sections locales</h2>
|
||||
<a href="{{ route('admin.sections.create') }}"
|
||||
class="px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700">+ Nouvelle section</a>
|
||||
</div>
|
||||
@@ -9,29 +9,29 @@
|
||||
|
||||
<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>
|
||||
<div class="mb-4 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
|
||||
|
||||
<div class="bg-white shadow rounded-lg overflow-hidden">
|
||||
<table class="min-w-full divide-y divide-gray-200">
|
||||
<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">
|
||||
<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">Lieu</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Contact</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">Lieu</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Contact</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($sections as $section)
|
||||
<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('admin.sections.show', $section) }}" class="text-indigo-600 hover:underline">{{ $section->nom }}</a>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500">{{ $section->lieu?->nom ?? '—' }}</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500">{{ $section->email_contact ?? '—' }}</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">{{ $section->lieu?->nom ?? '—' }}</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">{{ $section->email_contact ?? '—' }}</td>
|
||||
<td class="px-6 py-4 text-right text-sm space-x-3">
|
||||
<a href="{{ route('admin.sections.edit', $section) }}" class="text-gray-600 hover:text-indigo-600">Modifier</a>
|
||||
<a href="{{ route('admin.sections.edit', $section) }}" class="text-gray-600 dark:text-gray-400 hover:text-indigo-600">Modifier</a>
|
||||
<form method="POST" action="{{ route('admin.sections.destroy', $section) }}" class="inline"
|
||||
x-data @submit.prevent="if(confirm('Supprimer cette section ?')) $el.submit()">
|
||||
@csrf @method('DELETE')
|
||||
@@ -40,7 +40,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="4" class="px-6 py-10 text-center text-gray-400">Aucune section.</td></tr>
|
||||
<tr><td colspan="4" class="px-6 py-10 text-center text-gray-400 dark:text-gray-500">Aucune section.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -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">{{ $section->nom }}</h2>
|
||||
<h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">{{ $section->nom }}</h2>
|
||||
<a href="{{ route('admin.sections.edit', $section) }}"
|
||||
class="px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700">Modifier</a>
|
||||
</div>
|
||||
@@ -10,42 +10,42 @@
|
||||
<div class="py-8 max-w-4xl 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
|
||||
@endforeach
|
||||
|
||||
{{-- Fiche --}}
|
||||
<div class="bg-white shadow rounded-lg divide-y divide-gray-100 text-sm">
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg divide-y divide-gray-100 dark:divide-gray-700 text-sm">
|
||||
@foreach([['Lieu', $section->lieu?->nom_long ?? '—'], ['Adresse', $section->adresse ?? '—'], ['Email', $section->email_contact ?? '—'], ['Site', $section->url ?? '—']] 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
|
||||
</div>
|
||||
|
||||
{{-- Membres --}}
|
||||
<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 ({{ $section->membres->count() }})
|
||||
</div>
|
||||
@if($section->membres->isNotEmpty())
|
||||
<table class="min-w-full divide-y divide-gray-200 text-sm">
|
||||
<thead class="bg-gray-50">
|
||||
<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">Email</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Rôle dans la section</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">Email</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Rôle dans la section</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">
|
||||
@foreach($section->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">
|
||||
{{ $membre->pivot->role_in_section === 'section_manager' ? 'Responsable' : 'Membre' }}
|
||||
</td>
|
||||
@@ -63,25 +63,25 @@
|
||||
@endif
|
||||
|
||||
{{-- Ajouter un membre --}}
|
||||
<div class="px-6 py-4 bg-gray-50 border-t border-gray-200">
|
||||
<form method="POST" action="{{ route('admin.sections.membres.add', $section) }}" 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('admin.sections.membres.add', $section) }}"
|
||||
x-data="{ canSubmit: false }"
|
||||
@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">Utilisateur</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($users as $user)
|
||||
<option value="{{ $user->id }}">{{ $user->name }} ({{ $user->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">Utilisateur</label>
|
||||
<x-user-picker :users="$users" placeholder="Rechercher un utilisateur…" required />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1">Rôle</label>
|
||||
<select name="role_in_section" class="block w-full rounded-md border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
|
||||
<option value="member">Membre</option>
|
||||
<option value="section_manager">Responsable</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 shrink-0">Ajouter</button>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">Rôle</label>
|
||||
<select name="role_in_section" class="block w-full rounded-md border-gray-300 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">
|
||||
<option value="member">Membre</option>
|
||||
<option value="section_manager">Responsable</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700">Ajouter</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800">Nouveau type de source</h2></x-slot>
|
||||
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Nouveau type de 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('admin.source-types.store') }}">
|
||||
@csrf
|
||||
<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') }}" required
|
||||
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">
|
||||
@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') }}</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') }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<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 et définir les champs</button>
|
||||
<a href="{{ route('admin.source-types.index') }}" class="text-sm text-gray-500 self-center hover:text-gray-700">Annuler</a>
|
||||
<a href="{{ route('admin.source-types.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>
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800">Modifier : {{ $sourceType->nom }}</h2></x-slot>
|
||||
<x-slot name="header"><h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Modifier : {{ $sourceType->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('admin.source-types.update', $sourceType) }}">
|
||||
@csrf @method('PUT')
|
||||
<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', $sourceType->nom) }}" required
|
||||
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="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', $sourceType->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', $sourceType->description) }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<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('admin.source-types.show', $sourceType) }}" class="text-sm text-gray-500 self-center hover:text-gray-700">Annuler</a>
|
||||
<a href="{{ route('admin.source-types.show', $sourceType) }}" 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>
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<div class="flex items-center justify-between">
|
||||
<h2 class="text-xl font-semibold text-gray-800">Types de sources</h2>
|
||||
<h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Types de sources</h2>
|
||||
<a href="{{ route('admin.source-types.create') }}" class="px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700">+ Nouveau type</a>
|
||||
</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">
|
||||
@if(session('success')) <div class="mb-4 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
|
||||
@if(session('error')) <div class="mb-4 p-4 bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-700 text-red-800 dark:text-red-200 rounded-md">{{ session('error') }}</div> @endif
|
||||
<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">
|
||||
<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">Champs</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Sources liées</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">Champs</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Sources liées</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($sourceTypes as $st)
|
||||
<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('admin.source-types.show', $st) }}" class="text-indigo-600 hover:underline">{{ $st->nom }}</a>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500">{{ $st->fields_count ?? '—' }}</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500">{{ $st->sources_count }}</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">{{ $st->fields_count ?? '—' }}</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">{{ $st->sources_count }}</td>
|
||||
<td class="px-6 py-4 text-right text-sm space-x-3">
|
||||
<a href="{{ route('admin.source-types.edit', $st) }}" class="text-gray-600 hover:text-indigo-600">Modifier</a>
|
||||
<a href="{{ route('admin.source-types.edit', $st) }}" class="text-gray-600 dark:text-gray-400 hover:text-indigo-600">Modifier</a>
|
||||
<form method="POST" action="{{ route('admin.source-types.destroy', $st) }}" class="inline"
|
||||
x-data @submit.prevent="if(confirm('Supprimer ce type ?')) $el.submit()">
|
||||
@csrf @method('DELETE')
|
||||
@@ -36,7 +36,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="4" class="px-6 py-10 text-center text-gray-400">Aucun type de source.</td></tr>
|
||||
<tr><td colspan="4" class="px-6 py-10 text-center text-gray-400 dark:text-gray-500">Aucun type de source.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -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">{{ $sourceType->nom }}</h2>
|
||||
<h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">{{ $sourceType->nom }}</h2>
|
||||
<a href="{{ route('admin.source-types.edit', $sourceType) }}" class="px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700">Modifier</a>
|
||||
</div>
|
||||
</x-slot>
|
||||
@@ -9,21 +9,21 @@
|
||||
<div class="py-8 max-w-4xl 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
|
||||
@endforeach
|
||||
|
||||
@if($sourceType->description)
|
||||
<div class="bg-white shadow rounded-lg px-6 py-4 text-sm text-gray-700">{{ $sourceType->description }}</div>
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg px-6 py-4 text-sm text-gray-700 dark:text-gray-300">{{ $sourceType->description }}</div>
|
||||
@endif
|
||||
|
||||
{{-- Champs existants --}}
|
||||
<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">Champs ({{ $sourceType->fields->count() }})</h3>
|
||||
<span class="text-xs text-gray-400">Glisser-déposer pour réordonner</span>
|
||||
<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">Champs ({{ $sourceType->fields->count() }})</h3>
|
||||
<span class="text-xs text-gray-400 dark:text-gray-500">Glisser-déposer pour réordonner</span>
|
||||
</div>
|
||||
|
||||
@if($sourceType->fields->isNotEmpty())
|
||||
@@ -31,21 +31,21 @@
|
||||
@csrf
|
||||
</form>
|
||||
|
||||
<ul id="fields-list" class="divide-y divide-gray-100">
|
||||
<ul id="fields-list" class="divide-y divide-gray-100 dark:divide-gray-700">
|
||||
@foreach($sourceType->fields as $field)
|
||||
<li class="px-6 py-3 flex items-center gap-4" data-id="{{ $field->id }}">
|
||||
<span class="cursor-move text-gray-300 hover:text-gray-500 select-none">⠿</span>
|
||||
<span class="cursor-move text-gray-300 dark:text-gray-600 hover:text-gray-500 select-none">⠿</span>
|
||||
<div class="flex-1 grid grid-cols-4 gap-3 text-sm">
|
||||
<span class="font-mono text-indigo-700">{{ $field->name }}</span>
|
||||
<span class="text-gray-700">{{ $field->label }}</span>
|
||||
<span class="text-gray-500">{{ $field->type->value }}</span>
|
||||
<span class="text-gray-400">{{ $field->required ? 'Obligatoire' : 'Optionnel' }}</span>
|
||||
<span class="text-gray-700 dark:text-gray-300">{{ $field->label }}</span>
|
||||
<span class="text-gray-500 dark:text-gray-400">{{ $field->type->value }}</span>
|
||||
<span class="text-gray-400 dark:text-gray-500">{{ $field->required ? 'Obligatoire' : 'Optionnel' }}</span>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<button type="button"
|
||||
x-data="{ open: false }"
|
||||
@click="open = !open"
|
||||
class="text-xs text-gray-500 hover:text-indigo-600">Modifier</button>
|
||||
class="text-xs text-gray-500 dark:text-gray-400 hover:text-indigo-600">Modifier</button>
|
||||
<form method="POST" action="{{ route('admin.source-types.fields.destroy', [$sourceType, $field]) }}"
|
||||
x-data @submit.prevent="if(confirm('Supprimer ce champ ?')) $el.submit()">
|
||||
@csrf @method('DELETE')
|
||||
@@ -56,34 +56,34 @@
|
||||
@endforeach
|
||||
</ul>
|
||||
@else
|
||||
<p class="px-6 py-8 text-center text-gray-400 text-sm">Aucun champ défini. Ajoutez-en ci-dessous.</p>
|
||||
<p class="px-6 py-8 text-center text-gray-400 dark:text-gray-500 text-sm">Aucun champ défini. Ajoutez-en ci-dessous.</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Ajouter un champ --}}
|
||||
<div class="bg-white shadow rounded-lg p-6">
|
||||
<h3 class="font-medium text-gray-900 mb-4">Ajouter un champ</h3>
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6">
|
||||
<h3 class="font-medium text-gray-900 dark:text-white mb-4">Ajouter un champ</h3>
|
||||
<form method="POST" action="{{ route('admin.source-types.fields.store', $sourceType) }}">
|
||||
@csrf
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">Nom technique <span class="text-red-500">*</span></label>
|
||||
<label class="block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1">Nom technique <span class="text-red-500">*</span></label>
|
||||
<input type="text" name="name" value="{{ old('name') }}" required
|
||||
placeholder="ex: nom_pere"
|
||||
class="block w-full rounded-md border-gray-300 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500 @error('name') border-red-500 @enderror">
|
||||
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 @error('name') border-red-500 @enderror">
|
||||
@error('name') <p class="mt-1 text-xs text-red-600">{{ $message }}</p> @enderror
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">Libellé affiché <span class="text-red-500">*</span></label>
|
||||
<label class="block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1">Libellé affiché <span class="text-red-500">*</span></label>
|
||||
<input type="text" name="label" value="{{ old('label') }}" required
|
||||
placeholder="ex: Nom du père"
|
||||
class="block w-full rounded-md border-gray-300 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500 @error('label') border-red-500 @enderror">
|
||||
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 @error('label') border-red-500 @enderror">
|
||||
@error('label') <p class="mt-1 text-xs text-red-600">{{ $message }}</p> @enderror
|
||||
</div>
|
||||
<div x-data="{ type: '{{ old('type', 'text') }}' }">
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">Type <span class="text-red-500">*</span></label>
|
||||
<label class="block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1">Type <span class="text-red-500">*</span></label>
|
||||
<select name="type" x-model="type"
|
||||
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">
|
||||
@foreach(\App\Enums\FieldType::cases() as $ft)
|
||||
<option value="{{ $ft->value }}" {{ old('type') === $ft->value ? 'selected' : '' }}>{{ $ft->value }}</option>
|
||||
@endforeach
|
||||
@@ -91,15 +91,15 @@
|
||||
|
||||
{{-- Options pour type=select --}}
|
||||
<div x-show="type === 'select'" x-cloak class="mt-3">
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">Options (une par ligne)</label>
|
||||
<label class="block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1">Options (une par ligne)</label>
|
||||
<textarea name="options_raw" rows="3" placeholder="Option A Option B Option C"
|
||||
class="block w-full rounded-md border-gray-300 shadow-sm text-sm focus:border-indigo-500 focus:ring-indigo-500">{{ old('options_raw') }}</textarea>
|
||||
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">{{ old('options_raw') }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-end">
|
||||
<label class="flex items-center gap-2 text-sm text-gray-700">
|
||||
<label class="flex items-center gap-2 text-sm text-gray-700 dark:text-gray-300">
|
||||
<input type="checkbox" name="required" value="1" {{ old('required') ? 'checked' : '' }}
|
||||
class="rounded border-gray-300 text-indigo-600 focus:ring-indigo-500">
|
||||
class="rounded border-gray-300 dark:border-gray-600 text-indigo-600 focus:ring-indigo-500">
|
||||
Champ obligatoire
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@@ -2,48 +2,48 @@
|
||||
<x-slot name="header">
|
||||
<div class="flex items-center gap-3">
|
||||
<a href="{{ route('admin.utilisateurs.index') }}" class="text-sm text-indigo-600 hover:underline">← Utilisateurs</a>
|
||||
<span class="text-gray-400">/</span>
|
||||
<h2 class="text-xl font-semibold text-gray-800">{{ $user->name }}</h2>
|
||||
<span class="text-gray-400 dark:text-gray-500">/</span>
|
||||
<h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">{{ $user->name }}</h2>
|
||||
</div>
|
||||
</x-slot>
|
||||
|
||||
<div class="py-8 max-w-2xl 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
|
||||
@if(session('error'))
|
||||
<div class="p-4 bg-red-50 border border-red-200 text-red-800 rounded-md">{{ session('error') }}</div>
|
||||
<div class="p-4 bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-700 text-red-800 dark:text-red-200 rounded-md">{{ session('error') }}</div>
|
||||
@endif
|
||||
|
||||
{{-- Informations --}}
|
||||
<div class="bg-white shadow rounded-lg p-6 space-y-3">
|
||||
<h3 class="text-sm font-semibold text-gray-700 uppercase tracking-wide">Informations</h3>
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 space-y-3">
|
||||
<h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300 uppercase tracking-wide">Informations</h3>
|
||||
<dl class="grid grid-cols-2 gap-x-6 gap-y-3 text-sm">
|
||||
<dt class="text-gray-500">Nom</dt>
|
||||
<dd class="text-gray-900 font-medium">{{ $user->name }}</dd>
|
||||
<dt class="text-gray-500">E-mail</dt>
|
||||
<dd class="text-gray-900">{{ $user->email }}</dd>
|
||||
<dt class="text-gray-500">Inscrit le</dt>
|
||||
<dd class="text-gray-900">{{ $user->created_at->format('d/m/Y') }}</dd>
|
||||
<dt class="text-gray-500">Sections</dt>
|
||||
<dd class="text-gray-900">
|
||||
<dt class="text-gray-500 dark:text-gray-400">Nom</dt>
|
||||
<dd class="text-gray-900 dark:text-white font-medium">{{ $user->name }}</dd>
|
||||
<dt class="text-gray-500 dark:text-gray-400">E-mail</dt>
|
||||
<dd class="text-gray-900 dark:text-white">{{ $user->email }}</dd>
|
||||
<dt class="text-gray-500 dark:text-gray-400">Inscrit le</dt>
|
||||
<dd class="text-gray-900 dark:text-white">{{ $user->created_at->format('d/m/Y') }}</dd>
|
||||
<dt class="text-gray-500 dark:text-gray-400">Sections</dt>
|
||||
<dd class="text-gray-900 dark:text-white">
|
||||
@if($user->sections->isNotEmpty())
|
||||
{{ $user->sections->pluck('nom')->join(', ') }}
|
||||
@else
|
||||
—
|
||||
@endif
|
||||
</dd>
|
||||
<dt class="text-gray-500">Sources assignées</dt>
|
||||
<dd class="text-gray-900">{{ $user->sourcesAssignees->count() }}</dd>
|
||||
<dt class="text-gray-500 dark:text-gray-400">Sources assignées</dt>
|
||||
<dd class="text-gray-900 dark:text-white">{{ $user->sourcesAssignees->count() }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
{{-- Statut actif / inactif --}}
|
||||
<div class="bg-white shadow rounded-lg p-6 flex items-center justify-between">
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 flex items-center justify-between">
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-900">Statut du compte</p>
|
||||
<p class="text-sm text-gray-500 mt-0.5">
|
||||
<p class="text-sm font-medium text-gray-900 dark:text-white">Statut du compte</p>
|
||||
<p class="text-sm text-gray-500 dark:text-gray-400 mt-0.5">
|
||||
@if($user->is_active)
|
||||
Le compte est <span class="text-green-600 font-medium">actif</span> — l'utilisateur peut se connecter et être assigné à des sources.
|
||||
@else
|
||||
@@ -59,8 +59,8 @@
|
||||
<button type="submit"
|
||||
class="px-4 py-2 text-sm font-medium rounded-md
|
||||
{{ $user->is_active
|
||||
? 'bg-red-50 text-red-700 border border-red-200 hover:bg-red-100'
|
||||
: 'bg-green-50 text-green-700 border border-green-200 hover:bg-green-100' }}">
|
||||
? 'bg-red-50 dark:bg-red-900/30 text-red-700 border border-red-200 dark:border-red-700 hover:bg-red-100'
|
||||
: 'bg-green-50 dark:bg-green-900/30 text-green-700 border border-green-200 dark:border-green-700 hover:bg-green-100' }}">
|
||||
{{ $user->is_active ? 'Désactiver le compte' : 'Activer le compte' }}
|
||||
</button>
|
||||
</form>
|
||||
@@ -68,20 +68,20 @@
|
||||
</div>
|
||||
|
||||
{{-- Modifier le rôle --}}
|
||||
<div class="bg-white shadow rounded-lg p-6">
|
||||
<h3 class="text-sm font-semibold text-gray-700 uppercase tracking-wide mb-4">Rôle</h3>
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6">
|
||||
<h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300 uppercase tracking-wide mb-4">Rôle</h3>
|
||||
<form method="POST" action="{{ route('admin.utilisateurs.update', $user) }}">
|
||||
@csrf @method('PUT')
|
||||
<div class="space-y-3">
|
||||
@foreach(\App\Enums\UserRole::cases() as $role)
|
||||
<label class="flex items-start gap-3 p-3 border rounded-lg cursor-pointer hover:bg-gray-50
|
||||
{{ $user->role === $role ? 'border-indigo-400 bg-indigo-50' : 'border-gray-200' }}">
|
||||
<label class="flex items-start gap-3 p-3 border rounded-lg cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700
|
||||
{{ $user->role === $role ? 'border-indigo-400 bg-indigo-50 dark:bg-indigo-900/30' : 'border-gray-200 dark:border-gray-700' }}">
|
||||
<input type="radio" name="role" value="{{ $role->value }}"
|
||||
{{ $user->role === $role ? 'checked' : '' }}
|
||||
class="mt-0.5 text-indigo-600">
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-900">{{ $role->label() }}</p>
|
||||
<p class="text-xs text-gray-500 mt-0.5">
|
||||
<p class="text-sm font-medium text-gray-900 dark:text-white">{{ $role->label() }}</p>
|
||||
<p class="text-xs text-gray-500 dark:text-gray-400 mt-0.5">
|
||||
@if($role === \App\Enums\UserRole::Admin)
|
||||
Accès complet : gestion des utilisateurs, sections, dépôts, types de sources et statistiques.
|
||||
@elseif($role === \App\Enums\UserRole::SectionManager)
|
||||
@@ -100,7 +100,7 @@
|
||||
Enregistrer
|
||||
</button>
|
||||
<a href="{{ route('admin.utilisateurs.index') }}"
|
||||
class="text-sm text-gray-500 self-center hover:text-gray-700">
|
||||
class="text-sm text-gray-500 dark:text-gray-400 self-center hover:text-gray-700 dark:hover:text-gray-300">
|
||||
Annuler
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -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">Importer des utilisateurs</h2>
|
||||
<h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Importer des utilisateurs</h2>
|
||||
<a href="{{ route('admin.utilisateurs.index') }}"
|
||||
class="text-sm text-indigo-600 hover:underline">← Retour à la liste</a>
|
||||
</div>
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
{{-- Résultats d'import --}}
|
||||
@if(isset($results))
|
||||
<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">
|
||||
<div class="flex items-center gap-4">
|
||||
@if($created > 0)
|
||||
<span class="text-green-700 font-semibold text-sm">
|
||||
@@ -26,31 +26,31 @@
|
||||
</div>
|
||||
|
||||
@if($created > 0)
|
||||
<div class="p-3 bg-amber-50 border border-amber-200 rounded-lg text-xs text-amber-800">
|
||||
<div class="p-3 bg-amber-50 dark:bg-amber-900/30 border border-amber-200 rounded-lg text-xs text-amber-800">
|
||||
Les mots de passe temporaires ci-dessous sont affichés <strong>une seule fois</strong>.
|
||||
Notez-les et communiquez-les aux utilisateurs concernés. Ils pourront les changer via leur profil.
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="overflow-x-auto">
|
||||
<table class="min-w-full text-sm divide-y divide-gray-200">
|
||||
<thead class="bg-gray-50">
|
||||
<table class="min-w-full text-sm divide-y divide-gray-200 dark:divide-gray-700">
|
||||
<thead class="bg-gray-50 dark:bg-gray-700">
|
||||
<tr>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">Ligne</th>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">Nom</th>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">E-mail</th>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">Rôle</th>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">Mot de passe temporaire</th>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">Statut</th>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Ligne</th>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Nom</th>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">E-mail</th>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Rôle</th>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Mot de passe temporaire</th>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Statut</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200 bg-white">
|
||||
<tbody class="divide-y divide-gray-200 dark:divide-gray-700 bg-white dark:bg-gray-800">
|
||||
@foreach($results as $r)
|
||||
<tr class="{{ $r['ok'] ? '' : 'bg-red-50' }}">
|
||||
<td class="px-4 py-2 text-gray-400">{{ $r['line'] }}</td>
|
||||
<td class="px-4 py-2 font-medium text-gray-900">{{ $r['name'] }}</td>
|
||||
<td class="px-4 py-2 text-gray-600">{{ $r['email'] }}</td>
|
||||
<td class="px-4 py-2 text-gray-500">{{ $r['role'] ?? '' }}</td>
|
||||
<tr class="{{ $r['ok'] ? '' : 'bg-red-50 dark:bg-red-900/30' }}">
|
||||
<td class="px-4 py-2 text-gray-400 dark:text-gray-500">{{ $r['line'] }}</td>
|
||||
<td class="px-4 py-2 font-medium text-gray-900 dark:text-white">{{ $r['name'] }}</td>
|
||||
<td class="px-4 py-2 text-gray-600 dark:text-gray-400">{{ $r['email'] }}</td>
|
||||
<td class="px-4 py-2 text-gray-500 dark:text-gray-400">{{ $r['role'] ?? '' }}</td>
|
||||
<td class="px-4 py-2 font-mono text-indigo-700">
|
||||
{{ $r['ok'] ? $r['password'] : '' }}
|
||||
</td>
|
||||
@@ -77,26 +77,26 @@
|
||||
@endif
|
||||
|
||||
{{-- Formulaire d'import --}}
|
||||
<div class="bg-white shadow rounded-lg p-6 space-y-5">
|
||||
<h3 class="text-sm font-semibold text-gray-700 uppercase tracking-wide">Importer un fichier CSV</h3>
|
||||
<div class="bg-white dark:bg-gray-800 shadow rounded-lg p-6 space-y-5">
|
||||
<h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300 uppercase tracking-wide">Importer un fichier CSV</h3>
|
||||
|
||||
@if($errors->any())
|
||||
<div class="p-4 bg-red-50 border border-red-200 text-red-700 text-sm rounded-md space-y-1">
|
||||
<div class="p-4 bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-700 text-red-700 text-sm rounded-md space-y-1">
|
||||
@foreach($errors->all() as $e)<p>{{ $e }}</p>@endforeach
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="p-4 bg-blue-50 border border-blue-200 rounded-lg text-sm text-blue-800 space-y-1">
|
||||
<div class="p-4 bg-blue-50 border border-blue-200 rounded-lg text-sm text-blue-800 dark:text-blue-200 space-y-1">
|
||||
<p class="font-semibold">Format attendu du fichier CSV :</p>
|
||||
<ul class="list-disc list-inside text-xs space-y-0.5">
|
||||
<li>Séparateur : <code class="bg-blue-100 px-1 rounded">;</code> ou <code class="bg-blue-100 px-1 rounded">,</code></li>
|
||||
<li>Séparateur : <code class="bg-blue-100 dark:bg-blue-900/50 px-1 rounded">;</code> ou <code class="bg-blue-100 dark:bg-blue-900/50 px-1 rounded">,</code></li>
|
||||
<li>Encodage : UTF-8 (avec ou sans BOM)</li>
|
||||
<li>Colonnes obligatoires : <code class="bg-blue-100 px-1 rounded">name</code>, <code class="bg-blue-100 px-1 rounded">email</code>, <code class="bg-blue-100 px-1 rounded">role</code></li>
|
||||
<li>Colonne optionnelle : <code class="bg-blue-100 px-1 rounded">is_active</code> (1 ou 0, défaut : 1)</li>
|
||||
<li>Valeurs acceptées pour <code class="bg-blue-100 px-1 rounded">role</code> :
|
||||
<code class="bg-blue-100 px-1 rounded">member</code>,
|
||||
<code class="bg-blue-100 px-1 rounded">section_manager</code>,
|
||||
<code class="bg-blue-100 px-1 rounded">admin</code>
|
||||
<li>Colonnes obligatoires : <code class="bg-blue-100 dark:bg-blue-900/50 px-1 rounded">name</code>, <code class="bg-blue-100 dark:bg-blue-900/50 px-1 rounded">email</code>, <code class="bg-blue-100 dark:bg-blue-900/50 px-1 rounded">role</code></li>
|
||||
<li>Colonne optionnelle : <code class="bg-blue-100 dark:bg-blue-900/50 px-1 rounded">is_active</code> (1 ou 0, défaut : 1)</li>
|
||||
<li>Valeurs acceptées pour <code class="bg-blue-100 dark:bg-blue-900/50 px-1 rounded">role</code> :
|
||||
<code class="bg-blue-100 dark:bg-blue-900/50 px-1 rounded">member</code>,
|
||||
<code class="bg-blue-100 dark:bg-blue-900/50 px-1 rounded">section_manager</code>,
|
||||
<code class="bg-blue-100 dark:bg-blue-900/50 px-1 rounded">admin</code>
|
||||
</li>
|
||||
<li>Un mot de passe temporaire aléatoire sera généré pour chaque compte importé.</li>
|
||||
</ul>
|
||||
@@ -110,15 +110,15 @@
|
||||
enctype="multipart/form-data" class="space-y-4">
|
||||
@csrf
|
||||
<div>
|
||||
<label for="file" class="block text-sm font-medium text-gray-700 mb-1">
|
||||
<label for="file" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
||||
Fichier CSV <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<input type="file" id="file" name="file" accept=".csv,.txt" required
|
||||
class="block w-full text-sm text-gray-500
|
||||
class="block w-full text-sm text-gray-500 dark:text-gray-400
|
||||
file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0
|
||||
file:text-sm file:font-medium file:bg-indigo-50 file:text-indigo-700
|
||||
hover:file:bg-indigo-100">
|
||||
<p class="mt-1 text-xs text-gray-400">Taille maximale : 2 Mo.</p>
|
||||
<p class="mt-1 text-xs text-gray-400 dark:text-gray-500">Taille maximale : 2 Mo.</p>
|
||||
@error('file') <p class="mt-1 text-sm text-red-600">{{ $message }}</p> @enderror
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<div class="flex items-center justify-between">
|
||||
<h2 class="text-xl font-semibold text-gray-800">Gestion des utilisateurs</h2>
|
||||
<h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Gestion des utilisateurs</h2>
|
||||
<div class="flex items-center gap-3">
|
||||
<a href="{{ route('admin.utilisateurs.import') }}"
|
||||
class="flex items-center gap-1.5 px-4 py-2 border border-gray-300 text-sm text-gray-700 rounded-md hover:bg-gray-50 transition-colors">
|
||||
class="flex items-center gap-1.5 px-4 py-2 border border-gray-300 dark:border-gray-600 text-sm text-gray-700 dark:text-gray-300 rounded-md hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
|
||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"/>
|
||||
@@ -12,7 +12,7 @@
|
||||
Importer CSV
|
||||
</a>
|
||||
<a href="{{ route('admin.utilisateurs.export', request()->only(['role', 'status', 'q'])) }}"
|
||||
class="flex items-center gap-1.5 px-4 py-2 border border-gray-300 text-sm text-gray-700 rounded-md hover:bg-gray-50 transition-colors">
|
||||
class="flex items-center gap-1.5 px-4 py-2 border border-gray-300 dark:border-gray-600 text-sm text-gray-700 dark:text-gray-300 rounded-md hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
|
||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4 4m0 0l4 4m-4-4h12"/>
|
||||
@@ -26,33 +26,33 @@
|
||||
<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 text-sm rounded-md">
|
||||
<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 text-sm rounded-md">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
@if(session('error'))
|
||||
<div class="p-4 bg-red-50 border border-red-200 text-red-800 text-sm rounded-md">
|
||||
<div class="p-4 bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-700 text-red-800 dark:text-red-200 text-sm rounded-md">
|
||||
{{ session('error') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Filtres --}}
|
||||
@php $hasFilters = request()->anyFilled(['role', 'q', 'status']); @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('admin.utilisateurs.index') }}"
|
||||
class="flex flex-wrap items-end gap-4">
|
||||
<div class="flex-1 min-w-[180px]">
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">Recherche</label>
|
||||
<label class="block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1">Recherche</label>
|
||||
<input type="text" name="q" value="{{ request('q') }}"
|
||||
placeholder="Nom ou e-mail…"
|
||||
class="block w-full rounded-md border-gray-300 shadow-sm text-sm
|
||||
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 class="w-44">
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">Rôle</label>
|
||||
<label class="block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1">Rôle</label>
|
||||
<select name="role"
|
||||
class="block w-full rounded-md border-gray-300 shadow-sm text-sm
|
||||
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\UserRole::cases() as $r)
|
||||
@@ -64,9 +64,9 @@
|
||||
</div>
|
||||
|
||||
<div class="w-40">
|
||||
<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
|
||||
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>
|
||||
<option value="active" {{ request('status') === 'active' ? 'selected' : '' }}>Actifs</option>
|
||||
@@ -81,7 +81,7 @@
|
||||
</button>
|
||||
@if($hasFilters)
|
||||
<a href="{{ route('admin.utilisateurs.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
|
||||
</a>
|
||||
@endif
|
||||
@@ -90,52 +90,52 @@
|
||||
</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">E-mail</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Rôle</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Sections</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Sources</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Inscrit le</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">E-mail</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Rôle</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Sections</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Sources</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase">Inscrit le</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($users as $user)
|
||||
@php
|
||||
$roleColors = [
|
||||
'admin' => 'bg-red-100 text-red-700',
|
||||
'section_manager' => 'bg-blue-100 text-blue-700',
|
||||
'member' => 'bg-gray-100 text-gray-600',
|
||||
'admin' => 'bg-red-100 dark:bg-red-900/50 text-red-700',
|
||||
'section_manager' => 'bg-blue-100 dark:bg-blue-900/50 text-blue-700',
|
||||
'member' => 'bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400',
|
||||
];
|
||||
$color = $roleColors[$user->role->value] ?? 'bg-gray-100 text-gray-600';
|
||||
$color = $roleColors[$user->role->value] ?? 'bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400';
|
||||
@endphp
|
||||
<tr class="hover:bg-gray-50 {{ ! $user->is_active ? 'opacity-60' : '' }}">
|
||||
<td class="px-6 py-4 font-medium text-gray-900">
|
||||
<tr class="hover:bg-gray-50 dark:hover:bg-gray-700 {{ ! $user->is_active ? 'opacity-60' : '' }}">
|
||||
<td class="px-6 py-4 font-medium text-gray-900 dark:text-white">
|
||||
{{ $user->name }}
|
||||
@if($user->id === auth()->id())
|
||||
<span class="ml-1 text-xs text-gray-400">(vous)</span>
|
||||
<span class="ml-1 text-xs text-gray-400 dark:text-gray-500">(vous)</span>
|
||||
@endif
|
||||
@if(! $user->is_active)
|
||||
<span class="ml-2 inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-red-100 text-red-600">
|
||||
<span class="ml-2 inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-red-100 dark:bg-red-900/50 text-red-600">
|
||||
Inactif
|
||||
</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-6 py-4 text-gray-500">{{ $user->email }}</td>
|
||||
<td class="px-6 py-4 text-gray-500 dark:text-gray-400">{{ $user->email }}</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 }}">
|
||||
{{ $user->role->label() }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-gray-500">
|
||||
<td class="px-6 py-4 text-gray-500 dark:text-gray-400">
|
||||
{{ $user->sections->isNotEmpty() ? $user->sections->pluck('nom')->join(', ') : '—' }}
|
||||
</td>
|
||||
<td class="px-6 py-4 text-gray-500">{{ $user->sources_assignees_count ?: '—' }}</td>
|
||||
<td class="px-6 py-4 text-gray-500 whitespace-nowrap">
|
||||
<td class="px-6 py-4 text-gray-500 dark:text-gray-400">{{ $user->sources_assignees_count ?: '—' }}</td>
|
||||
<td class="px-6 py-4 text-gray-500 dark:text-gray-400 whitespace-nowrap">
|
||||
{{ $user->created_at->format('d/m/Y') }}
|
||||
</td>
|
||||
<td class="px-6 py-4 text-right space-x-3">
|
||||
@@ -157,7 +157,7 @@
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="7" class="px-6 py-10 text-center text-gray-400">
|
||||
<td colspan="7" class="px-6 py-10 text-center text-gray-400 dark:text-gray-500">
|
||||
Aucun utilisateur trouvé.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user