@extends('layouts.main_dashboard.app') @section('title', app()->getLocale() === 'ar' ? 'إدارة النقاط' : 'Points Management') @section('page_heading', app()->getLocale() === 'ar' ? 'إدارة النقاط' : 'Points Management') @section('skip_page_hero', true) @php $isArabic = app()->getLocale() === 'ar'; $activeRulesCount = $rules->where('is_active', true)->count(); @endphp @section('content')

{{ $isArabic ? 'إدارة قواعد النقاط' : 'Manage Point Rules' }}

{{ $isArabic ? 'صفحة مستقلة لضبط النقاط المرتبطة بالأنشطة ومراجعة أفضل الطلاب وآخر حركات النقاط.' : 'A dedicated page for tuning activity point rules and reviewing top students and recent point transactions.' }}

{{ $isArabic ? 'كل القواعد' : 'All Rules' }}

{{ $rules->count() }}

{{ $isArabic ? 'القواعد النشطة' : 'Active Rules' }}

{{ $activeRulesCount }}

{{ $isArabic ? 'أفضل الطلاب' : 'Top Students' }}

{{ $topStudents->count() }}

{{ $isArabic ? 'قواعد النقاط' : 'Point Rules' }}

@foreach($rules as $rule)
@csrf @method('PUT')

{{ $rule->action_key }}

@endforeach

{{ $isArabic ? 'أفضل الطلاب' : 'Top Students' }}

@forelse($topStudents as $student)

{{ $student->name }}

{{ $student->registration_number }}

{{ (int) ($student->point_transactions_sum_points ?? 0) }}
@empty
{{ $isArabic ? 'لا توجد بيانات طلاب حتى الآن.' : 'No student data available yet.' }}
@endforelse

{{ $isArabic ? 'آخر حركات النقاط' : 'Recent Point Transactions' }}

@forelse($recentTransactions as $transaction)

{{ $transaction->user?->name }}

{{ $transaction->action_key }}

{{ $transaction->points >= 0 ? '+' : '' }}{{ $transaction->points }}
@empty
{{ $isArabic ? 'لا توجد حركات نقاط حديثة.' : 'No recent point transactions.' }}
@endforelse
@endsection