@extends('layouts.web') @section('content')
@if(isset($activity))

{{ data_get($activity,'title') ?? data_get($activity,'name') ?? 'Judul Kegiatan' }}

{{ data_get($activity,'location') ?? '' }}

@if(!empty($activity->date)) {{ $activity->date }} @endif @if(!empty($activity->location)) {{ $activity->location }} @endif @if(isset($activity->price)) @if(($activity->price ?? 0) > 0) Rp {{ number_format($activity->price, 0, ',', '.') }} @else GRATIS @endif @endif
@if(!empty($activity->description))

{{ \Illuminate\Support\Str::limit(strip_tags($activity->description), 200) }}

@endif
@endif
@php $authUser = auth()->user(); $profileIncomplete = $authUser && !empty($missingProfileFields ?? []); $profileComplete = $authUser && empty($missingProfileFields ?? []); @endphp
Galeri
@if(isset($activity) && auth()->check() && $activity->canManageRegistration(auth()->id())) @endif
@if(isset($activity)) @if(auth()->check() && $activity->canManageRegistration(auth()->id())) @endif @if(isset($activity->galleries) && count($activity->galleries))
@foreach($activity->galleries as $image) @endforeach
@else

Belum ada foto galeri yang ditambahkan.

@endif @else

Data kegiatan tidak tersedia.

@endif
Rating & Komentar
@php $ratingsQuery = isset($activity) ? $activity->allComments()->whereNull('parent_id')->whereNotNull('rating') : collect([]); $averageRating = isset($activity) ? $activity->averageRating() : 0; $ratingCounts = []; for ($i = 1; $i <= 5; $i++) { $ratingCounts[$i] = isset($activity) ? (clone $ratingsQuery)->where('rating', $i)->count() : 0; } $totalRatings = array_sum($ratingCounts); @endphp
{{ number_format($averageRating, 1) }}
Berdasarkan {{ $totalRatings }} rating
@for($i=1;$i<=5;$i++) @endfor
@for($i=5; $i>=1; $i--) @php $count = $ratingCounts[$i] ?? 0; $pct = $totalRatings > 0 ? round(($count / $totalRatings) * 100) : 0; @endphp
{{ $i }}
{{ $count }}
@endfor
@auth
@csrf
Berikan Rating
@for($i=1;$i<=5;$i++) @endfor
Pilih rating untuk aktivitas ini
Tambah Komentar
@else
Berikan Rating
@for($i=1;$i<=5;$i++) @endfor
Tambah Komentar
@endauth
Semua Komentar
@forelse(($activity->comments ?? collect()) as $comment) @php $isRatingOnly = ($comment->rating ?? null) && empty(trim($comment->body ?? '')); @endphp @if($isRatingOnly) @continue @endif @include('partials.activity_comment_item', ['comment' => $comment, 'activity' => $activity]) @empty
Belum ada komentar.
@endforelse
Daftar Peserta
@php $activityPrice = (int) ($activity->price ?? 0); $registrationStatus = (int) ($activity->pendaftaran ?? 1); $alreadyParticipant = (($currentStatus ?? null) === 'enrolled') || ($isJoined ?? false) || ((isset($enrollmentStatus) && $enrollmentStatus === \App\Models\ActivityUser::STATUS_ACTIVE)); $registerTarget = [ 'type' => 'link', 'url' => route('activity.enroll', $activity), 'label' => 'Daftar Kegiatan', ]; if ($registrationStatus === 0) { $registerTarget = ['type' => 'disabled', 'url' => null, 'label' => 'Pendaftaran Belum Dibuka']; } elseif ($registrationStatus === 2) { $registerTarget = ['type' => 'disabled', 'url' => null, 'label' => 'Pendaftaran Ditutup']; } else { if ($activityPrice > 0) { if (method_exists($activity, 'isAutomaticPayment') && $activity->isAutomaticPayment()) { $registerTarget = ['type' => 'link', 'url' => route('midtrans.payment.create', $activity->id), 'label' => 'Daftar Kegiatan']; } else { $registerTarget = ['type' => 'link', 'url' => route('payments.create', $activity->id), 'label' => 'Daftar Kegiatan']; } } else { $registerTarget = ['type' => 'form', 'url' => route('activity.enroll', $activity), 'label' => 'Daftar Kegiatan']; } } @endphp
@php $hasPendingCTA = auth()->check() && !empty($showCompletePaymentCTA) && $showCompletePaymentCTA && !empty($completePaymentUrl); @endphp @if($hasPendingCTA) {{ $completePaymentLabel ?? 'Selesaikan Pembayaran' }} @elseif($alreadyParticipant) Menuju Kegiatan @elseif($registerTarget['type'] === 'disabled') {{ $registerTarget['label'] }} @elseif($registerTarget['type'] === 'form')
@csrf
@else Daftar Kegiatan @endif
@if(isset($participants))
    @include('partials.participants_detail_list_items', ['participants' => $participants, 'activity' => $activity, 'disable_click' => true])
@else

Data peserta tidak tersedia.

@endif
@push('scripts') @endpush @push('styles') @endpush @push('scripts') @endpush @endsection