@extends('layouts.app') @section('title', 'Detail Pelanggaran') @push('styles') @endpush @section('content')
{{-- Header --}}

Detail Pelanggaran

@if(!$violation->is_verified)
@csrf
@endif
@csrf @method('DELETE')
{{-- ===== LEFT COLUMN ===== --}}
{{-- Student Profile Card --}}
{{-- Gradient strip di bagian atas card --}}
{{-- Nama & badge --}}

{{ $violation->student->full_name ?? '-' }}

{{ $violation->student->nisn ?? '—' }} {{ $violation->student->class_name ?? '—' }} @if($violation->student->department_name) {{ $violation->student->department_name }} @endif
{{-- Stat row — dengan jarak dari avatar --}}
{{-- Total Poin --}}

Total Poin

{{ $violation->student->total_points }}

akumulasi

{{-- Poin Pelanggaran --}}

Poin Pelanggaran

+{{ $violation->points }}

pelanggaran ini

{{-- Kategori --}}

Kategori

{{ $violation->violationType?->category?->name ?? '-' }}

tingkat pelanggaran

{{-- Status Penanganan --}} @php $handleColors = [ 'unhandled' => ['from' => '#dc2626', 'to' => '#b91c1c'], 'in_progress' => ['from' => '#d97706', 'to' => '#b45309'], 'resolved' => ['from' => '#16a34a', 'to' => '#15803d'], ]; $handleLabels = [ 'unhandled' => 'Belum Ditangani', 'in_progress' => 'Dalam Proses', 'resolved' => 'Selesai', ]; $hcolor = $handleColors[$violation->handling_status] ?? ['from' => '#6b7280', 'to' => '#4b5563']; @endphp

Penanganan

{{ $handleLabels[$violation->handling_status] ?? '-' }}

{{ $violation->handlings->count() }} catatan @if($violation->handled_at) • {{ $violation->handled_at->format('d/m') }} @endif

{{-- Detail Info Card --}}
{{-- Header --}}

Informasi Pelanggaran

Detail lengkap pelanggaran yang tercatat

{{ $violation->violationType?->category?->name ?? '-' }}
{{-- Content Grid --}}
{{-- Jenis Pelanggaran --}}
Jenis Pelanggaran

{{ $violation->violationType->name ?? '-' }}

{{-- Poin --}}
Poin Pelanggaran

+{{ $violation->points }}

{{-- Tanggal --}}
Tanggal

{{ $violation->violation_date->format('d M Y') }} @if($violation->violation_time) • {{ \Carbon\Carbon::parse($violation->violation_time)->format('H:i') }} @endif

{{-- Sanksi --}}
Sanksi

{{ $violation->sanction ?? '—' }}

{{-- Row 2 --}}
{{-- Lokasi --}}
Lokasi

{{ $violation->location ?? '—' }}

{{-- Pencatat --}}
Dicatat Oleh
{{ strtoupper(substr($violation->recorder->name ?? '?', 0, 1)) }}

{{ $violation->recorder->name ?? '—' }}

{{-- Deskripsi --}} @if($violation->description)

Catatan / Deskripsi

{{ $violation->description }}

@endif
{{-- ===== RIGHT COLUMN ===== --}}
{{-- Status Card --}}

Status

Riwayat siklus pelanggaran

{{-- Verification Badge --}}
@if($violation->is_verified) @else @endif

{{ $violation->is_verified ? 'Terverifikasi' : 'Menunggu Verifikasi' }}

@if($violation->is_verified)

oleh {{ $violation->verifier->name ?? '-' }} @if($violation->verified_at) • {{ $violation->verified_at->format('d M Y H:i') }} @endif

@else

Belum diverifikasi oleh petugas BK

@endif
{{-- Timeline --}}
{{-- Garis vertikal --}}
{{-- Item: Verifikasi --}}

{{ $violation->is_verified ? 'Diverifikasi' : 'Menunggu Verifikasi' }}

@if($violation->is_verified)

{{ $violation->verified_at ? $violation->verified_at->format('d M Y H:i') : '' }}

@endif
{{-- Item: Dibuat --}}

Dibuat

{{ $violation->created_at->format('d M Y H:i') }}

{{-- Item: Diubah --}} @if($violation->updated_at != $violation->created_at)

Terakhir Diubah

{{ $violation->updated_at->format('d M Y H:i') }}

@endif
{{-- Evidence Photos --}} @if($violation->evidences->count() > 0)

Bukti Foto

{{ $violation->evidences->count() }}
@endif {{-- Link to Student Profile --}}

Lihat Profil Siswa

{{ $violation->student->full_name ?? '' }}

{{-- Penanganan Section --}}

Penanganan

{{ $violation->handlings->count() }} catatan

@forelse($violation->handlings as $h)
{{-- Header --}}

{{ $h->handling_type }}

{{ $h->handling_date->format('d M Y') }} @if($h->location) • {{ $h->location }} @endif

@csrf @method('DELETE')
{{-- Description --}} @if($h->description)

{{ $h->description }}

@endif {{-- Participants --}} @if($h->participants->count() > 0)

Peserta

@foreach($h->participants as $p)
{{ strtoupper(substr($p->user->name ?? '?', 0, 1)) }}
{{ $p->user->name ?? '-' }} @if($p->role) {{ $p->role }} @endif
@endforeach
@endif {{-- Evidence --}} @if($h->evidence) Lihat Bukti @endif {{-- Creator --}} @if($h->creator)

Dicatat oleh {{ $h->creator->name }}

@endif
@empty

Belum ada penanganan

@endforelse
@if($violation->handlings->count() > 0 && $violation->isInProgress())
@csrf
@endif {{-- Add Handling Modal --}}
{{-- Back to List --}} Kembali ke Data Pelanggaran
@endsection