{{-- Startups attendance table — props: $committee : Committee $startupAttendances : Collection keyed by startup_id (may be empty) $hideOwnTitle? : true → no

, consumer renders its own header Single admin lane only (no public self-toggle exists for startups). Columns: Logo + Name (+ slot range / sector meta) + Attendance status (admin-controlled select). Phone + email were dropped in 2026-06; the row's name link leads to the startup show page where contacts are one click away. --}} @php use App\Models\CommitteeStartupAttendance; $labels = [ CommitteeStartupAttendance::STATUS_PENDING => __('admin.committees.attendance.startup.pending'), CommitteeStartupAttendance::STATUS_ATTENDED => __('admin.committees.attendance.startup.attended'), CommitteeStartupAttendance::STATUS_DID_NOT_ATTEND => __('admin.committees.attendance.startup.did_not_attend'), ]; $initialsOfStp = function (?string $name): string { $name = trim((string) $name); if ($name === '') return '—'; $parts = preg_split('/\s+/u', $name); return mb_strtoupper(mb_substr($parts[0] ?? '', 0, 1) . mb_substr($parts[1] ?? '', 0, 1)); }; $optLabelStp = function ($opt) { if (! $opt) return null; $loc = app()->getLocale(); return $loc === 'ar' ? ($opt->name_ar ?: $opt->name_en) : ($opt->name_en ?: $opt->name_ar); }; @endphp @php $hideOwnTitle = $hideOwnTitle ?? false; @endphp
@if (! $hideOwnTitle)

{{ __('admin.committees.fields.startups') }} ({{ $committee->startups->count() }})

@endif
@if ($committee->startups->isEmpty())
—
@else
@foreach ($committee->startups as $startup) @php $row = $startupAttendances->get($startup->id); $current = $row?->status ?? CommitteeStartupAttendance::STATUS_PENDING; $logo = $startup->files ? $startup->files->firstWhere('file_type', \App\Models\File::TYPE_IMAGE) : null; $logoUrl = $logo ? route('admin.files.show', $logo) : null; $sector = $optLabelStp($startup->sector ?? null); $slotStart = $startup->pivot?->start_time ?? null; $slotEnd = $startup->pivot?->end_time ?? null; $slotRange = ($slotStart && $slotEnd) ? substr($slotStart, 0, 5) . ' → ' . substr($slotEnd, 0, 5) : null; @endphp @endforeach
  {{ __('admin.committees.attendance.columns.startup') }} {{ __('admin.committees.attendance.columns.startup_attendance') }}
@if ($logoUrl) @else {{ $initialsOfStp($startup->name) }} @endif {{ $startup->name ?: '—' }} @if ($slotRange || $sector)
@if ($slotRange) {{ $slotRange }} @endif @if ($sector) {{ $sector }} @endif
@endif
✓ {{ __('admin.committees.attendance.saved') }} ! {{ __('admin.committees.attendance.save_failed') }}
@endif
@once @push('scripts') @endpush @endonce