@php use App\Support\Attributes; use App\Support\PitchLayout; $tier = fn (float $o) => $o >= 8 ? 'text-gold' : ($o >= 6.5 ? 'text-[#7DE39A]' : ($o >= 5 ? 'text-pitch-ink' : 'text-pitch-muted')); @endphp
{{-- Maç bilgisi --}}
← {{ $group->name }}

{{ $match->title }}

📅 {{ $match->starts_at->translatedFormat('d F Y, l H:i') }} @if ($match->location) · 📍 {{ $match->location }} @endif

@if ($match->status === 'scheduled')
{{ $going->count() }}/{{ $match->capacity }}
KADRO
@elseif ($match->status === 'completed')
{{ $match->team_a_score }} : {{ $match->team_b_score }}
TURUNCU : YEŞİL
@else İptal edildi @endif
@if ($canManage && $match->status === 'scheduled')
{{-- Kadro kontrol özeti --}}
🔢 {{ $going->count() + $waitlist->count() }} kişi geliyor · Kadro: {{ $going->count() }}/{{ $match->capacity }} @if ($waitlist->count() > 0) · {{ $waitlist->count() }} yedek @endif
@if ($going->count() >= 2 && $going->count() % 2 === 1)
⚠️ Asıl listede tek sayıda oyuncu var ({{ $going->count() }}) — takımlar eşit olmaz. Bir kişiyi "Gelmiyor" yaparak ya da katılımı yöneterek çift sayıya getir.
@endif
@if ($going->count() >= 4) ⚖️ Kadroları Kur @endif 🗂 Şablonlar {{ $showResultForm ? 'Vazgeç' : '📝 Sonucu Gir' }} Maçı İptal Et
{{-- Alternatif kadrolar arası gezinme --}} @if (count($alternatives) > 1)
Alternatif kadro: @foreach ($alternatives as $i => $alt) @endforeach {{ $altIndex + 1 }}/{{ count($alternatives) }} — en dengeliden başlar
@endif {{-- Kadro şablonları --}} @if ($showTemplates)

Kadro Şablonları ({{ $templates->count() }}/{{ $maxTemplates }})

Sık oynayan sabit kadroyu kaydet, sonraki maçta tek tıkla yükle. Yüklenen kadro yine %60 oylamasına gider.

@if ($templates->isNotEmpty())
@foreach ($templates as $tpl)
{{ $tpl->name }} ({{ count($tpl->teams) }} oyuncu)
@endforeach
@endif @if ($templates->count() < $maxTemplates)
Mevcut kadroyu kaydet
@else

En fazla {{ $maxTemplates }} şablon — yeni kaydetmek için birini sil.

@endif
@endif @if ($templateNotice)

{{ $templateNotice }}

@endif @endif
{{-- RSVP — kadro kurulduktan sonra kişisel "geliyor musun?" sorusu gizlenir --}} @if ($match->status === 'scheduled' && ($match->squad_status === 'none' || $canManage))
@if ($match->squad_status === 'none')

Geliyor musun?

@if ($myRsvp?->status === 'going' && $myRsvp->waitlist_position !== null)

Kadro dolu — yedek listesinde {{ $myRsvp->waitlist_position }}. sıradasın. Biri çekilirse otomatik olarak kadroya geçersin.

@endif @else

Katılım

Kadro kuruldu. Katılımı aşağıdan yönetebilir, gerekirse kadroyu yeniden kurabilirsin.

@endif @if ($canManage)
👥 {{ $showManageRsvp ? 'Katılım yönetimini kapat' : 'Katılımı yönet (başkan)' }}

Gelemeyenler adına da işaretleyebilirsin — WhatsApp'tan toplayıp tek tek girme derdi bitsin.

@if ($showManageRsvp)
@foreach ($roster as $player) @php $st = $rsvpByPlayer[$player->id]->status ?? null; @endphp
{{ $player->name }} @if ($player->isGuest())(misafir)@endif
@endforeach
@endif
@endif
@endif {{-- Kadro + oylama + saha --}} @if ($teamA->isNotEmpty() || $teamB->isNotEmpty()) {{-- Onay oylaması --}} @if ($voteSummary)
@if ($match->squad_status === 'approved')

Kadro Onaylandı

{{ $voteSummary['yes'] }} evet oyu ile %60 çoğunluk sağlandı.

@else

🗳️ Kadro Oylaması

Kadronun kesinleşmesi için kadrodaki oyuncuların %60'ının onayı gerekiyor: {{ $voteSummary['yes'] }}/{{ $voteSummary['needed'] }} evet ({{ $voteSummary['no'] }} hayır, {{ $voteSummary['eligible'] }} oy hakkı).

@if ($canVoteSquad)
@if ($mySquadVote) Oyunu değiştirebilirsin. @endif
@endif @if ($canManage && $voteSummary['no'] > $voteSummary['eligible'] - $voteSummary['needed'])

%60'a ulaşmak artık mümkün değil — Alternatif Kadro ile yeni bir bölünme sun ya da elle takas yap.

@endif @endif
@endif {{-- Denge göstergesi + takım listeleri --}}
TURUNCU {{ $teamA->count() }} OYUNCU · ORT {{ number_format($avgA, 1) }}
@php $diff = $avgA - $avgB; $shift = max(-22, min(22, $diff * 12)); @endphp
{{ abs($diff) < 0.05 ? 'Tam denge ✓' : 'Fark: '.number_format(abs($diff), 1).' puan ('.($diff > 0 ? 'Turuncu' : 'Yeşil').' önde)' }}
YEŞİL {{ $teamB->count() }} OYUNCU · ORT {{ number_format($avgB, 1) }}
@if ($canManage && $match->status === 'scheduled')

