@extends('student.layouts.app') @section('title', app()->getLocale() === 'ar' ? 'مقرراتي' : 'My Courses') @section('content') @php $isArabic = app()->getLocale() === 'ar'; @endphp
{{-- Header --}}

{{ $isArabic ? 'المقررات الدراسية' : 'Academic Courses' }}

{{ $isArabic ? 'مسارك الدراسي الحالي' : 'Your Learning Path' }}

{{ $isArabic ? 'كل مقرراتك في مكان واحد مع وصول مباشر للمواد والاختبارات والمهام.' : 'All your courses in one place with direct access to materials, quizzes, and assignments.' }}

{{ $isArabic ? 'المقررات' : 'Courses' }}

{{ $courses->count() }}

@php $completed = $courses->filter(fn($c) => (int)$c->student_progress >= 100)->count(); @endphp @if($completed > 0)

{{ $isArabic ? 'مكتملة' : 'Completed' }}

{{ $completed }}

@endif
{{-- Courses Grid --}} @if($courses->isEmpty())
📚

{{ $isArabic ? 'لا توجد مقررات حالياً' : 'No courses yet' }}

{{ $isArabic ? 'لم يتم ربط أي مقررات بحسابك حتى الآن.' : 'No courses are currently linked to your account.' }}

@else
@foreach($courses 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 dark:text-emerald-400' : ($p >= 50 ? 'text-brand-600 dark:text-brand-400' : 'text-sky-600 dark:text-sky-400'); @endphp
{{-- Top --}}
@if($course->image) {{ $course->name }} @else
@endif

{{ $course->name }}

@if($p >= 100) @endif
@if($course->teacher)

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

@endif
@if($course->subject?->name) {{ $course->subject->name }} @endif @if($course->schoolClass?->name) {{ $course->schoolClass->name }} @endif
{{-- Progress --}}
{{ $isArabic ? 'التقدم' : 'Progress' }} {{ $p }}%
{{-- Stats --}}
@php $stats = [ ['label' => $isArabic ? 'مواد' : 'Materials', 'icon' => 'fa-file-lines', 'count' => $course->materials_count], ['label' => $isArabic ? 'اختبارات' : 'Quizzes', 'icon' => 'fa-clipboard-question', 'count' => $course->quizzes_count], ['label' => $isArabic ? 'مهام' : 'Assignments', 'icon' => 'fa-list-check', 'count' => $course->assignments_count], ]; @endphp @foreach($stats as $stat)
{{ $stat['count'] }} {{ $stat['label'] }}
@endforeach
{{-- Action --}}
@endforeach
@endif
@endsection