diff --git a/public/css/components/login.css b/public/css/components/login.css new file mode 100644 index 0000000..3802a53 --- /dev/null +++ b/public/css/components/login.css @@ -0,0 +1,54 @@ +.form-container { + background-color: #f2f2f2; + padding: 2rem; + border-radius: 8px; + width: 30%; + text-align: center; + margin: 0 auto; + margin-top: 15vh; + + form { + div { + .form-group { + display: flex; + flex-direction: column; + align-items: start !important; + } + + button[type="submit"] { + width: 100%; + } + } + } +} + +.form-container h1 { + margin-bottom: 1.5rem; +} + +.form-container .btn { + margin-top: 1rem; + width: 100%; + padding: 0.5rem; + border: none; + background-color: #007bff; + color: #ffffff; + border-radius: 4px; + cursor: pointer; + +} + +.form-container .btn:hover { + background-color: #0056b3; +} + +.form-container a { + display: block; + margin-top: 1rem; + color: #007bff; + text-decoration: none; +} + +.form-container a:hover { + text-decoration: underline; +} \ No newline at end of file diff --git a/src/Form/RegistrationFormType.php b/src/Form/RegistrationFormType.php index 9a657ba..781c954 100644 --- a/src/Form/RegistrationFormType.php +++ b/src/Form/RegistrationFormType.php @@ -6,28 +6,32 @@ use App\Entity\Profil; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\PasswordType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; -use Symfony\Component\Validator\Constraints\IsTrue; -use Symfony\Component\Validator\Constraints\Length; -use Symfony\Component\Validator\Constraints\NotBlank; class RegistrationFormType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options): void { $builder - ->add('name') - ->add('agreeTerms', CheckboxType::class, [ - 'mapped' => false, - 'invalid_message' => 'You should agree to our terms.', + ->add('name', TextType::class, [ + 'label' => 'Username' ]) ->add('plainPassword', PasswordType::class, [ + 'label' => 'Password', 'mapped' => false, 'attr' => ['autocomplete' => 'new-password'], 'invalid_message' => 'Please enter a password', ]) - ; + ->add('agreeTerms', CheckboxType::class, [ + 'mapped' => false, + 'invalid_message' => 'You should agree to our terms.', + ]) + ->add('submit', SubmitType::class, [ + 'label' => 'Register' + ]); } public function configureOptions(OptionsResolver $resolver): void diff --git a/templates/registration/register.html.twig b/templates/registration/register.html.twig index 85f079f..990d4c9 100644 --- a/templates/registration/register.html.twig +++ b/templates/registration/register.html.twig @@ -3,68 +3,16 @@ {% block title %}Register{% endblock %} {% block stylesheets %} - + + {% endblock %} +{% form_theme registrationForm 'form/theme.html.twig' %} + {% block body %}