|
@@ -5,10 +5,12 @@ namespace App\Form;
|
|
|
use App\Entity\Game;
|
|
|
use App\Entity\Genre;
|
|
|
use App\Entity\User;
|
|
|
+use App\Enum\AgeRange;
|
|
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
|
|
use Symfony\Component\Form\AbstractType;
|
|
|
use Symfony\Component\Form\FormBuilderInterface;
|
|
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
|
|
+use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
|
|
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
|
|
use Symfony\Component\Form\Extension\Core\Type\FileType;
|
|
|
use Symfony\Component\Form\Extension\Core\Type\UrlType;
|
|
@@ -45,8 +47,20 @@ class GameType extends AbstractType
|
|
|
'required' => false,
|
|
|
'row_attr' => ['class' => 'field'],
|
|
|
'help_attr' => ['class' => 'help'],
|
|
|
-
|
|
|
])
|
|
|
+ ->add('ageRecommendation', ChoiceType::class, [
|
|
|
+ 'label' => 'Âge recommandé',
|
|
|
+ 'help' => 'Indiquez la tranche d\'âge recommandée. Laissez vide si l\'âge n\'est pas déterminant.',
|
|
|
+ 'choices' => AgeRange::cases(),
|
|
|
+ 'choice_label' => fn(AgeRange $choice) => $choice->label(),
|
|
|
+ 'required' => false,
|
|
|
+ 'placeholder' => 'Aucune recommandation',
|
|
|
+ 'label_attr' => ['class' => 'label'],
|
|
|
+ 'row_attr' => ['class' => 'field'],
|
|
|
+ 'attr' => ['class' => 'input'],
|
|
|
+ 'help_attr' => ['class' => 'help'],
|
|
|
+ ])
|
|
|
+
|
|
|
->add('picture', FileType::class, [
|
|
|
'label' => 'Illustration',
|
|
|
'label_attr' => ['class' => 'label'],
|
|
@@ -68,6 +82,7 @@ class GameType extends AbstractType
|
|
|
'choice_attr' => ['class' => 'checkbox'],
|
|
|
'help_attr' => ['class' => 'help'],
|
|
|
])
|
|
|
+
|
|
|
->add('isInAssoLibrary', null, [
|
|
|
'label' => 'Dans la ludothèque de l\'association ?',
|
|
|
'label_attr' => ['class' => 'checkbox'],
|