{{-- Admin Demo create/edit form. MIRROR OF: admin.committees.form — same Alpine + SortableJS slot manager, same Select2 investor picker, same `.cmt-*` CSS surface for visual parity. Demo-specific additions: - Bilingual title (title_ar + title_en) - Type + Mode label_option selects - Optional cover image with live preview + remove/undo --}} @extends('admin.layouts.app') @section('title', ($isEdit ? __('admin.demos.edit.title') : __('admin.demos.create.title')) . ' — ' . __('admin.brand.name')) @section('page_title', $isEdit ? __('admin.demos.edit.title') : __('admin.demos.create.title')) @push('styles') @endpush @section('content') {{ __('admin.demos.back_to_list') }} @include('admin.partials.flash')
@if (isset($errors) && $errors->any()) @endif
@csrf @if ($isEdit) @method('PUT') @endif {{-- ── 1. Titles + classification ─────────────────────── --}}
{{ __('admin.demos.sections.identity') }}
{{-- TEMPORARILY DISABLED — Demo Type + Mode selects. Re-enable both
blocks below (kept verbatim inside this Blade comment) once the DemoRequest rules are switched back to `required + exists`. The controller already pass-throughs nulls + preserves existing values on edit, so saved demos keep their type/mode while the picker is offline.
@php $typeSelectOptions = $typeOptions->mapWithKeys(fn ($o) => [ (int) $o->id => app()->getLocale() === 'ar' ? $o->name_ar : $o->name_en, ])->all(); @endphp
@php $modeSelectOptions = $modeOptions->mapWithKeys(fn ($o) => [ (int) $o->id => app()->getLocale() === 'ar' ? $o->name_ar : $o->name_en, ])->all(); @endphp
--}}
{{-- ── 2. Cover image (optional) ──────────────────────── --}}
{{ __('admin.demos.fields.cover_image') }} — {{ __('admin.demos.fields.optional') }}

{{ __('admin.demos.fields.cover_image_hint') }}

{{-- ── 3. Scheduling ──────────────────────────────────── --}}
{{ __('admin.demos.sections.scheduling') }}
@php $dateVal = old( 'meeting_date', $demo->meeting_date instanceof \Carbon\Carbon ? $demo->meeting_date->format('Y-m-d') : (string) $demo->meeting_date ); @endphp

{{ __('admin.demos.help.meeting_date') }}

@php $timeRaw = (string) old('meeting_time', $demo->meeting_time ?? '19:30:00'); $timeVal = strlen($timeRaw) >= 5 ? substr($timeRaw, 0, 5) : '19:30'; @endphp

{{ __('admin.demos.help.meeting_time') }}

{{-- ── 4. Slot manager — Alpine + SortableJS ──────────── --}}
{{ __('admin.demos.sections.slots') }}
@php $startupsForJs = $startups->map(fn ($s) => [ 'id' => (int) $s->id, 'label' => $s->name . ($s->email ? ' — ' . $s->email : ''), ])->values()->all(); $initialSlots = old('slots', $slots); @endphp
{{ __('admin.demos.help.minutes') }}

{{ __('admin.demos.help.slot_duration') }}

{{ __('admin.demos.help.slots_empty') }}

{{ __('admin.demos.help.slots') }}

{{-- ── 5. Audience: groups (primary) + ad-hoc investors ── --}} {{-- The demo's audience is LIVE — picked groups expand to their current members at every read. Removing an investor from a group later drops them from this demo automatically (no edit required). The ad-hoc investor multi-select is for the niche case of pinning someone who isn't in any selected group. --}}

{{ __('admin.demos.help.groups') }}

{{ __('admin.demos.fields.investors_ad_hoc_toggle') }}

{{ __('admin.demos.help.investors_ad_hoc') }}

{{-- ── 6. Microsoft Teams Webinar ─────────────────────── --}} {{-- Numu creates + mirrors a Teams webinar from this demo. The manual meeting URL is retired; each confirmed investor gets their own join link ({{demo_join_url}}). Core, API-backed settings only. --}} @php $webinarRow = $demo->getKey() ? $demo->webinar : null; $ws = $webinarRow?->settings ?? []; $coOrgSaved = $webinarRow ? collect($webinarRow->co_organizers ?? [])->pluck('upn')->filter()->values()->all() : (array) config('demo_webinars.default_coorganizer_upns', []); $coOrgOptions = array_values(array_unique(array_merge( (array) config('demo_webinars.default_coorganizer_upns', []), $coOrgSaved, ))); $wval = fn ($k, $d = null) => old("webinar.$k", $ws[$k] ?? $d); $lblStyle = 'font-size:13px;font-weight:700;color:#334155;display:block;margin-bottom:4px;'; @endphp
{{ __('admin.demos.webinar.section') }}

{{ __('admin.demos.webinar.section_hint') }}

@unless (config('demo_webinars.enabled'))

{{ __('admin.demos.webinar.disabled') }}

@endunless
{{-- The Teams webinar title is ALWAYS the Demo's Title (English) — create, update and retry all send `title_en`. A separate, editable "webinar title" would silently do nothing, so the field is shown read-only, mirroring the value above. --}}

{{ __('admin.demos.webinar.fields.title_hint') }}

{{ __('admin.actions.cancel') }}
@endsection @push('scripts') @endpush