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

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

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-04 19:46:22 +02:00
parent 07ab2a7063
commit f530f55577
73 changed files with 1288 additions and 913 deletions
@@ -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>