@php $seoEventTitle = $event->title . ' — ' . config('app.name'); $seoEventDesc = $event->tagline ? Str::limit($event->tagline, 155) : ($event->description ? Str::limit(strip_tags($event->description), 155) : null); $jsonLdEvent = array_filter([ '@context' => 'https://schema.org', '@type' => 'Event', 'name' => $event->title, 'description' => $seoEventDesc, 'startDate' => $event->starts_at?->toAtomString(), 'endDate' => $event->ends_at?->toAtomString(), 'url' => route('events.show', $event), 'location' => $event->location ? [ '@type' => 'Place', 'name' => $event->location, ] : ['@type' => 'VirtualLocation'], 'organizer' => $event->organiser ? [ '@type' => 'Person', 'name' => $event->organiser->name, ] : null, 'eventStatus' => 'https://schema.org/EventScheduled', 'eventAttendanceMode' => 'https://schema.org/OfflineEventAttendanceMode', ]); @endphp @push('seo') @endpush {{-- No header slot — hero takes full width --}} @php $organiser = $event->organiser; $proProfile = $organiser->proProfile ?? null; $embed = request()->boolean('embed'); $accentHex = $event->accent_color ?? null; $hasBg = $event->bg_gradient_from || $event->bg_color; // Build CSS for page background override (only applied in embed or when bg set) if ($event->bg_gradient_from && $event->bg_gradient_to) { $pageBgStyle = "background: linear-gradient(135deg, {$event->bg_gradient_from} 0%, {$event->bg_gradient_to} 100%)"; } elseif ($event->bg_color) { $pageBgStyle = "background-color: {$event->bg_color}"; } else { $pageBgStyle = null; } $modalityIcons = [ 'in_person' => '📍', 'online' => '💻', 'hybrid' => '🔀', ]; $typeLabels = [ 'fun_activity' => __('Fun activity'), 'online_meeting' => __('Online meeting'), 'peer_support' => __('Peer support'), 'lecture' => __('Lecture / Talk'), 'workshop' => __('Workshop'), 'walk' => __('Walk / Hike'), 'game_night' => __('Game night'), 'creative' => __('Creative / Arts'), 'food_drinks' => __('Food & drinks'), 'sport' => __('Sport & movement'), 'meet_greet' => __('Meet & greet'), ]; $spotsLeft = $event->spotsLeft(); // Card header tint — derived from event background color $primaryHex = $event->bg_gradient_from ?? $event->bg_color ?? null; $ecHeaderBg = $ecHeaderDarkBg = null; if ($primaryHex) { $phex = ltrim($primaryHex, '#'); $pr = hexdec(substr($phex, 0, 2)); $pg = hexdec(substr($phex, 2, 2)); $pb = hexdec(substr($phex, 4, 2)); // Light mode: 28% color blended with white $lhr = (int) round($pr * 0.28 + 255 * 0.72); $lhg = (int) round($pg * 0.28 + 255 * 0.72); $lhb = (int) round($pb * 0.28 + 255 * 0.72); $ecHeaderBg = "rgb($lhr,$lhg,$lhb)"; // Determine if tint is dark enough to need white text $ecHeaderLight = (0.299 * $lhr + 0.587 * $lhg + 0.114 * $lhb) / 255 > 0.5; // Dark mode: 38% color blended with gray-800 (31,41,55) $dhr = (int) round($pr * 0.38 + 31 * 0.62); $dhg = (int) round($pg * 0.38 + 41 * 0.62); $dhb = (int) round($pb * 0.38 + 55 * 0.62); $ecHeaderDarkBg = "rgb($dhr,$dhg,$dhb)"; $ecHeaderDarkLight = (0.299 * $dhr + 0.587 * $dhg + 0.114 * $dhb) / 255 > 0.45; } @endphp @if ($pageBgStyle) @endif @if ($embed)
{{ __('Open in ND-Link') }} ↗
@endif
{{-- Flash messages --}} @foreach ([ 'registered' => __('You are registered!'), 'registration-cancelled' => __('Your registration has been cancelled.'), 'event-created' => __('Event created successfully.'), 'event-updated' => __('Event updated.'), ] as $key => $msg) @if (session('status') === $key)
{{ $msg }}
@endif @endforeach @if (session('error'))
{{ session('error') }}
@endif @foreach (['invite-accepted' => __('You are going!'), 'invite-declined' => __('You have declined the invitation.')] as $key => $msg) @if (session('status') === $key)
{{ $msg }}
@endif @endforeach {{-- ═══════════════════════════════════════════════════════ --}} {{-- A. Cover image (smaller) --}} {{-- ═══════════════════════════════════════════════════════ --}} @if ($event->cover_image)
{{ $event->title }}
@endif {{-- ═══════════════════════════════════════════════════════ --}} {{-- B. Event info card (FIRST) — naam, datum, locatie --}} {{-- ═══════════════════════════════════════════════════════ --}}
{{-- Card header: titel, tagline, organisator, badges --}}

