@extends('siswa.layout') @section('content')
{{-- ================= GLOBAL ALERT ================= --}} @if(session('warning') || session('error') || session('success'))
{{-- WARNING --}} @if(session('warning'))
{{ session('warning') }}
@endif {{-- ERROR --}} @if(session('error'))
{{ session('error') }}
@endif {{-- SUCCESS --}} @if(session('success'))
{{ session('success') }}
@endif
@endif

Dashboard Siswa

Selamat datang, {{ $student->name }}

"Kesuksesan lahir dari konsistensi."

{{ $myModules->count() }}

Mapel

{{ $upcomingQuizzes->count() }}

Quiz Aktif

{{ $upcomingTasks->count() }}

Tugas

Agenda Mendatang

Quiz dan tugas yang perlu segera diselesaikan

Quiz Akan Datang

{{ $upcomingQuizzes->count() }} quiz tersedia

@forelse($upcomingQuizzes as $quiz)

{{ $quiz->title }}

{{ $quiz->deadline_formatted }}

@if(isset($quiz->time_limit) && $quiz->time_limit)

{{ $quiz->time_limit }} menit

@endif
@empty

Tidak ada quiz mendatang

Semua quiz telah diselesaikan

@endforelse

Tugas Akan Datang

{{ $upcomingTasks->count() }} tugas tersedia

@forelse($upcomingTasks as $task)

{{ $task->title }}

{{ $task->deadline_formatted }}

@empty

Tidak ada tugas mendatang

Semua tugas telah diselesaikan

@endforelse

Daftar Jurusan

@foreach($departments as $department) @php $isMine = $student->department && $department->id === $student->department->id; @endphp
@unless($isMine)
@endunless

{{ $department->name }}

{{ $department->modules_count }} Modul

@if($isMine) Jurusan Anda @endif
@endforeach

Mata Pelajaran Saya

Lihat semua
@foreach($myModules as $module) @php $progressPct = $module->progress_weighted ?? 0; $totalLessons = $module->lessons->count(); $completedLessons = round(($progressPct / 100) * $totalLessons); if ($progressPct >= 70) { $barColor = 'from-green-500 to-emerald-400'; $glowColor = 'shadow-green-400/60'; } elseif ($progressPct >= 35) { $barColor = 'from-yellow-500 to-amber-400'; $glowColor = 'shadow-yellow-400/60'; } else { $barColor = 'from-red-600 to-rose-400'; $glowColor = 'shadow-red-400/60'; } $ctaLabel = $progressPct > 0 && $progressPct < 100 ? 'Lanjutkan' : ($progressPct === 100 ? 'Lihat Kembali' : 'Masuk Kursus'); $firstLessonUrl = $module->lessons->count() ? route('siswa.modul.show', $module->lessons->first()->id) : ''; @endphp
{{ $module->module->title }} @if($totalLessons > 0)
{{ $progressPct }}%
@endif

{{ $module->module->title }}

@if(!empty($module->module->description))

@endif {{-- ===== HEALTH BAR PROGRESS ===== --}} @if($totalLessons > 0)
Progress
{{ $progressPct }}%
@if($progressPct > 0 && $progressPct < 100)
@endif
@endif {{-- ===== END HEALTH BAR ===== --}} {{-- CTA — klik langsung redirect, TIDAK buka modal --}} @if($module->lessons->count()) {{ $ctaLabel }} @else Materi belum tersedia @endif
@endforeach
{{-- DOT INDICATOR --}} @if($myModules->count() > 1)
@foreach($myModules as $i => $module) @endforeach
@endif
{{-- ================= MODAL MODULE ================= --}} @endsection