Refactor elimination feature and improve backoffice usability

This commit introduces a refactored EliminationFactory for better modularity, updates the elimination preparation process, and adds functionality to view eliminations. Backoffice templates and forms have been reorganized, minor translations were corrected, and additional assets like styles and flashes were included for enhanced user experience.
This commit is contained in:
2025-05-30 20:38:20 +02:00
parent e0350c8c31
commit d3e5cb0569
45 changed files with 1569 additions and 978 deletions

View File

@@ -19,7 +19,7 @@ class AddCandidatesFormType extends AbstractType
{
$builder
->add('candidates', TextareaType::class, [
'label' => $this->translator->trans('Candidates'),
'label' => $this->translator->trans('Candidates'), 'translation_domain' => false,
])
;
}

View File

@@ -21,6 +21,7 @@ class CreateSeasonFormType extends AbstractType
$builder
->add('name', TextType::class, [
'label' => $this->translator->trans('Season Name'),
'translation_domain' => false,
])
;
}

View File

@@ -18,7 +18,11 @@ class EnterNameType extends AbstractType
{
$builder
->add('name', TextType::class,
['required' => true, 'label' => $this->translator->trans('Enter your name')],
[
'required' => true,
'label' => $this->translator->trans('Enter your name'),
'translation_domain' => false,
],
)
;
}

View File

@@ -8,6 +8,7 @@ use App\Entity\User;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\Length;
@@ -27,11 +28,16 @@ class RegistrationFormType extends AbstractType
->add('email', EmailType::class, [
'label' => $this->translator->trans('Email'),
'attr' => ['autocomplete' => 'email'],
'translation_domain' => false,
])
->add('plainPassword', PasswordType::class, [
'label' => $this->translator->trans('Password'),
->add('plainPassword', RepeatedType::class, [
'type' => PasswordType::class,
'invalid_message' => $this->translator->trans('The password fields must match.'),
'options' => ['attr' => ['class' => 'password-field']],
'required' => true,
'first_options' => ['label' => $this->translator->trans('Password')],
'second_options' => ['label' => $this->translator->trans('Repeat Password')],
'mapped' => false,
'attr' => ['autocomplete' => 'new-password'],
'constraints' => [
new NotBlank([
'message' => 'Please enter a password',
@@ -43,6 +49,7 @@ class RegistrationFormType extends AbstractType
'max' => 4096,
]),
],
'translation_domain' => false,
])
;
}

View File

@@ -20,7 +20,7 @@ class SelectSeasonType extends AbstractType
{
$builder
->add('season_code', TextType::class,
['required' => true, 'constraints' => new Regex(pattern: "/^[A-Za-z\d]{5}$/"), 'label' => $this->translator->trans('Season Code')]
['required' => true, 'constraints' => new Regex(pattern: "/^[A-Za-z\d]{5}$/"), 'label' => $this->translator->trans('Season Code'), 'translation_domain' => false]
)
;
}

View File

@@ -23,11 +23,13 @@ class UploadQuizFormType extends AbstractType
$builder
->add('name', TextType::class, [
'label' => $this->translator->trans('Quiz name'),
'translation_domain' => false,
])
->add('sheet', FileType::class, [
'label' => $this->translator->trans('Quiz (xlsx)'),
'mapped' => false,
'required' => true,
'translation_domain' => false,
'constraints' => [
new File([
'maxSize' => '1024k',