{{ $event->title }}

@if ($event->tagline)

{{ $event->tagline }}

@endif

{{ __('By') }} {{ $proProfile?->organization_name ?? $organiser->name }}


@if ($event->nd_friendly) 🧠 {{ __('ND-friendly') }} @endif @if ($event->event_type && isset($typeLabels[$event->event_type])) {{ $typeLabels[$event->event_type] }} @endif @if ($event->event_modality) {{ $modalityIcons[$event->event_modality] ?? '' }} {{ __($event->event_modality) }} @endif @if ($event->is_private) 🔒 {{ __('Private') }} @endif @if ($event->group) 👥 {{ $event->group->name }} @endif
{{-- Date & time --}}
📅

{{ $event->starts_at->translatedFormat('l j F Y') }}

{{ $event->starts_at->format('H:i') }} @if ($event->ends_at) – {{ $event->ends_at->format('H:i') }} @if ($event->ends_at->isNextDay($event->starts_at)) ({{ $event->ends_at->translatedFormat('j F') }}) @endif @endif

{{-- Location + map link --}} @if ($event->location || $event->address)
📍
@if ($event->location)

{{ $event->location }}

@endif @if ($event->address)

{{ $event->address }}

@endif @php $mapQuery = urlencode(trim(($event->address ?? '') . ' ' . ($event->location ?? ''))); @endphp @if ($mapQuery) 🗺 {{ __('Show on map') }} @endif
@endif {{-- Online URL --}} @if ($event->online_url && in_array($event->event_modality, ['online', 'hybrid']))
💻

{{ __('Online') }}

{{ $event->online_url }}
@endif {{-- Contact --}} @if ($event->contact_email)
✉️

{{ __('Contact') }}

{{ $event->contact_email }}
@endif {{-- Website --}} @if ($event->website_url)
🌐

{{ __('Website') }}

{{ $event->website_url }}
@endif
{{-- ═══════════════════════════════════════════════════════ --}} {{-- C. Organiser card --}} {{-- ═══════════════════════════════════════════════════════ --}}
{{-- Header: avatar + name --}}
@if ($organiser->primaryPhoto) {{ $organiser->name }} @elseif ($proProfile && $proProfile->logo_path) {{ $proProfile->organization_name ?? $organiser->name }} @else
{{ strtoupper(substr($organiser->name, 0, 1)) }}
@endif
{{ $proProfile?->organization_name ?? $organiser->name }} @if ($proProfile?->organization_name) – {{ $organiser->name }} @endif #{{ $organiser->id }} @if ($isOrganiser) {{ __('You') }} @endif
@if ($proProfile && ($proProfile->city || $proProfile->country))

📍 {{ collect([$proProfile->city, $proProfile->country])->filter()->implode(', ') }}

@endif
{{-- Body: contact info + links --}}
@if ($proProfile && $proProfile->contact_email)

✉️ {{ $proProfile->contact_email }}

@endif @if ($proProfile && $proProfile->website)

🌐 {{ $proProfile->website }}

@endif
{{-- Organiser action buttons — own row, always below info --}} @if ($isOrganiser)
@if ($event->registration_required) 📊 {{ __('Registrations') }} @if ($confirmedCount > 0) {{ $confirmedCount }} @endif @endif ✏️ {{ __('Edit') }} @if (auth()->user()?->is_pro) 🏷 {{ __('Discount codes') }} @endif 📋 {{ __('Copy') }}
@csrf @method('DELETE')
@endif
{{-- ═══════════════════════════════════════════════════════ --}} {{-- D. Description + What to expect --}} {{-- ═══════════════════════════════════════════════════════ --}} @if ($event->description || $event->what_to_expect)
@if ($event->description)

