@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')