@extends('layouts.app') @section('title',$athlete->displayName().' - FranCoach') @section('content') @php $phoneLink = $athlete->phone ? preg_replace('/[^\d+]/', '', $athlete->phone) : null; $whatsappNumber = $athlete->phone ? preg_replace('/\D/', '', $athlete->phone) : null; if ($whatsappNumber && str_starts_with($whatsappNumber, '00')) { $whatsappNumber = substr($whatsappNumber, 2); } $profile = $profile ?? $athlete->athleteProfile; $availableDays = collect($profile?->available_days ?? []) ->map(fn ($day) => $options['days'][$day] ?? ucfirst($day)) ->implode(', '); @endphp
@if($athlete->avatar_path)Avatar di {{ $athlete->displayName() }}@else{{ francoach_initials($athlete->displayName()) }}@endif

{{ $athlete->displayName() }}

{{ $athlete->email }} @if($athlete->phone)· {{ $athlete->phone }}@endif

Dati anagrafici

Nome
{{ $athlete->first_name ?: '—' }}
Cognome
{{ $athlete->last_name ?: '—' }}
Email
{{ $athlete->email }}
Telefono
{{ $athlete->phone ?: '—' }}
Data di nascita
{{ $athlete->date_of_birth ? francoach_format_date($athlete->date_of_birth) : '—' }}
Sesso
{{ $athlete->gender?->label() ?? '—' }}
Altezza
{{ $athlete->height_cm ? number_format((float) $athlete->height_cm, 1, ',', '.').' cm' : '—' }}
Indirizzo
{{ $athlete->address ?: '—' }}
Città
{{ collect([$athlete->postal_code, $athlete->city])->filter()->implode(' ') ?: '—' }}
Paese
{{ $athlete->country ?: '—' }}

Profilo sportivo

Professione
{{ $profile?->profession ?: '—' }}
Esperienza
{{ $profile?->experience_level?->label() ?? '—' }}
Livello di attività
{{ $profile?->activity_level?->label() ?? '—' }}
Peso iniziale
{{ $profile?->initial_weight_kg ? number_format((float) $profile->initial_weight_kg, 1, ',', '.').' kg' : '—' }}
Inizio percorso
{{ $profile?->started_coaching_on ? francoach_format_date($profile->started_coaching_on) : '—' }}
Luogo allenamento
{{ $profile?->training_location ?: '—' }}
Durata media
{{ $profile?->average_workout_minutes ? $profile->average_workout_minutes.' minuti' : '—' }}
Giorni disponibili
{{ $availableDays ?: '—' }}
Preferenze
{{ $profile?->preferences ?: '—' }}

Obiettivi

@forelse($goals as $goal)
{{ $goal->title }} @if($goal->is_primary)Principale@endif {{ $goal->status->label() }}
{{ $goal->goal_type->label() }} @if($goal->starting_value !== null || $goal->target_value !== null) · {{ $goal->starting_value ?? '—' }} → {{ $goal->target_value ?? '—' }} @endif @if($goal->target_date)· entro il {{ francoach_format_date($goal->target_date) }}@endif
@if($goal->notes)

{{ $goal->notes }}

@endif
@empty

Nessun obiettivo registrato.

@endforelse

Attrezzatura disponibile

@forelse($equipment as $item) {{ $item->name }} @empty Nessuna attrezzatura registrata. @endforelse

Limitazioni e condizioni

@forelse($limitations as $limitation)
{{ $limitation->title }} {{ $limitation->severity->label() }} {{ $limitation->status->label() }}
@if($limitation->muscleGroup)
{{ $limitation->muscleGroup->name }}
@endif @if($limitation->description)

{{ $limitation->description }}

@endif
{{ $limitation->started_on ? 'Dal '.francoach_format_date($limitation->started_on) : '' }} {{ $limitation->resolved_on ? ' · Risolta il '.francoach_format_date($limitation->resolved_on) : '' }}
@empty
Nessuna limitazione registrata.
@endforelse

Note

@if($profile?->coach_notes)

Note del coach

{{ $profile->coach_notes }}

@endif @if($profile?->athlete_notes)

Note dell'atleta

{{ $profile->athlete_notes }}

@endif @forelse($notes as $note)
{{ $note->category->label() }} · {{ francoach_format_datetime($note->created_at) }} · {{ $note->author?->displayName() ?? 'Sistema' }}

{{ $note->body }}

@empty @unless($profile?->coach_notes || $profile?->athlete_notes)

Nessuna nota registrata.

@endunless @endforelse

Profilo

Stato account
{{ $athlete->account_status->label() }}
@php($accessLabel=['active'=>'Attivo','expiring'=>'In scadenza','expired'=>'Scaduto','grace_period'=>'Scaduto – periodo di tolleranza','suspended'=>'Sospeso','pending_activation'=>'Da attivare','disabled'=>'Disabilitato','scheduled'=>'Programmato'][$access->status] ?? ucfirst(str_replace('_',' ',$access->status)))
Accesso
{{ $accessLabel }}
Attivazione
{{ $athlete->email_verified_at ? francoach_format_datetime($athlete->email_verified_at) : 'Da completare' }}
Inizio
{{ $access->startsAt ? francoach_format_date($access->startsAt) : '—' }}
Scadenza
{{ $access->expiresAt ? francoach_format_date($access->expiresAt) : '—' }}
Giorni rimanenti
{{ $access->remainingDays ?? '—' }}
Grace period
{{ $athlete->currentSubscription?->grace_period_days ?? 0 }} giorni @if($access->gracePeriodEnd && $athlete->currentSubscription?->grace_period_days)· blocco dal {{ francoach_format_date($access->gracePeriodEnd->addDay()) }}@endif
Login consentito
{{ $athlete->currentSubscription?->allow_login ? 'Sì' : 'No' }}
Ultimo accesso
{{ $athlete->last_login_at ? francoach_format_datetime($athlete->last_login_at) : 'Mai' }}
Scheda corrente
{{ $athlete->planAssignments->first()?->version?->plan?->name ?? '—' }}
Piano nutrizionale
{{ $athlete->nutritionAssignments->first()?->plan?->title ?? '—' }}

Invito

@php($invitation=$athlete->invitations->first())

Stato: {{ $invitation?->status?->value ?? 'Non inviato' }}

@if($invitation?->sent_at)

Ultimo invio: {{ francoach_format_datetime($invitation->sent_at) }}

@endif @if($invitation?->expires_at)

Scadenza link: {{ francoach_format_datetime($invitation->expires_at) }}

@endif @if($invitation?->error_message)
{{ $invitation->error_message }}
@endif @if(!$athlete->email_verified_at)
@csrf
@endif

Azioni rapide

@csrf
@if($athlete->account_status === \App\Enums\AccountStatus::Suspended)
@csrf @method('PATCH')
@else
@csrf @method('PATCH')
@endif
@endsection