@extends('layouts.gamification') @section('title', __('Мой герой')) @section('gami-active', 'hero') @push('styles') @endpush @section('gami-content') @include('shared._student_warnings', ['warnings' => $warnings, 'warningsAudience' => 'student'])
@php($fr = \App\Support\Cosmetics::frame($hero->frame_color ?? null, 4)) @php($nm = \App\Support\Cosmetics::name($hero->name_color ?? null))
@include('partials._student_avatar', ['studentId' => $student->id, 'avatarPath' => $student->avatar_path])
{{ $student->nickname ?: trim($student->first_name) }}
@if (! empty($hero->title))
{{ $hero->title }}
@endif
⭐ {{ __('Уровень :n', ['n' => (int) $hero->level_number]) }} · {{ $currentLevel->name }}
{{ __('Мой профиль') }}
{{ (int) $view['xp_into_level'] }} ⭐ {{ $nextLevel ? ((int) $view['xp_for_next'].' ⭐') : 'MAX' }}
{{ (int) $hero->coins_balance }} 🪙
{{ __('монет') }}
@if ($student->description)
{{ $student->description }}
@endif
{{-- App\Services\DailyRewards: today's reward, and the 7-day track it sits on. --}} @php($cycleDay = \App\Services\DailyRewards::cycleDay($daily['day']))
🎁 {{ __('Ежедневная награда') }}
@if ($daily['streak'] > 0) 🔥 {{ __('Серия: :n дн. подряд', ['n' => $daily['streak']]) }} @else {{ __('Заходи каждый день — награда растёт, на 7-й день сундук!') }} @endif
@if ($daily['claimed']) {{ __('Приходи завтра за новой наградой') }} @else
@csrf
@endif
@foreach ($dailyCoins as $d => $coins) @php($state = $d < $cycleDay || ($d === $cycleDay && $daily['claimed']) ? 'done' : ($d === $cycleDay ? 'today' : 'later'))
{{ __('День :n', ['n' => $d]) }}
{{ $state === 'done' ? '✅' : ($d === count($dailyCoins) ? '🧰' : '🪙') }}
+{{ $coins }}
@endforeach
@include('hero._week') @include('hero._lesson_rating') @include('hero._earn_rules') @if ($nextUnlock)
@include('partials._next_unlock', ['nextUnlock' => $nextUnlock, 'xpTotal' => $hero->xp_total])
@endif {{-- StudentAboutController::update(). Opened by the link under the name. --}}
@csrf
{{ __('Виден в рейтинге и в командах вместо имени.') }}
{{ __('JPG или PNG, до :mb МБ. Обрезается до квадрата.', ['mb' => \App\Support\StudentAvatar::MAX_KILOBYTES / 1024]) }}
@if ($student->avatar_path)
@endif
{{ (int) $achievementScore }}
{{ __('очков достижений') }}
{{ (int) $hero->xp_total }}
{{ __('всего опыта') }}
{{ (int) $hero->attendance_streak }}
{{ __('дней подряд') }} @if ((int) ($hero->streak_freezes ?? 0) > 0) · 🛡️ × {{ (int) $hero->streak_freezes }} @endif
{{ (int) $hero->total_attendance_days }}
{{ __('всего посещений') }}
{{-- App\Services\Seasons: monthly top-3 places this student has won. --}} @if (! empty($seasonAwards))
{{ __('Награды сезонов') }}
@foreach ($seasonAwards as $a) {{ [1 => '🥇', 2 => '🥈', 3 => '🥉'][(int) $a->place] ?? '🏆' }} {{ __(':place-е место · :season', ['place' => (int) $a->place, 'season' => \App\Services\Seasons::label($a->season)]) }} @endforeach
@endif {{-- Period totals of coins and XP only — no per-day breakdown and no срез/ДЗ scores are shown to the student. --}} @foreach ($periodStats as $days => $stats)
{{ __('За :days дней', ['days' => $days]) }}
🪙
{{ ($stats['coins_earned'] > 0 ? '+' : '').$stats['coins_earned'] }}
{{ __('монет заработано') }}
⭐
{{ ($stats['xp_earned'] > 0 ? '+' : '').$stats['xp_earned'] }}
{{ __('опыта получено') }}
@endforeach {{-- Undated on purpose (newest first, no dates), and the per-entry note is dropped for срез/ДЗ entries since it carries the score itself — see HeroController::show(). --}}
{{ __('История монет') }}
@if (empty($coinHistory)) @endif @foreach ($coinHistory as $row) @endforeach
{{ __('Пока нет записей') }}
{{ $reasonLabels[$row->reason] ?? $row->reason }} @if ($row->description) — {{ $row->description }} @endif {{ ($row->amount >= 0 ? '+' : '').(int) $row->amount }} 🪙
{{-- Right after HeroController::claimDailyReward() (flashed for one request). --}} @if (is_array(session('daily_reward'))) @php($claimed = session('daily_reward')) @push('scripts') @endpush @endif {{-- Shown once: Gamification::takeNewRewards() marks everything here seen as the page is built. --}} @if ($newRewards['level'] || ! empty($newRewards['achievements'])) @push('scripts') @endpush @endif @endsection