{{ __('About this event') }}

{!! str_contains($event->description, '<') ? $event->description : nl2br(e($event->description)) !!}
@endif @if ($event->what_to_expect)

{{ __('What to expect') }}

{!! str_contains($event->what_to_expect, '<') ? $event->what_to_expect : nl2br(e($event->what_to_expect)) !!}
@endif
@endif {{-- ═══════════════════════════════════════════════════════ --}} {{-- E. ND profile + sensory info --}} {{-- ═══════════════════════════════════════════════════════ --}} @php $hasSensory = $event->sensory_noise || $event->sensory_lighting || $event->sensory_crowd || $event->communication_style || $event->social_pressure || $event->quiet_space || $event->sensory_notes; @endphp @if ($event->nd_friendly || $hasSensory)

🧠 {{ __('ND profile') }}

{{-- ND-friendly badge --}} @if ($event->nd_friendly)
🧠 {{ __('ND-friendly') }} {{ __('This event is welcoming and adapted for neurodivergent participants.') }}
@endif @if ($hasSensory)

{{ __('Sensory profile') }}

@php $sensoryDisplay = [ 'sensory_noise' => [ 'icon' => '🔊', 'label' => __('Noise'), 'values' => ['quiet' => ['label' => __('Quiet'), 'color' => 'green'], 'moderate' => ['label' => __('Moderate'), 'color' => 'amber'], 'loud' => ['label' => __('Loud'), 'color' => 'red']], ], 'sensory_lighting' => [ 'icon' => '💡', 'label' => __('Lighting'), 'values' => ['dim' => ['label' => __('Dim'), 'color' => 'blue'], 'normal' => ['label' => __('Normal'), 'color' => 'gray'], 'bright' => ['label' => __('Bright'), 'color' => 'amber']], ], 'sensory_crowd' => [ 'icon' => '👥', 'label' => __('Crowd'), 'values' => ['small' => ['label' => __('Small'), 'color' => 'green'], 'medium' => ['label' => __('Medium'), 'color' => 'amber'], 'large' => ['label' => __('Large'), 'color' => 'red']], ], 'communication_style' => [ 'icon' => '💬', 'label' => __('Communication'), 'values' => ['verbal' => ['label' => __('Verbal'), 'color' => 'indigo'], 'written' => ['label' => __('Written'), 'color' => 'indigo'], 'mixed' => ['label' => __('Mixed'), 'color' => 'indigo'], 'open' => ['label' => __('Open / flexible'), 'color' => 'green']], ], 'social_pressure' => [ 'icon' => '🤝', 'label' => __('Social pressure'), 'values' => ['low' => ['label' => __('Low'), 'color' => 'green'], 'medium' => ['label' => __('Medium'), 'color' => 'amber'], 'high' => ['label' => __('High'), 'color' => 'red']], ], ]; $colorMap = [ 'green' => 'bg-green-50 text-green-700 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-700', 'amber' => 'bg-amber-50 text-amber-700 border-amber-200 dark:bg-amber-900/30 dark:text-amber-300 dark:border-amber-700', 'red' => 'bg-red-50 text-red-700 border-red-200 dark:bg-red-900/30 dark:text-red-300 dark:border-red-700', 'blue' => 'bg-blue-50 text-blue-700 border-blue-200 dark:bg-blue-900/30 dark:text-blue-300 dark:border-blue-700', 'indigo'=> 'bg-indigo-50 text-indigo-700 border-indigo-200 dark:bg-indigo-900/30 dark:text-indigo-300 dark:border-indigo-700', 'gray' => 'bg-gray-50 text-gray-700 border-gray-200 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-600', ]; @endphp
@foreach ($sensoryDisplay as $field => $cfg) @if ($event->$field) @php $val = $cfg['values'][$event->$field] ?? null; @endphp @if ($val) {{ $cfg['icon'] }} {{ $cfg['label'] }}: {{ $val['label'] }} @endif @endif @endforeach @if ($event->quiet_space) 🔕 {{ __('Quiet space available') }} @endif
@if ($event->sensory_notes)

