@extends('student.layouts.app') @section('title', __('dashboard.Home')) @section('content') @php $isArabic = app()->getLocale() === 'ar'; @endphp
{{-- Hero --}}

{{ now()->translatedFormat('l، d F Y') }}

{{ $isArabic ? "أهلاً، {$studentDisplayName} 👋" : "Welcome, {$studentDisplayName} 👋" }}

{{ $primaryClassName }}

{{-- Stats --}}
{{-- Progress --}}

{{ $isArabic ? 'التقدم العام' : 'Overall Progress' }}

{{ $averageProgress }}%

{{ $completedCoursesCount }}/{{ $courses->count() }} {{ $isArabic ? 'مادة مكتملة' : 'courses completed' }}

{{-- Points --}}

{{ number_format($pointsBalance) }}

{{ $isArabic ? 'نقطة' : 'Points' }}

{{-- Badges --}}

{{ $earnedBadgesCount }}

{{ $isArabic ? 'شارة' : 'Badges' }}

{{-- Mini Calendar --}}

{{ $isArabic ? 'التقويم' : 'Calendar' }}

{{ $isArabic ? 'واجبات' : 'Assignments' }} {{ $isArabic ? 'اختبارات' : 'Quizzes' }} {{ $isArabic ? 'جداول' : 'Schedule' }} {{ $isArabic ? 'فعاليات' : 'Events' }}
{{-- Quick Links --}}
@php $links = [ ['icon' => 'fa-book-open', 'label' => $isArabic ? 'المواد' : 'Courses', 'url' => route('student.courses.index')], ['icon' => 'fa-calendar-days','label' => $isArabic ? 'الجدول' : 'Schedule', 'url' => route('student.schedule.index')], ['icon' => 'fa-chart-bar', 'label' => $isArabic ? 'النتائج' : 'Results', 'url' => route('student.final-results.index')], ['icon' => 'fa-trophy', 'label' => $isArabic ? 'المكافآت' : 'Rewards', 'url' => route('student.rewards.index')], ['icon' => 'fa-bell', 'label' => $isArabic ? 'الإشعارات' : 'Notifications', 'url' => route('student.notifications.index')], ['icon' => 'fa-clock-rotate-left','label' => $isArabic ? 'السجل' : 'History', 'url' => route('student.history.index')], ]; @endphp @foreach($links as $link)
@if($link['icon'] === 'fa-bell' && ($unreadStudentNotifications ?? 0) > 0) {{ min(99, $unreadStudentNotifications) }} @endif
{{ $link['label'] }}
@endforeach
{{-- Courses --}} @if($courses->isNotEmpty())

{{ $isArabic ? 'موادي الدراسية' : 'My Courses' }}

{{ $isArabic ? 'عرض الكل' : 'View all' }} →
@foreach($courses->take(6) as $course) @php $p = (int) $course->student_progress; $barColor = $p >= 100 ? 'bg-emerald-500' : ($p >= 50 ? 'bg-brand-600' : 'bg-sky-500'); $textColor = $p >= 100 ? 'text-emerald-600' : ($p >= 50 ? 'text-brand-600' : 'text-sky-600'); @endphp
@if($p >= 100) ✓ {{ $isArabic ? 'مكتمل' : 'Done' }} @endif

{{ $course->name }}

@if($course->teacher)

{{ $course->teacher->name }}

@endif
{{ $isArabic ? 'التقدم' : 'Progress' }} {{ $p }}%
@endforeach
@endif {{-- Upcoming + Schedule --}}
{{-- Upcoming Tasks --}}

{{ $isArabic ? 'المهام القادمة' : 'Upcoming Tasks' }}

@foreach($upcomingPanels as $panel)

{{ $panel['title'] }}

@forelse($panel['items'] as $item)

{{ $item['title'] }}

{{ $item['date_label'] }}

@empty

{{ $panel['empty'] }}

@endforelse
@endforeach
{{-- Today's Schedule --}}

{{ $isArabic ? 'الجدول الدراسي' : 'Class Schedule' }}

{{ $isArabic ? 'الكامل' : 'Full' }} →
@foreach($schedulePanels as $panel)

{{ $panel['label'] }}

@forelse($panel['entries'] as $entry)
{{ $entry['period'] }}

{{ $entry['course_name'] }}

{{ $entry['time_range'] }}

@empty

{{ $panel['empty'] }}

@endforelse
@endforeach
{{-- Media --}}
{{-- Continue Watching --}}

{{ $isArabic ? 'استمر من حيث توقفت' : 'Continue Watching' }}

@forelse($recentMediaCards as $card)

{{ $card['title'] }}

{{ $card['progress_value'] }}%
@empty

{{ $isArabic ? 'لم تشاهد أي محتوى بعد' : 'No media played yet' }}

@endforelse
{{-- New Content --}}

{{ $isArabic ? 'محتوى جديد' : 'New Content' }}

@forelse($publishedMediaCards as $card)

{{ $card['title'] }}

{{ $card['course_name'] }}

{{ $card['created_on'] }}

@empty

{{ $isArabic ? 'لا يوجد محتوى جديد' : 'No new content yet' }}

@endforelse
{{-- Final Results --}} @if($finalResultsOverview->isNotEmpty())

{{ $isArabic ? 'النتائج النهائية' : 'Final Results' }}

{{ $isArabic ? 'التفاصيل' : 'Details' }} →
@foreach($finalResultsOverview as $result) @php $avg = $result['average']; $barColor = $avg === null ? 'bg-zinc-300' : ($avg >= 90 ? 'bg-emerald-500' : ($avg >= 75 ? 'bg-brand-600' : ($avg >= 60 ? 'bg-amber-500' : 'bg-red-500'))); $textColor = $avg === null ? 'text-zinc-400' : ($avg >= 90 ? 'text-emerald-600' : ($avg >= 75 ? 'text-brand-600' : ($avg >= 60 ? 'text-amber-600' : 'text-red-600'))); @endphp

{{ $result['term']->name ?? ($isArabic ? 'فصل' : 'Term') }}

@if($avg !== null)

{{ $avg }}%

{{ $result['marks_count'] }} {{ $isArabic ? 'مادة' : 'subjects' }}

@else

{{ $isArabic ? 'لا توجد نتائج بعد' : 'No results yet' }}

@endif
@endforeach
@endif {{-- Certificates --}} @if($latestCertificates->isNotEmpty())

{{ $isArabic ? 'شهاداتي' : 'My Certificates' }}

@foreach($latestCertificates as $cert)

{{ $cert->album?->name ?? ($isArabic ? 'شهادة' : 'Certificate') }}

{{ $cert->created_at?->format('Y-m-d') }}

@endforeach
@endif
@endsection @section('scripts') @endsection