@extends('layouts.gamification')
@section('title', __('Команды'))
@section('gami-active', 'teams')
@push('styles')
@endpush
@section('gami-content')
@if ($myTeam)
{{ $myTeam->icon }}
{{ __('Ваша команда') }}
{{ $myTeam->name }}
@if ((int) $myTeam->captain_student_id === $studentId)
{{ __('👑 Вы капитан') }}
@endif
@if ((int) $myTeam->captain_student_id === $studentId)
{{-- Captain's tools: join requests, and removing a member. --}}
{{ __('Заявки в команду') }}
@forelse ($requests as $r)
@empty
{{ __('Новых заявок нет.') }}
@endforelse
@php($mine = collect($teams)->firstWhere('id', $myTeam->id))
@if ($mine && count($mine->members) > 1)
{{ __('Участники') }}
@foreach ($mine->members as $m)
@continue((int) $m->student_id === $studentId)
@include('partials._student_avatar', ['studentId' => $m->student_id, 'avatarPath' => $m->avatar_path])
{{ $m->nickname ?: trim($m->first_name) }}
@endforeach
@endif
@endif
@else
@if ($pendingRequest)
{{ $pendingRequest->icon }}
{{ __('Ваша заявка ждёт решения капитана') }}
{{ $pendingRequest->name }}
@endif
{{ __('Создать команду — :cost 🪙', ['cost' => $cost]) }}
@endif
{{ __('Рейтинг команд за неделю') }}
@if (empty($teams))
{{ __('Команд пока нет — создайте первую!') }}
@endif
@foreach ($teams as $rank => $t)
{{ [0 => '🥇', 1 => '🥈', 2 => '🥉'][$rank] ?? $rank + 1 }}
{{ $t->icon }}
{{ $t->name }}
{{ (int) $t->member_count }}/{{ $maxMembers }} ·
@foreach ($t->members as $m)
@include('partials._student_avatar', ['studentId' => $m->student_id, 'avatarPath' => $m->avatar_path]) {{ $m->nickname ?: trim($m->first_name) }}{{ (int) $m->student_id === (int) $t->captain_student_id ? ' 👑' : '' }}@if (! $loop->last), @endif
@endforeach
+{{ (int) $t->week_xp }} ⭐
@if (! $myTeam && $pendingRequest && (int) $pendingRequest->id === (int) $t->id)
{{ __('Заявка отправлена') }}
@elseif (! $myTeam && ! $pendingRequest && (int) $t->member_count < $maxMembers)
@endif
@endforeach
@endsection