{{ $event->sensory_notes }}

@endif @endif
{{-- /px-5 py-4 --}}
@endif {{-- ═══════════════════════════════════════════════════════ --}} {{-- F. Registration section --}} {{-- ═══════════════════════════════════════════════════════ --}} @if ($event->registration_required)

{{ __('Registration') }}

{{-- Capacity bar --}} @if ($event->max_attendees !== null && $isOrganiser) @php $pct = min(100, round($confirmedCount / max(1, $event->max_attendees) * 100)); @endphp
{{ $confirmedCount }} / {{ $event->max_attendees }} {{ __('spots filled') }} {{ $spotsLeft !== null && $spotsLeft > 0 ? trans_choice(':count spot left|:count spots left', $spotsLeft) : __('Fully booked') }}
@endif {{-- Registration closes notice --}} @if ($event->registration_closes_at && now()->isBefore($event->registration_closes_at))

⏰ {{ __('Registration closes') }}: {{ $event->registration_closes_at->translatedFormat('j F Y H:i') }}

@elseif ($event->registration_closes_at && now()->isAfter($event->registration_closes_at))

{{ __('Registration has closed.') }}

@endif @php $isPaidEvent = $event->registration_price !== null && (float) $event->registration_price > 0; $registrationOpen = ! ($event->registration_closes_at && now()->isAfter($event->registration_closes_at)); $fullyBooked = $spotsLeft !== null && $spotsLeft <= 0; $isAdminOrganiser = $organiser->hasAdminAccess(); // Admin organizers: never add service fee on top of ticket price $buyerPrice = $isPaidEvent ? ($isAdminOrganiser ? (float) $event->registration_price : \App\Http\Controllers\EventRegistrationController::buyerAmount($event)) : 0; $basePrice = (float) ($event->registration_price ?? 0); $serviceFeeAdded = $isPaidEvent && ! $isAdminOrganiser && $event->service_fee_payer === 'buyer'; @endphp @if ($hasPendingRegistration) {{-- Payment started but not completed --}}
{{ __('Payment not completed') }}

{{ __('Your registration is reserved but not yet confirmed. Complete the payment to secure your spot.') }}

@csrf
@csrf @method('DELETE')
@elseif ($isRegistered) {{-- Already registered --}}
✓ {{ __('You are registered') }} @auth
@csrf @method('DELETE')
@endauth
@elseif (! $registrationOpen || $fullyBooked)

{{ $fullyBooked ? __('This event is fully booked.') : __('Registration has closed.') }}

@elseif (! $isPaidEvent) {{-- Free registration: auth users click directly, guests enter name + email --}} @auth
@csrf
@else
@csrf
@endauth @else {{-- Paid registration with coupon --}} @auth

€{{ number_format($buyerPrice, 2, ',', '.') }}

@if ($isAdminOrganiser)

✓ {{ __('Service cost included') }}

@elseif ($serviceFeeAdded)

{{ __('Incl. €:fee service fee', ['fee' => number_format($event->service_fee ?? config('services.ticketing.service_fee', 1.50), 2, ',', '.')]) }}

@endif
{{-- Coupon code --}}

✓ {{ __('Discount applied') }}

@csrf
@else {{-- Guest: show price + name/email form, direct checkout without account --}}

€{{ number_format($buyerPrice, 2, ',', '.') }}

@if ($serviceFeeAdded)

{{ __('Incl. €:fee service fee', ['fee' => number_format($event->service_fee ?? config('services.ticketing.service_fee', 1.50), 2, ',', '.')]) }}

@endif
@csrf
@endauth @endif
{{-- /px-5 py-5 --}}
@else {{-- No registration required: RSVP via invitation system --}} @auth @if (! $isOrganiser && $myInvite)

{{ __('Your invitation') }}

@if ($myInvite->status === 'invited')
@csrf
@csrf
@elseif ($myInvite->status === 'accepted') ✓ {{ __('Going') }}
@csrf
@elseif ($myInvite->status === 'declined') {{ __('You declined this invitation.') }}
@csrf
@endif
@endif @endauth @endif {{-- ═══════════════════════════════════════════════════════ --}} {{-- F. Attendees --}} {{-- ═══════════════════════════════════════════════════════ --}} @if ($accepted->isNotEmpty())

