@extends('admin.layouts.app') @section('title', ($isEdit ? __('admin.committees.edit') : __('admin.committees.create')) . ' — ' . __('admin.brand.name')) @section('page_title', $isEdit ? __('admin.committees.edit') : __('admin.committees.create')) @push('styles') @endpush @section('content') {{ __('admin.committees.back_to_list') }} @include('admin.partials.flash')
@if (isset($errors) && $errors->any()) @endif
@csrf @if ($isEdit) @method('PUT') @endif {{-- 1. Meeting Date + Time --}}
{{ __('admin.committees.sections.general') }}
@php $dateVal = old( 'meeting_date', $committee->meeting_date instanceof \Carbon\Carbon ? $committee->meeting_date->format('Y-m-d') : (string) $committee->meeting_date ); @endphp

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

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

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

{{-- 2. Slot manager — Alpine.js + SortableJS. Each row carries startup_id + start_time + end_time. The array order = slot_order (controller's prepareForValidation re-stamps it on submit). end_time auto-suggests start + SLOT_DEFAULT_DURATION_MINUTES on first edit but stops as soon as the admin types an explicit end. --}}
{{ __('admin.committees.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
{{-- Default slot duration — Alpine-local control. NOT a submitted field (no `name=` attribute) since the duration only drives the client-side auto-suggest / cascade logic. Server stores explicit start/end per slot, so duration is purely a UX helper. --}}
{{ __('admin.committees.help.minutes') }}

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

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

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

{{-- 3. Investors --}}

{{ __('admin.committees.help.investors_filter') }}

{{-- 4. Meeting URL --}}
@error('meeting_url'){{ $message }}@enderror

{{ __('admin.committees.help.meeting_url') }}

{{ __('admin.actions.cancel') }}
@endsection @push('scripts') {{-- SortableJS for drag-and-drop slot reordering. CDN-loaded same as Alpine + Select2 — no Vite build needed. --}} @endpush