@extends('layouts.app') @section('title', 'Event') @section('content')

Admin / Event

@if(session('success')) @endif @if(session('error')) @endif
Daftar Event
@if(auth()->user()->role === 'super_admin') @endif @foreach ($events as $event) @if(auth()->user()->role === 'super_admin') @endif @endforeach
NamaOrganisasiStatus Tanggal Aksi
{{ $event->name }} {{ $event->organization?->name ?? '-' }} @php $badge = match($event->status) { 'draft' => 'secondary', 'published' => 'info', 'active' => 'success', 'closed' => 'warning', 'archived' => 'dark', default => 'secondary', }; $statusLabel = match($event->status) { 'draft' => 'Draft', 'published' => 'Dipublikasikan', 'active' => 'Aktif', 'closed' => 'Ditutup', 'archived' => 'Diarsip', default => $event->status, }; @endphp {{ $statusLabel }} @if($event->isLocked()) @endif Mulai: {{ $event->starts_at?->format('d M Y H:i') ?? '-' }}
Selesai: {{ $event->ends_at?->format('d M Y H:i') ?? '-' }}
{{-- QR Code --}} {{-- Hasil --}} {{-- Status Transition --}} @php $nextTransitions = \App\Models\Event::VALID_TRANSITIONS[$event->status] ?? []; @endphp @foreach($nextTransitions as $nextStatus) @php $transLabel = match($nextStatus) { 'published' => ['label' => 'Publikasikan', 'color' => 'btn-outline-info', 'icon' => 'bx-send'], 'active' => ['label' => 'Aktifkan', 'color' => 'btn-success', 'icon' => 'bx-play'], 'closed' => ['label' => 'Tutup', 'color' => 'btn-warning', 'icon' => 'bx-stop'], 'archived' => ['label' => 'Arsip', 'color' => 'btn-dark', 'icon' => 'bx-archive-in'], 'draft' => ['label' => 'Kembali ke Draft', 'color' => 'btn-outline-secondary', 'icon' => 'bx-undo'], default => ['label' => $nextStatus, 'color' => 'btn-outline-secondary', 'icon' => 'bx-chevron-right'], }; @endphp @endforeach {{-- Edit (hanya jika tidak fully locked) --}} @if(!$event->areSettingsLocked()) @endif {{-- Hapus (hanya jika belum mulai) --}} @if(!$event->areSettingsLocked())
@csrf @method('DELETE')
@endif
@endsection @section('page-script') @endsection