@extends('admin.layouts.app') @section('title', __('admin.committees.show_title', ['month' => $committee->monthLabel()]) . ' — ' . __('admin.brand.name')) @section('page_title', __('admin.committees.show_title', ['month' => $committee->monthLabel()])) @php use App\Models\Committee; use App\Models\CommitteeEvaluation; $isActive = $committee->status === Committee::STATUS_ACTIVE; // Localised day name + day-of-month for the calendar-style tile. $dayLabel = '—'; $dayNumber = '—'; $monthShort = '—'; if ($committee->meeting_date) { $locale = app()->getLocale(); $dayLabel = $locale === 'ar' ? $committee->meeting_date->locale('ar')->isoFormat('dddd') : $committee->meeting_date->format('l'); $dayNumber = $committee->meeting_date->format('d'); $monthShort = $locale === 'ar' ? $committee->meeting_date->locale('ar')->isoFormat('MMM') : $committee->meeting_date->format('M'); } $optName = function ($opt) { if (! $opt) return null; $loc = app()->getLocale(); return $loc === 'ar' ? ($opt->name_ar ?: $opt->name_en) : ($opt->name_en ?: $opt->name_ar); }; $initialsOf = 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)); }; // Investor avatar resolver — checks the avatar_path column on the // public disk. Falls back to initials when no image. $investorAvatarUrl = function ($member) { if (! empty($member->avatar_path)) { return \Illuminate\Support\Facades\Storage::disk('public')->url($member->avatar_path); } return null; }; // Startup logo resolver — picks the first image-type file off the // already-eager-loaded `files` relation. $startupLogoUrl = function ($startup) { $logo = $startup->files->firstWhere('file_type', \App\Models\File::TYPE_IMAGE); return $logo ? route('admin.files.show', $logo) : null; }; // Convert the evaluations Eloquent collection into a plain // structure the Alpine matrix can read on init. $matrixSeed = []; foreach ($committee->startups as $stp) { $matrixSeed[$stp->id] = []; foreach ($committee->investors as $mem) { $key = $stp->id . ':' . $mem->id; $matrixSeed[$stp->id][$mem->id] = $evaluationsByCell[$key] ?? ''; } } $summarySeed = []; foreach ($committee->startups as $stp) { $summarySeed[$stp->id] = [ 'pass' => (int) ($evaluationsByStartup[$stp->id]['pass'] ?? 0), 'fail' => (int) ($evaluationsByStartup[$stp->id]['fail'] ?? 0), ]; } @endphp @push('styles') @endpush @section('content')
{{-- Hero strip was merged INTO the Overview card header — Back + Edit now sit in the same .rd-card__meta slot as the chevron would, so the two original sections collapse to one. --}} @include('admin.partials.flash') {{-- ═════════ 1. Overview (merged with hero actions) ═════════ Always open — no data-collapse-key, no chevron, the header renders as a
instead of a @else @endif
{{ __('admin.committees.fields.startups_count') }} {{ $committee->startups->count() }}
{{ __('admin.committees.fields.members_count') }} {{ $committee->investors->count() }}
{{ __('admin.committees.fields.status') }} {{ $isActive ? __('admin.committees.status.active') : __('admin.committees.status.expired') }}
{{-- Sticky section nav — lives BETWEEN Overview and the rest of the sections so admins always see the high-level summary first, then the in-page jump bar. IntersectionObserver flips data-active as the user scrolls. --}} {{-- ═════════ 2. Attendance (members + startups, merged) ═════════ Was previously four sections: Members, Startups, Members Attendance, Startups Attendance. Collapsed into ONE per UX spec — admins now see both rosters with their attendance controls stacked, no jumping between sections. --}}

{{ __('admin.committees.attendance_section.members_title') }} ({{ $committee->investors->count() }})

@include('admin.committees.partials.investor-attendance', [ 'committee' => $committee, 'investorAttendances' => $investorAttendances, 'hideOwnTitle' => true, ])

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

@include('admin.committees.partials.startup-attendance', [ 'committee' => $committee, 'startupAttendances' => $startupAttendances, 'hideOwnTitle' => true, ])
{{-- Section 3 (Startups list) was folded into the Attendance section above — the startup table there now carries logo + slot range + sector + contact + status select all in one row. --}} {{-- ═════════ 4. Evaluations ═════════ --}}
@if ($committee->investors->isEmpty())
{{ __('admin.committees.evaluations.empty_members') }}
@elseif ($committee->startups->isEmpty())
{{ __('admin.committees.evaluations.empty_startups') }}
@else
@foreach ($committee->investors as $member) {{-- Evaluations header now shows the investor NAME instead of the avatar (2026-06). `display_name` is the locale-aware accessor (full_name_ → first+last → email) so it never blanks out. --}} @endforeach @foreach ($committee->startups as $startup) @php $logo = $startupLogoUrl($startup); @endphp @foreach ($committee->investors as $member) @endforeach @endforeach
{{ __('admin.committees.evaluations.startup') }} {{ $member->display_name }}
@if ($logo){{ $startup->display_name }}@else{{ $initialsOf($startup->display_name) }}@endif
@php $secondaryName = app()->getLocale() === 'ar' ? $startup->name_en : $startup->name; @endphp
{{ $startup->display_name }}
@if ($secondaryName && $secondaryName !== $startup->display_name)
{{ $secondaryName }}
@endif

{{ __('admin.committees.evaluations.summary_title') }}

@endif
{{-- Sections 5 + 6 (Startups Attendance + Members Attendance) were folded into the Attendance section above — both partials are now stacked inside that single collapsible card. --}} {{-- ═════════ 7. Member Notes on Startups ═════════ --}}
@include('admin.committees.partials.investor-notes', [ 'committee' => $committee, 'investorNotesByStartup' => $investorNotesByStartup, 'hideOwnTitle' => true, ])
{{-- ═════════ 6. Committee Notes — LAST per UX spec ═════════ --}}
@endsection @push('scripts') @endpush