@extends('admin.layouts.app') @section('title', __('admin.meetings_admin.list_title') . ' — ' . __('admin.brand.name')) @section('page_title', __('admin.meetings_admin.list_title')) @php use App\Models\Meeting; $dash = '—'; // Status palette — Green=Confirmed, Yellow=Pending, Red=Cancelled, // Blue=Completed, Slate=No-show. Matches the spec for the new column. $statusColors = [ Meeting::STATUS_CONFIRMED => '#10b981', Meeting::STATUS_PENDING => '#f59e0b', Meeting::STATUS_CANCELLED => '#ef4444', Meeting::STATUS_COMPLETED => '#0ea5e9', Meeting::STATUS_NO_SHOW => '#64748b', ]; $typeOptions = collect(Meeting::types()) ->mapWithKeys(fn ($k) => [$k => __('admin.meetings_admin.types.' . $k)]) ->all(); $statusOptions = collect(Meeting::statuses()) ->mapWithKeys(fn ($k) => [$k => __('admin.meetings_admin.statuses.' . $k)]) ->all(); $attendanceOptions = collect(Meeting::attendanceOptions()) ->mapWithKeys(fn ($k) => [$k => __('admin.meetings_admin.attendances.' . $k)]) ->all(); // Build href helpers for the chip strip — preserve everything EXCEPT // date_from / date_to / date_preset / page, so a chip click cleanly // overrides the date scope. $chipBase = collect(request()->query()) ->except(['date_from', 'date_to', 'date_preset', 'page']) ->all(); $hrefForPreset = function (?string $preset) use ($chipBase) { $qs = $preset === null ? $chipBase : array_merge($chipBase, ['date_preset' => $preset]); return url()->current() . ($qs === [] ? '' : '?' . http_build_query($qs)); }; @endphp @push('styles') @endpush @section('content') @include('admin.partials.flash') {{-- ────────────── Quick date preset chips ────────────── Today / Tomorrow / This Week / This Month. Clicking a chip filters server-side via ?date_preset=... which overrides any manual date_from / date_to set in the panel below. --}}
{{ __('admin.meetings_admin.date_presets.all') }} {{ __('admin.meetings_admin.date_presets.today') }} {{ __('admin.meetings_admin.date_presets.tomorrow') }} {{ __('admin.meetings_admin.date_presets.week') }} {{ __('admin.meetings_admin.date_presets.month') }}
@foreach (request()->only(['q', 'sort', 'dir', 'date_preset']) as $key => $value) @endforeach
@if ($meetings->isEmpty()) @else
{{-- Replaces the old "type" badge — attendance is the column admins glance at when triaging meetings. --}} @foreach ($meetings as $meeting) @endforeach
{{ __('admin.meetings_admin.fields.customer_name') }} {{ __('admin.meetings_admin.fields.customer_email') }}{{ __('admin.meetings_admin.fields.attendance_status') }} {{ __('admin.meetings_admin.fields.status') }} {{ __('admin.meetings_admin.fields.title') }} {{ __('admin.fields.actions') }}
{{ $meeting->meeting_date?->format('Y-m-d') ?: $dash }} @if ($meeting->start_time)
{{ $meeting->localStart?->format('H:i') }}@if ($meeting->end_time) – {{ $meeting->localEnd?->format('H:i') }}@endif
@endif
{{-- Locale-aware owner name (AR/EN with cross-locale fallback) → Bookings snapshot → dash. The investor `name` column was dropped in the 2026-06-09 refactor; Meeting::ownerDisplayName() is the single source. --}} {{ $meeting->ownerDisplayName() ?: $dash }} @if ($meeting->customer_email) {{ $meeting->customer_email }} @else {{ $dash }} @endif @include('admin.partials.attendance-badge', ['status' => $meeting->attendance_status]) {{ $meeting->title ?: $dash }} @if ($meeting->created_at) {{ $meeting->created_at->format('Y-m-d') }} {{ $meeting->created_at->format('H:i') }} @else {{ $dash }} @endif {{-- Edit attendance + notes inline (opens the shared attendance modal). Sits BEFORE the view icon because it's the more common action — admins look at meetings to mark attendance, then occasionally drill in. The subject type/name pair tells the modal whether to label its row "Investor" or "Startup". For a startup meeting we prefer the linked startup's official name; for an investor meeting we use `customer_name` (already the investor's display name in the Bookings webhook). --}} @php $isStartupMeeting = $meeting->meetingable_type === \App\Models\Startup::class; $subjectType = $isStartupMeeting ? 'startup' : 'investor'; // Locale-aware owner name with cross-locale fallback, // then the Bookings snapshot — same single source as the // name column above. (Legacy `name` column was dropped.) $subjectName = $meeting->ownerDisplayName() ?: $meeting->customer_name; @endphp
{{ $meetings->links() }}
@endif
{{-- Shared attendance + notes modal (used by the attendance icon on every row). One DOM instance for the whole index page. --}} @include('admin.partials.attendance-modal') @push('scripts') @endpush @endsection