@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
@csrf
@if ((int) $myTeam->captain_student_id === $studentId) {{-- Captain's tools: join requests, and removing a member. --}}
{{ __('Заявки в команду') }}
@forelse ($requests as $r)
@include('partials._student_avatar', ['studentId' => $r->student_id, 'avatarPath' => $r->avatar_path]) {{ $r->nickname ?: trim($r->first_name).' '.mb_substr(trim((string) $r->last_name), 0, 1).'.' }}
@csrf
@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) }}
@csrf
@endforeach @endif
@endif @else @if ($pendingRequest)
{{ $pendingRequest->icon }}
{{ __('Ваша заявка ждёт решения капитана') }}
{{ $pendingRequest->name }}
@csrf
@endif
{{ __('Создать команду — :cost 🪙', ['cost' => $cost]) }}
@csrf
@foreach (['🐺', '🦁', '🐉', '🦅', '🚀', '⚡', '🔥', '🎃', '🧠', '🏆'] as $i => $icon) @endforeach
{{ __('Или подайте заявку в одну из команд ниже — это бесплатно, капитан её примет или отклонит. В команде до :maxmembers человек.', ['maxmembers' => $maxMembers]) }}
@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)
@csrf
@endif
@endforeach @endsection