@php /** @var \App\Models\Event $event */ /** @var \Illuminate\Support\Collection $people */ $shifts = $event->shifts; @endphp
{{ __('shifts.title') }} ({{ $shifts->count() }})
@if($errors->any())
@foreach($errors->all() as $err)
{{ $err }}
@endforeach
@endif @if($shifts->isEmpty())

{{ __('shifts.empty') }}

{{ __('shifts.empty_hint') }}

@else
@foreach($shifts as $shift) @php $confirmedCount = $shift->signups->where('status', 'confirmed')->count(); $waitlistedCount = $shift->signups->where('status', 'waitlisted')->count(); $pct = $shift->slots > 0 ? min(100, round(($confirmedCount / $shift->slots) * 100)) : 0; $isFull = $confirmedCount >= $shift->slots; @endphp

{{ $shift->title }}

@if($isFull) {{ __('shifts.full') }} @endif
{{ $shift->starts_at->format('Y. m. d. H:i') }} – {{ $shift->ends_at->format('H:i') }} @if($shift->location) {{ $shift->location }} @endif
@if($shift->description)

{{ $shift->description }}

@endif
@csrf @method('DELETE')
{{-- Capacity bar --}}
{{ __('shifts.filled') }}: {{ $confirmedCount }} / {{ $shift->slots }} @if($waitlistedCount > 0) {{ __('shifts.waitlist') }}: {{ $waitlistedCount }} @endif
{{-- Signups list --}} @if($shift->signups->isNotEmpty())
@foreach($shift->signups->sortBy('created_at') as $signup) @php $statusColors = [ 'confirmed' => ['bg' => '#e9f7f4', 'color' => '#0ab39c'], 'waitlisted' => ['bg' => '#fff8e9', 'color' => '#f7b84b'], 'cancelled' => ['bg' => '#f8f9fa', 'color' => '#adb5bd'], ]; $sc = $statusColors[$signup->status] ?? $statusColors['confirmed']; @endphp
@if($signup->person) {{ $signup->person->last_name }} {{ $signup->person->first_name }} @else @endif {{ __('shifts.status.' . $signup->status) }} @if($signup->notes) — {{ $signup->notes }} @endif
{{-- Attended toggle --}}
@csrf @method('PATCH')
@csrf @method('DELETE')
@endforeach
@endif
@endforeach
@endif
{{-- ── NEW / EDIT SHIFT MODAL ─────────────────────────── --}}
{{ __('shifts.new') }}
@csrf
{{-- ── ADD SIGNUP MODAL ──────────────────────────────── --}}
{{ __('shifts.add_signup_title') }} —
@csrf
@push('scripts') @endpush