@php // Obtener businessConfig primero $businessConfig = $invitation->user->businessConfig ?? null; // Obtener solo 3 colores personalizados del negocio o usar valores por defecto $primaryColor = $businessConfig->primary_color ?? '#25a18e'; $secondaryColor = $businessConfig->secondary_color ?? '#004643'; $accentColor = $businessConfig->accent_color ?? '#f9bc60'; @endphp
@php // $businessConfig ya está definido en el $businessLogo = $businessConfig && $businessConfig->logo ? $businessConfig->logo : null; $businessName = $invitation->user->name ?? 'EventDate'; // Remover el prefijo 'public/' si existe para generar la URL correcta if ($businessLogo) { $businessLogo = str_starts_with($businessLogo, 'public/') ? substr($businessLogo, 7) : $businessLogo; } @endphp @if($businessLogo) @else @endif

Completá los Detalles de tu Invitación

@if ($errors->any())
Por favor corregí los siguientes errores:
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
@csrf {{-- Información del Evento (No Editable) --}}

{{ $invitation->title }}

Fecha del Evento {{ $invitation->event_date ? $invitation->event_date->format('d/m/Y') : 'No especificada' }}
Tipo de Evento {{ $type->name ?? 'No especificado' }}
Plan de Invitación {{ $plan->name ?? 'No especificado' }}
Plantilla {{ $invitation->template->name ?? 'No especificada' }}
{{-- Barra de Progreso --}}
Paso 1: Lo Esencial para tus Invitados
1 de 3
{{-- Secciones Dinámicas según el Plan organizadas en pasos --}} @if($sections && $sections->count() > 0) @php // Definir las secciones por paso en el orden exacto deseado $step1Sections = ['stunning_cover', 'itinerary', 'countdown', 'attendance_confirmation', 'multi_language']; $step2Sections = ['custom_phrase', 'photo_gallery', 'video_summary', 'music_in_invitation', 'event_data']; $step3Sections = ['dress_code', 'gift_table', 'accommodation_recommendations', 'transportation_recommendations', 'instagram', 'hashtag']; // Crear un mapa de secciones por código para acceso rápido $sectionsByCode = $sections->keyBy('code'); // Organizar secciones por paso manteniendo el orden especificado $sectionsByStep = [ 1 => collect($step1Sections)->map(fn($code) => $sectionsByCode->get($code))->filter(), 2 => collect($step2Sections)->map(fn($code) => $sectionsByCode->get($code))->filter(), 3 => collect($step3Sections)->map(fn($code) => $sectionsByCode->get($code))->filter(), ]; $stepTitles = [ 1 => 'Lo Esencial para tus Invitados', 2 => 'La Esencia de tu Evento', 3 => 'Cero Dudas, Máxima Diversión', ]; @endphp @foreach($sectionsByStep as $stepNumber => $stepSections) @if($stepSections->count() > 0)
@foreach($stepSections as $index => $section) @php $sectionId = 'section-' . $section->id; $publicPartial = 'public.form-sections.' . str_replace('_', '-', $section->code . '-form'); $hasPublicPartial = view()->exists($publicPartial); // Determinar si la sección tiene datos cargados $sectionHasData = false; // Mapear códigos de sección a campos que indican datos $sectionFieldMap = [ 'stunning_cover' => ['title', 'subtitle', 'backgroundImage'], 'countdown' => ['countdown'], 'greetings' => ['greetingTitle', 'greetingHeader'], 'custom_phrase' => ['customPhrase'], 'dress_code' => ['dressCodeTitle', 'dressCodeText', 'dressCode', 'dressName'], 'godparents' => ['godparentName0'], 'witnesses' => ['witnessName0'], ]; // Verificar si la sección tiene datos en variables if (isset($sectionFieldMap[$section->code])) { foreach ($sectionFieldMap[$section->code] as $field) { if (!empty($form[$field])) { $sectionHasData = true; break; } } } // Verificar galerías de fotos (relación con invitation_photos) if (in_array($section->code, ['photo_gallery', 'event_photos'])) { if ($invitation->gallery && $invitation->gallery->count() > 0) { $sectionHasData = true; } } // Abrir por defecto si tiene datos o si es la primera sección $shouldExpand = $sectionHasData || $index === 0; @endphp

@if($hasPublicPartial) @include($publicPartial) @else @include('public.form-sections._fallback', ['section' => $section]) @endif
@endforeach
{{-- Botones de Navegación --}}
@if($stepNumber < 3) @else @endif
@endif @endforeach @endif