{{ __('Attendees') }} ({{ $accepted->count() }})

@foreach ($accepted->take(12) as $inv) @php $u = $inv->user; @endphp @if ($u->primaryPhoto) {{ $u->name }} @else
{{ strtoupper(substr($u->name, 0, 1)) }}
@endif {{ $u->name }}
@endforeach @if ($accepted->count() > 12)
+{{ $accepted->count() - 12 }}
@endif
{{-- /px-5 py-4 --}}
@endif {{-- ═══════════════════════════════════════════════════════ --}} {{-- G. Notification toggle --}} {{-- ═══════════════════════════════════════════════════════ --}} @auth @php $notifyBg = $ecHeaderBg ?? null; $notifyText = $notifyBg ? ($ecHeaderLight ? '#1f2937' : '#ffffff') : null; $notifyBgDark = $ecHeaderDarkBg ?? null; @endphp
@endauth {{-- ═══════════════════════════════════════════════════════ --}} {{-- I. Embed code (organiser only) --}} {{-- ═══════════════════════════════════════════════════════ --}} @if ($isOrganiser)

{{ __('Embed on your website') }}

{{ __('Copy this code and paste it into your website HTML.') }}

{{-- Language selector --}}
{{ __('Language') }}: @foreach(['nl' => 'NL', 'en' => 'EN', 'fr' => 'FR', 'de' => 'DE', 'es' => 'ES'] as $code => $label) @endforeach

{{ __('Preview') }}:

@endif {{-- ═══════════════════════════════════════════════════════ --}} {{-- I2. Kortingsaanvraag-link (organiser only) --}} {{-- ═══════════════════════════════════════════════════════ --}} @if ($isOrganiser) @php $orgLabels = \App\Models\ProCouponLabel::where('user_id', $event->user_id)->orderBy('name')->get(); $baseRequestUrl = route('coupon-request.create'); @endphp

{{ __('Discount request link') }}

{{ __('Share this link so visitors can request a personal discount code.') }}

{{-- % --}}
%
{{-- Scope selector --}}
@if($event->coupon_label_id) @endif @if($orgLabels->count() > 1) @endif
{{-- URL preview + copy --}}
@endif {{-- ═══════════════════════════════════════════════════════ --}} {{-- J. Organiser invite panel (only for organiser) --}} {{-- ═══════════════════════════════════════════════════════ --}} @if ($isOrganiser)

{{ __('Invite to event') }}

@if (session('status') === 'group-invited')

{{ trans_choice(':count member invited.|:count members invited.', session('invited_count', 0)) }}

@endif @error('invite')

{{ $message }}

@enderror
@csrf
@if ($inviteGroups->isEmpty())

{{ __('You are not a member of any group.') }}

@else
@csrf
@endif
@if ($event->invitations->isNotEmpty())
@foreach ($event->invitations as $inv)
@if ($inv->user->primaryPhoto) {{ $inv->user->name }} @else
{{ strtoupper(substr($inv->user->name, 0, 1)) }}
@endif {{ $inv->user->name }} {{ __($inv->status) }}
@endforeach
@endif
@endif {{-- ═══════════════════════════════════════════════════════ --}} {{-- H. Other events by same organiser --}} {{-- ═══════════════════════════════════════════════════════ --}} @if ($otherEvents->isNotEmpty()) @endif
@if (! $embed) @push('bottom-bar-buttons') {{-- Back --}} {{-- Share --}}
{{-- Register / registered state --}} @if ($event->registration_required && $registrationOpen && ! $fullyBooked && ! $isOrganiser) @if ($isRegistered) @else {{ __('Register') }}@if($isPaidEvent)  €{{ number_format($buyerPrice, 2, ',', '.') }}@endif @endif @endif {{-- Help --}}
{{ __('This is the public event page. Use the Share button to copy the link and share it via e-mail or social media. You can also embed this page on your own website using the iframe code (visible to the organiser). Registered participants receive event reminders when you enable notifications.') }}
@endpush @endif