@extends('layouts.main_dashboard.app') @section('title', __('dashboard.All Subjects')) @section('page_heading', __('dashboard.All Subjects')) @section('page_subtitle', app()->getLocale() === 'ar' ? 'إدارة المواد الدراسية وربطها بالمراحل والأقسام من واجهة أوضح وأهدأ.' : 'Manage academic subjects and their stage and department links from a clearer interface.') @section('skip_page_hero', true) @php $isArabic = app()->getLocale() === 'ar'; $filtersOpenByDefault = request()->hasAny(['year', 'term', 'stage', 'grade', 'department']); $subjectsCollection = $subjects->getCollection(); $withDepartments = $subjectsCollection->filter(fn ($subject) => filled(optional($subject->department)->name))->count(); $withoutDepartments = $subjectsCollection->count() - $withDepartments; $totalUnits = $subjectsCollection->sum('subject_units_count'); $totalLessons = $subjectsCollection->sum('lessons_count'); @endphp @section('content')

{{ __('dashboard.All Subjects') }}

{{ $isArabic ? 'اعرض المواد الدراسية مع المرحلة والصف والقسم وعدد الوحدات والدروس من شاشة إدارية موحّدة.' : 'Review subjects with stage, grade, department, unit count, and lesson count from one unified admin screen.' }}

{{ $isArabic ? 'إجمالي المواد' : 'Total subjects' }}

{{ $subjects->total() }}

{{ __('dashboard.Add New Subject') }}

{{ $isArabic ? 'فهرس أكاديمي' : 'Academic catalog' }}

{{ __('dashboard.Subjects') }}

{{ $isArabic ? 'قائمة منظمة تساعدك على مراجعة الربط الأكاديمي لكل مادة بسرعة.' : 'A structured list that helps you review each subject academic link quickly.' }}

{{ $isArabic ? 'داخل الصفحة' : 'Visible now' }}

{{ $subjectsCollection->count() }}

{{ $isArabic ? 'مرتبطة بقسم' : 'With department' }}

{{ $withDepartments }}

{{ $isArabic ? 'إجمالي الوحدات' : 'Total units' }}

{{ $totalUnits }}

{{ $isArabic ? 'إجمالي الدروس' : 'Total lessons' }}

{{ $totalLessons }}

{{ $isArabic ? 'تصفية المواد' : 'Filter subjects' }}

{{ $isArabic ? 'حدّد السنة والفصل والمرحلة والصف والقسم لعرض نطاق أدق.' : 'Narrow the list by year, term, stage, grade, and department.' }}

{{ $isArabic ? 'بدون قسم' : 'Without department' }} {{ $withoutDepartments }}
{{ __('dashboard.Reset') }}
@if($subjects->isEmpty())

{{ __('dashboard.No data found') }}

{{ $isArabic ? 'لا توجد مواد مطابقة للفلاتر الحالية.' : 'No subjects match the current filters.' }}

@else
@foreach($subjects as $subject) @endforeach
{{ $isArabic ? 'المادة' : 'Subject' }} {{ $isArabic ? 'المسار الأكاديمي' : 'Academic path' }} {{ $isArabic ? 'القسم' : 'Department' }} {{ $isArabic ? 'الوحدات والدروس' : 'Units & lessons' }} {{ $isArabic ? 'الدرجة' : 'Total marks' }} {{ __('dashboard.Actions') }}
@if($subject->image) {{ $subject->name }} @else @endif

{{ $subject->name }}

#{{ $subject->id }}

{{ collect([ optional($subject->grade->stage->term->year)->name, optional($subject->grade->stage->term)->name, optional($subject->grade->stage)->name, optional($subject->grade)->name, ])->filter()->implode(' / ') ?: '-' }} @if(optional($subject->department)->name) {{ $subject->department->name }} @else {{ __('dashboard.Not Assigned') }} @endif
{{ $subject->subject_units_count }} {{ __('dashboard.Units Count') }} {{ $subject->lessons_count }} {{ __('dashboard.Lessons Count') }}
{{ $subject->total_marks }}
@if ($subjects->hasPages())
{{ $subjects->appends(request()->query())->links('pagination::simple-tailwind') }}
@endif @endif
@endsection @section('scripts') @endsection