@extends('layouts.app') @section('title', $horse->name) @section('content')
@if ($horse->photo_path) {{ $horse->name }} @endif

{{ $horse->unique_code }}

{{ $horse->name }}

{{ $horse->breed }} ยท {{ __('messages.sex_'.$horse->sex) }} ยท {{ $horse->color }}

@auth
@csrf
@endauth

{{ __('messages.horse_stats_races') }}

{{ $horse->races_count }}

๐Ÿฅ‡

{{ $horse->wins_count }}

๐Ÿฅˆ

{{ $horse->second_count }}

๐Ÿฅ‰

{{ $horse->third_count }}

{{ __('messages.horse_stats_win_rate') }}

{{ $horse->winRate() }}%

@if ($horse->description)
{!! nl2br(e($horse->description)) !!}
@endif

{{ __('messages.horse_owner') }}

@foreach ($horse->owners as $owner)

{{ $owner->fullName() }} โ€” {{ $owner->pivot->ownership_percentage }}% {{ $owner->pivot->is_primary ? 'โ˜…' : '' }}

@endforeach

{{ __('messages.horse_trainer') }}

@forelse ($horse->trainers as $trainer)

{{ $trainer->user->fullName() }}

@empty

โ€”

@endforelse

{{ __('messages.horse_history') }}

@forelse ($history as $entry)
{{ $entry->race->name }}

{{ $entry->race->starts_at->translatedFormat('d M Y') }}

{{ $entry->result->badge() }}
@empty

โ€”

@endforelse
@include('partials.gallery-display', ['gallery' => $horse->media()->where('type','photo')->get()])
@endsection