feat: lang middleware and filament translations
This commit is contained in:
@@ -22,28 +22,28 @@ class UserForm
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
Section::make('Compte')
|
||||
Section::make(__('admin.users.sections.account'))
|
||||
->columns(2)
|
||||
->schema([
|
||||
TextInput::make('name')
|
||||
->label('Nom')
|
||||
->label(__('admin.users.fields.name'))
|
||||
->required()
|
||||
->maxLength(255),
|
||||
TextInput::make('email')
|
||||
->label('Adresse email')
|
||||
->label(__('admin.users.fields.email'))
|
||||
->email()
|
||||
->required()
|
||||
->unique(ignoreRecord: true)
|
||||
->maxLength(255),
|
||||
FileUpload::make('avatar_url')
|
||||
->label('Avatar')
|
||||
->label(__('admin.users.fields.avatar'))
|
||||
->image()
|
||||
->disk('public')
|
||||
->directory('avatars')
|
||||
->visibility('public')
|
||||
->maxSize(2048),
|
||||
TextInput::make('password')
|
||||
->label('Mot de passe')
|
||||
->label(__('admin.users.fields.password'))
|
||||
->password()
|
||||
->revealable()
|
||||
->rule(Password::default())
|
||||
@@ -52,38 +52,38 @@ class UserForm
|
||||
->dehydrated(fn ($state): bool => filled($state))
|
||||
->autocomplete('new-password'),
|
||||
DateTimePicker::make('email_verified_at')
|
||||
->label('Email vérifié le'),
|
||||
->label(__('admin.users.fields.email_verified_at')),
|
||||
DateTimePicker::make('account_verified_at')
|
||||
->label('Compte vérifié le'),
|
||||
->label(__('admin.users.fields.account_verified_at')),
|
||||
]),
|
||||
Section::make('Profil')
|
||||
Section::make(__('admin.users.sections.profile'))
|
||||
->columns(2)
|
||||
->schema([
|
||||
Textarea::make('bio')
|
||||
->label('Bio')
|
||||
->label(__('admin.users.fields.bio'))
|
||||
->rows(4)
|
||||
->columnSpanFull(),
|
||||
TextInput::make('height')
|
||||
->label('Taille')
|
||||
->label(__('admin.users.fields.height'))
|
||||
->integer()
|
||||
->minValue(0)
|
||||
->maxValue(300)
|
||||
->suffix('cm'),
|
||||
DatePicker::make('date_of_birth')
|
||||
->label('Date de naissance')
|
||||
->label(__('admin.users.fields.date_of_birth'))
|
||||
->minDate('1900-01-01')
|
||||
->maxDate(now()->subDay()),
|
||||
Select::make('sex')
|
||||
->label('Sexe')
|
||||
->label(__('admin.users.fields.sex'))
|
||||
->options(UserSex::class)
|
||||
->default(UserSex::UNKNOWN->value)
|
||||
->required(),
|
||||
]),
|
||||
Section::make('Objectifs nutritionnels')
|
||||
Section::make(__('admin.users.sections.nutrition_goals'))
|
||||
->columns(4)
|
||||
->schema([
|
||||
TextInput::make('daily_calorie_goal')
|
||||
->label('Calories')
|
||||
->label(__('admin.users.fields.daily_calorie_goal'))
|
||||
->integer()
|
||||
->minValue(0)
|
||||
->maxValue(100000)
|
||||
@@ -91,7 +91,7 @@ class UserForm
|
||||
->default(2000)
|
||||
->required(),
|
||||
TextInput::make('daily_protein_goal')
|
||||
->label('Protéines')
|
||||
->label(__('admin.users.fields.daily_protein_goal'))
|
||||
->numeric()
|
||||
->minValue(0)
|
||||
->maxValue(10000)
|
||||
@@ -99,7 +99,7 @@ class UserForm
|
||||
->default(120)
|
||||
->required(),
|
||||
TextInput::make('daily_carbs_goal')
|
||||
->label('Glucides')
|
||||
->label(__('admin.users.fields.daily_carbs_goal'))
|
||||
->numeric()
|
||||
->minValue(0)
|
||||
->maxValue(10000)
|
||||
@@ -107,7 +107,7 @@ class UserForm
|
||||
->default(250)
|
||||
->required(),
|
||||
TextInput::make('daily_fats_goal')
|
||||
->label('Lipides')
|
||||
->label(__('admin.users.fields.daily_fats_goal'))
|
||||
->numeric()
|
||||
->minValue(0)
|
||||
->maxValue(10000)
|
||||
@@ -115,21 +115,21 @@ class UserForm
|
||||
->default(70)
|
||||
->required(),
|
||||
]),
|
||||
Section::make('Activité')
|
||||
Section::make(__('admin.users.sections.activity'))
|
||||
->columns(3)
|
||||
->schema([
|
||||
Select::make('physical_activity_level')
|
||||
->label('Niveau d’activité')
|
||||
->label(__('admin.users.fields.physical_activity_level'))
|
||||
->options(PhysicalActivityLevel::class)
|
||||
->default(PhysicalActivityLevel::SEDENTARY->value)
|
||||
->required(),
|
||||
Select::make('weight_goal')
|
||||
->label('Objectif de poids')
|
||||
->label(__('admin.users.fields.weight_goal'))
|
||||
->options(WeightGoal::class)
|
||||
->default(WeightGoal::LOSE_WEIGHT->value)
|
||||
->required(),
|
||||
Select::make('pace_preference')
|
||||
->label('Rythme')
|
||||
->label(__('admin.users.fields.pace_preference'))
|
||||
->options(PacePreference::class)
|
||||
->default(PacePreference::SLOW->value)
|
||||
->required(),
|
||||
|
||||
Reference in New Issue
Block a user