@extends('layouts.gamification')
@section('title', __('Рейтинг'))
@section('gami-active', 'leaderboard')
@push('styles')
@endpush
@section('gami-content')
@php
$isAll = $selectedGroupId === 'all';
$scope = $isAll ? 'all' : (int) $selectedGroupId;
@endphp
{{ __('Сезон «:name»', ['name' => $season['label']]) }}
{{ __('Опыт с 1-го числа. До конца сезона: :n дн.', ['n' => $season['days_left']]) }}
{{ __('Тройка лучших школы получит :first, :second и :third 🪙.', ['first' => \App\Services\Seasons::PRIZES[1], 'second' => \App\Services\Seasons::PRIZES[2], 'third' => \App\Services\Seasons::PRIZES[3]]) }}
{{-- App\Services\Leagues: the student's league this month, school-wide. --}}
@if ($myLeague)
@php($tiers = \App\Services\Leagues::TIERS)
@if ($myLeague['league'])
{{ $tiers[$myLeague['league']]['icon'] }} {{ __('Твоя лига: :name', ['name' => __($tiers[$myLeague['league']]['name'])]) }}
@if ($tiers[$myLeague['league']]['coins'] > 0)
· {{ __('в конце сезона +:n 🪙', ['n' => $tiers[$myLeague['league']]['coins']]) }}
@endif
@endif
@if ($myLeague['next'] && $myLeague['need'])
{{ __('До лиги «:name» не хватает :n опыта.', ['name' => __($tiers[$myLeague['next']]['name']), 'n' => $myLeague['need']]) }}
@endif
@foreach ($tiers as $t)
{{ $t['icon'] }} {{ __($t['name']) }} @if ($t['coins'] > 0)+{{ $t['coins'] }}🪙@endif @if (! $loop->last)·@endif
@endforeach
@endif
@if (! empty($season['champions']))
{{ __('Чемпионы сезона «:name»:', ['name' => $season['previous_label']]) }}
@foreach ($season['champions'] as $c)
{{ [1 => '🥇', 2 => '🥈', 3 => '🥉'][(int) $c->place] ?? '' }} {{ $c->nickname ?: \App\Services\Duels::shortName($c->first_name, $c->last_name) }}
@endforeach
@endif
@endif
@if (empty($rows))
{{ __('Топ-:n учеников', ['n' => \App\Http\Controllers\LeaderboardController::TOP_ALL]) }}
@endif
@foreach ($rows as $row)
@include('leaderboard._row')
@endforeach
@if ($myRow)