Elle değişiklik: bir takımdan oyuncuya tıkla, sonra diğer takımdan birine tıkla — yer değiştirirler (oylama yeniden başlar).

@endif
@foreach ([['A', 'Turuncu Yelek', $teamA, 'border-bibA', 'bg-bibA/10 text-bibA'], ['B', 'Yeşil Yelek', $teamB, 'border-bibB', 'bg-bibB/10 text-bibB']] as [$side, $teamName, $team, $borderClass, $headClass])
{{ $teamName }}
    @foreach ($team as $rsvp)
  • status === 'scheduled') wire:click="swap({{ $rsvp->player_id }})" @endif class="flex items-center gap-3 px-4 py-2.5 border-b border-pitch-line last:border-b-0 transition {{ $canManage && $match->status === 'scheduled' ? 'cursor-pointer hover:bg-pitch-surface2' : '' }} {{ $swapArmed === $rsvp->player_id ? 'bg-gold/10 shadow-[inset_3px_0_0_#FFC83D]' : '' }}"> @if ($rsvp->player->overallIsPublic()) {{ number_format($rsvp->player->overall(), 1) }} @else ? @endif {{ $rsvp->player->name }} @if ($rsvp->player->shirt_number)#{{ $rsvp->player->shirt_number }}@endif @if ($myPlayer && $rsvp->player_id === $myPlayer->id)(sen)@endif @foreach ($rsvp->player->positions ?? [] as $i => $pos) {{ count($rsvp->player->positions) > 1 ? ($i + 1).'·' : '' }}{{ $pos }} @endforeach 🦶{{ $rsvp->player->footBadge() }}
  • @endforeach
@endforeach
{{-- Saha dizilişi --}}

Saha Dizilişi

@if ($canManage) @endif @if ($canManage) Dizilişi Sıfırla @endif
@foreach ([['A', $pitchA, '#FF7A1A'], ['B', $pitchB, '#C8F04B']] as [$side, $nodes, $fill]) @foreach ($nodes as $node) @php $label = $node['number'] ?? (($node['ovr_public'] ?? true) ? round($node['ovr']) : '–'); @endphp {{ $label }} {{ $node['name'] }} @endforeach @endforeach @if ($canManage)

Oyuncuları saha üzerinde sürükleyip bırakarak dizilişi istediğin gibi kurabilirsin.

@endif
@endif {{-- Katılım listeleri --}}

✅ Kadro ({{ $going->count() }}/{{ $match->capacity }})

    @forelse ($going as $rsvp)
  1. {{ $rsvp->player->name }} @if ($rsvp->player->isGuest())(misafir)@endif @if ($myPlayer && $rsvp->player_id === $myPlayer->id)(sen)@endif
  2. @empty

    Henüz kimse yok — ilk sen ol!

    @endforelse
@if ($waitlist->isNotEmpty())

⏳ Yedek Listesi

    @foreach ($waitlist as $rsvp)
  1. {{ $rsvp->waitlist_position }}. {{ $rsvp->player->name }} @if ($myPlayer && $rsvp->player_id === $myPlayer->id)(sen)@endif
  2. @endforeach
@endif

🤔 Belki ({{ $maybe->count() }})

    @forelse ($maybe as $rsvp)
  • {{ $rsvp->player->name }}
  • @empty

    @endforelse

❌ Gelmiyor ({{ $notGoing->count() }})

    @forelse ($notGoing as $rsvp)
  • {{ $rsvp->player->name }}
  • @empty

    @endforelse
{{-- Sonuç girme formu --}} @if ($showResultForm && $canManage)

Maç Bitti Mi?

Turuncu : Yeşil
@if ($going->isNotEmpty())
@foreach ($going as $rsvp)
{{ $rsvp->player->name }} @if ($rsvp->team)({{ $rsvp->team === 'A' ? 'Turuncu' : 'Yeşil' }})@endif
@endforeach
@endif 🏁 Sonucu Kaydet ve Maçı Bitir

Skor kaydedilince MVP oylaması 24 saat açılır ve haftalık otomatik maç ayarlıysa sıradaki maç açılır.

@endif {{-- Maç sonu: golcüler + MVP --}} @if ($match->status === 'completed') @if ($matchGoals->isNotEmpty())

⚽ Golleri Atanlar

    @foreach ($matchGoals as $goal)
  • {{ $goal->count }}× {{ $goal->player?->name ?? 'Bilinmiyor' }}
  • @endforeach
@endif

🏆 Maçın Adamı (MVP)

@if ($match->mvpOpen()) Oylama açık — {{ (int) ceil(now()->diffInHours($match->mvp_closes_at, true)) }} saat kaldı @elseif ($match->mvp_closes_at) Oylama kapandı @endif
@if ($match->mvpOpen() && $isParticipant && ! $myMvpVote)

Maçın yıldızı kimdi? Tek oy hakkın var ve değiştirilemez. Oylar anonim — kimse kime verdiğini görmez.

@foreach ($going as $rsvp) @if (! $myPlayer || $rsvp->player_id !== $myPlayer->id) @endif @endforeach
@elseif ($mvpResults->isNotEmpty() && ($myMvpVote || ! $match->mvpOpen()))
    @foreach ($mvpResults as $result)
  • {{ $loop->first ? '👑' : $loop->iteration.'.' }} {{ $result->player->name }} {{ $result->votes }} oy @if ($result->player_id === $myMvpVote?->player_id) (senin oyun) @endif
  • @endforeach
@elseif ($match->mvpOpen())

Sonuçlar oylar verildikçe burada görünecek{{ $isParticipant ? '' : ' (kadroda olmadığın için oy kullanamazsın)' }}.

@else

Hiç oy kullanılmadı.

@endif
@endif
@script @endscript