@extends('layouts.app') @php $countryTranslation = $user->country?->translations?->firstWhere('locale', app()->getLocale()) ?? $user->country?->translations?->firstWhere('locale', 'en'); $countryName = $countryTranslation?->name ?: $user->country?->official_name; $displayName = $user->username ?: $user->name; @endphp @section('title', $displayName.' — Coaster World') @section('content')
{{ mb_strtoupper(mb_substr($displayName, 0, 1)) }}
{{ __('ui.profile_kicker') }}

{{ $displayName }}

@if($countryName)@endif {{ __('ui.profile_member_since', ['year' => $user->created_at?->format('Y')]) }}
{{ $uniqueVisits->count() }}{{ __('ui.profile_parks') }}
{{ $coasterRides->count() }}{{ __('ui.profile_coasters') }}
{{ $otherRides->count() }}{{ __('ui.profile_attractions') }}
{{ $countries->count() }}{{ __('ui.profile_countries') }}
{{ $favoriteCount }}{{ __('ui.profile_favorites') }}
{{ __('ui.public_profile_settings_kicker') }}

{{ __('ui.public_profile_settings_title') }}

{{ __('ui.public_profile_settings_intro') }}

@if(session('profile_social_saved'))
{{ __('ui.public_profile_settings_saved') }}
@endif @error('activity_visibility')
{{ $message }}
@enderror @if($user->username)
{{ __('ui.public_profile_share_url') }} {{ route('profiles.public', $user->username) }}
@else

{{ __('ui.public_profile_no_username') }}

@endif
@csrf @method('PUT')
{{ __('ui.friends_requests_setting') }}
{{ __('ui.groups_invites_setting') }}
{{ __('ui.park_presence_setting') }}
@if($plannedVisits->isNotEmpty())
{{ __('ui.plan_kicker') }}

{{ __('ui.plan_profile_title') }}

@foreach($plannedVisits as $visit) @php $pt=$visit->park->translations->firstWhere('locale',app()->getLocale()) ?? $visit->park->translations->firstWhere('locale','en'); $parkName=$pt?->name ?: $visit->park->official_name; @endphp {{ $parkName }} {{ __('ui.plan_days_until', ['count' => max(0, (int) now()->startOfDay()->diffInDays($visit->starts_on, false))]) }} @endforeach
@endif @if($topRecommendations->isNotEmpty())
{{ __('ui.reco_kicker') }}

{{ __('ui.reco_profile_title') }}

{{ __('ui.reco_see_all') }}
@foreach($topRecommendations as $recommendation) @php $item=$recommendation['item']; $kind=$recommendation['kind']; if($kind==='park'){ $tr=$item->translations->firstWhere('locale',app()->getLocale()) ?? $item->translations->firstWhere('locale','en'); $name=$tr?->name ?: $item->official_name; $subtitle=$item->city ?: __('ui.explore_kind_park'); $href=route('parks.show',$item->slug); } else { $tr=$item->translations->firstWhere('locale',app()->getLocale()) ?? $item->translations->firstWhere('locale','en'); $ptr=$item->park?->translations?->firstWhere('locale',app()->getLocale()) ?? $item->park?->translations?->firstWhere('locale','en'); $name=$tr?->name ?: $item->official_name; $subtitle=$ptr?->name ?: $item->park?->official_name; $href=route('coasters.show',$item->coaster); } @endphp {{ __('ui.explore_kind_'.$kind) }} {{ $name }} @if($kind !== 'park') @endif {{ $subtitle }} {{ $recommendation['score'] }}% @endforeach
@endif
{{ __('ui.profile_fastest') }} @if($fastest) {{ rtrim(rtrim((string)$fastest->attraction->coaster->speed_kmh, '0'), '.') }} km/h {{ $fastest->attraction->official_name }} @else {{ __('ui.profile_no_record') }} @endif
{{ __('ui.profile_highest') }} @if($highest) {{ rtrim(rtrim((string)$highest->attraction->coaster->height_m, '0'), '.') }} m {{ $highest->attraction->official_name }} @else {{ __('ui.profile_no_record') }} @endif
{{ __('ui.profile_longest') }} @if($longest) {{ rtrim(rtrim((string)$longest->attraction->coaster->length_m, '0'), '.') }} m {{ $longest->attraction->official_name }} @else {{ __('ui.profile_no_record') }} @endif
@if($coasterCards->isNotEmpty())
{{ __('ui.progression_cards_kicker') }}

{{ __('ui.progression_cards_title') }}

{{ __('ui.progression_cards_intro') }}

