{{-- Ligne de session programmée --}} @php $modeLabels = [ 'presentiel' => 'Présentiel', 'visio' => 'Visio', 'blended' => 'Mixte (blended)', 'elearning' => 'E-learning', ]; $statusLabels = [ 'planifiee' => ['Planifiée', 'bg-slate-100 text-slate-600'], 'ouverte' => ['Inscriptions ouvertes', 'bg-emerald-50 text-emerald-700'], 'complete' => ['Complète', 'bg-rose-50 text-rose-700'], ]; [$statusLabel, $statusClass] = $statusLabels[$session->status] ?? ['—', 'bg-slate-100 text-slate-600']; @endphp
{{ $session->title ?? 'Session' }} {{ $statusLabel }}
{{ $modeLabels[$session->mode] ?? $session->mode }} @if ($session->start_date) · du {{ $session->start_date->translatedFormat('d M Y') }} @if ($session->end_date) au {{ $session->end_date->translatedFormat('d M Y') }} @endif @endif @if ($session->location) · {{ $session->location }} @endif
@php $passPrice = $session->price_override ?? $session->formation?->price; $remaining = $session->remainingSeats(); $full = $session->isFull() || $session->status === 'complete'; $onWaitlist = auth()->check() && $session->waitlist()->where('user_id', auth()->id())->exists(); @endphp @if ($session->capacity) {{ $full ? 'Complet' : $remaining.' place'.($remaining > 1 ? 's' : '').' restante'.($remaining > 1 ? 's' : '') }} @endif @if (! in_array($session->status, ['annulee', 'terminee'], true)) @if (! $full) @auth
@csrf
@else Réserver une place @endauth @else {{-- Session complète : liste d'attente --}} @auth @if ($onWaitlist)
@csrf @method('DELETE')
@else
@csrf
@endif @else Liste d'attente @endauth @endif @endif