Filament moderne (groupes nav, 4 charts, filtres/badges) + Filament Shield (rôles/permissions) + noms exos localisés dans routines
Build & Deploy / build (push) Successful in 19s
Build & Deploy / build (push) Successful in 19s
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\WorkoutSessions\Schemas;
|
||||
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Schemas\Schema;
|
||||
use Functional\Tracking\Enums\WorkoutSessionStatus;
|
||||
|
||||
class WorkoutSessionForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
Select::make('user_id')
|
||||
->relationship('user', 'name')
|
||||
->required(),
|
||||
Select::make('routine_id')
|
||||
->relationship('routine', 'name'),
|
||||
Select::make('program_id')
|
||||
->relationship('program', 'name'),
|
||||
TextInput::make('title'),
|
||||
DateTimePicker::make('started_at')
|
||||
->required(),
|
||||
DateTimePicker::make('ended_at'),
|
||||
Select::make('status')
|
||||
->options(WorkoutSessionStatus::class)
|
||||
->default('active')
|
||||
->required(),
|
||||
Textarea::make('notes')
|
||||
->columnSpanFull(),
|
||||
TextInput::make('total_volume')
|
||||
->numeric(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\WorkoutSessions\Schemas;
|
||||
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Schema;
|
||||
use Functional\Tracking\Enums\WorkoutSessionStatus;
|
||||
|
||||
/**
|
||||
* Fiche de consultation d'une séance (modal "Voir") : données loguées par l'utilisateur/l'app,
|
||||
* jamais créées ni modifiées à la main depuis le back-office.
|
||||
*/
|
||||
class WorkoutSessionInfolist
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextEntry::make('user.name')
|
||||
->label('Utilisateur'),
|
||||
TextEntry::make('title')
|
||||
->label('Titre')
|
||||
->placeholder('—'),
|
||||
TextEntry::make('routine.name')
|
||||
->label('Routine')
|
||||
->placeholder('—'),
|
||||
TextEntry::make('program.name')
|
||||
->label('Programme')
|
||||
->placeholder('—'),
|
||||
TextEntry::make('status')
|
||||
->label('Statut')
|
||||
->badge()
|
||||
->color(fn (WorkoutSessionStatus $state): string => match ($state) {
|
||||
WorkoutSessionStatus::Active => 'warning',
|
||||
WorkoutSessionStatus::Completed => 'success',
|
||||
WorkoutSessionStatus::Abandoned => 'danger',
|
||||
}),
|
||||
TextEntry::make('started_at')
|
||||
->label('Débutée le')
|
||||
->dateTime(),
|
||||
TextEntry::make('ended_at')
|
||||
->label('Terminée le')
|
||||
->dateTime()
|
||||
->placeholder('—'),
|
||||
TextEntry::make('total_volume')
|
||||
->label('Volume total')
|
||||
->numeric()
|
||||
->placeholder('—'),
|
||||
TextEntry::make('notes')
|
||||
->label('Notes')
|
||||
->columnSpanFull()
|
||||
->placeholder('—'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user