@foreach($coasterCards as $ownedCard) @php $card = $ownedCard->card; $coaster = $card?->coaster; $attraction = $coaster?->attraction; $translation = $attraction?->translations?->firstWhere('locale', app()->getLocale()) ?? $attraction?->translations?->firstWhere('locale', 'en'); $name = $translation?->name ?: $attraction?->official_name; $parkTranslation = $attraction?->park?->translations?->firstWhere('locale', app()->getLocale()) ?? $attraction?->park?->translations?->firstWhere('locale', 'en'); $parkName = $parkTranslation?->name ?: $attraction?->park?->official_name; @endphp @if($coaster && $attraction)
{{ __('ui.progression_tier_'.$card->visual_tier) }}
🎢
{{ $parkName }} {{ $name }} {{ $coaster->manufacturer?->name ?: __('ui.coaster_unknown') }}
{{ $coaster->speed_kmh ? rtrim(rtrim((string)$coaster->speed_kmh, '0'), '.').' km/h' : '—' }} {{ $coaster->height_m ? rtrim(rtrim((string)$coaster->height_m, '0'), '.').' m' : '—' }} {{ $coaster->inversions ?? '—' }} {{ __('ui.park_inversions_short') }}
@endif @endforeach
@endif @if($achievements->isNotEmpty())
{{ __('ui.progression_badges_kicker') }}

{{ __('ui.progression_badges_title') }}

@foreach($achievements as $unlock) @php $translation = $unlock->achievement?->translations?->firstWhere('locale', app()->getLocale()) ?? $unlock->achievement?->translations?->firstWhere('locale', 'en'); @endphp
{{ data_get($unlock->achievement?->metadata, 'icon', '✦') }}
{{ __('ui.progression_category_'.($unlock->achievement?->category ?? 'coaster')) }} {{ $translation?->name ?: $unlock->achievement?->key }}

{{ $translation?->description }}

{{ $unlock->unlocked_at?->format('d/m/Y') }}
@endforeach
@endif @if($parkProgress->isNotEmpty())
{{ __('ui.profile_progress_kicker') }}

{{ __('ui.profile_progress_title') }}

{{ __('ui.profile_progress_intro') }}

@foreach($parkProgress as $park) @php $parkTranslation = $park->translations->firstWhere('locale', app()->getLocale()) ?? $park->translations->firstWhere('locale', 'en'); $parkName = $parkTranslation?->name ?: $park->official_name; @endphp
{{ __('ui.profile_park_progress') }}{{ $parkName }}
{{ $park->profile_percent }}%
{{ __('ui.profile_done_of', ['done' => $park->profile_done, 'total' => $park->profile_total]) }}
@endforeach
@endif
{{ __('ui.profile_recent_kicker') }}

{{ __('ui.profile_recent_rides') }}

@if($recentRides->isNotEmpty())
@foreach($recentRides as $ride) @php $attraction = $ride->attraction; $translation = $attraction?->translations?->firstWhere('locale', app()->getLocale()) ?? $attraction?->translations?->firstWhere('locale', 'en'); $rideName = $translation?->name ?: $attraction?->official_name; $parkTranslation = $attraction?->park?->translations?->firstWhere('locale', app()->getLocale()) ?? $attraction?->park?->translations?->firstWhere('locale', 'en'); @endphp
{{ $rideName }} {{ $parkTranslation?->name ?: $attraction?->park?->official_name }}
@endforeach
@else

{{ __('ui.profile_no_rides') }}

@endif
{{ __('ui.profile_manufacturers_kicker') }}

{{ __('ui.profile_manufacturers_title') }}

@if($manufacturerStats->isNotEmpty())
@foreach($manufacturerStats as $manufacturer => $count)
{{ $manufacturer }} {{ trans_choice('ui.profile_manufacturer_count', $count, ['count' => $count]) }}
@endforeach
@else

{{ __('ui.profile_no_manufacturer') }}

@endif
@if($recentVisits->isNotEmpty())
{{ __('ui.profile_recent_kicker') }}

{{ __('ui.profile_recent_visits') }}

@foreach($recentVisits as $visit) @php $translation = $visit->park?->translations?->firstWhere('locale', app()->getLocale()) ?? $visit->park?->translations?->firstWhere('locale', 'en'); $parkName = $translation?->name ?: $visit->park?->official_name; @endphp {{ $visit->starts_on?->format('d/m/Y') ?: '—' }} {{ $parkName }} {{ ucfirst($visit->status) }} @endforeach
@endif @endsection