@php $view = $view ?? 'cards'; $items = $items ?? collect(); $type = $type ?? 'generic'; @endphp @if($view === 'table')
@foreach($items as $i=>$it) @php $title = $type==='evaluations' ? ('نقاط: '.(int)($it->total_daily_points ?? 0)) : ($type==='tests' ? ($it->test_title ?? ('اختبار #'.($it->weekly_test_id ?? $it->id ?? '—'))) : ($type==='honors' ? ($it->title ?? 'تكريم') : ($type==='violations' ? ($it->violation->title ?? 'مخالفة') : ($type==='ranks' ? ($it->name ?? 'رتبة') : ($it->title ?? ($it->name ?? '—')) ) ) ) ); $desc = $type==='evaluations' ? ($it->evaluator_notes ?? '—') : ($type==='activities' ? ('نقاط: '.(int)($it->participant_points ?? 0)) : ($type==='absences' ? (($it->attendance_status ?? '—').' • '.($it->excuse_reason ?? '')) : ($type==='absence_requests' ? ($it->reason ?? $it->excuse_reason ?? '—') : ($it->description ?? $it->reason ?? $it->notes ?? '—') ) ) ); $date = $type==='evaluations' ? ($it->evaluation_date ?? '—') : ($it->awarded_at ?? $it->created_at ?? $it->submitted_at ?? '—'); if($date instanceof \Carbon\Carbon) $date = $date->format('Y-m-d'); @endphp @endforeach
# العنوان تفاصيل تاريخ
{{ $i+1 }} {{ $title }} {{ $desc }} {{ $date }}
@elseif($view === 'grid')
@foreach($items as $it)
{{ $type==='evaluations' ? ('نقاط: '.(int)($it->total_daily_points ?? 0)) : ($it->title ?? $it->name ?? $it->test_title ?? 'عنصر') }}
{{ $type==='evaluations' ? ($it->evaluator_notes ?? '—') : ($it->description ?? $it->reason ?? $it->notes ?? '—') }}
@endforeach
@else
@foreach($items as $it)
{{ $type==='evaluations' ? ('نقاط: '.(int)($it->total_daily_points ?? 0)) : ($it->title ?? $it->name ?? $it->test_title ?? 'عنصر') }}
{{ $type }}
{{ $type==='evaluations' ? ($it->evaluator_notes ?? '—') : ($it->description ?? $it->reason ?? $it->notes ?? '—') }}
@endforeach
@endif