From 950b1ca58f765c8c3b56fb88dd497f9531aac8e6 Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 16 Oct 2025 09:42:33 +0200 Subject: [PATCH] form styling (new chapter) --- src/Form/CategoryType.php | 5 ++++- templates/chapter/edit.html.twig | 2 +- templates/chapter/new.html.twig | 8 +++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Form/CategoryType.php b/src/Form/CategoryType.php index acada56..0b5eb42 100644 --- a/src/Form/CategoryType.php +++ b/src/Form/CategoryType.php @@ -7,13 +7,16 @@ use Symfony\Component\Form\CallbackTransformer; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; +use Symfony\Component\Form\Extension\Core\Type\TextType; class CategoryType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options): void { $builder - ->add('titleJson'); + ->add('titleJson', TextType::class, [ + 'label_format' => 'Titre' + ]); $builder->get('titleJson') ->addModelTransformer(new CallbackTransformer( diff --git a/templates/chapter/edit.html.twig b/templates/chapter/edit.html.twig index c4d3fe1..3361c95 100644 --- a/templates/chapter/edit.html.twig +++ b/templates/chapter/edit.html.twig @@ -4,7 +4,7 @@ {% block main %}
-

Éditer Chapitre

+

Éditer Chapitre

{{ include('chapter/_form.html.twig', {'button_label': 'Valider'}) }} diff --git a/templates/chapter/new.html.twig b/templates/chapter/new.html.twig index 6cdfe2b..f0e25e2 100644 --- a/templates/chapter/new.html.twig +++ b/templates/chapter/new.html.twig @@ -3,9 +3,11 @@ {% block title %}New Chapter{% endblock %} {% block main %} -

Ajouter un nouveau chapitre

+
+

Ajouter un nouveau chapitre

- {{ include('chapter/_form.html.twig') }} + {{ include('chapter/_form.html.twig') }} - Retour à la liste + Retour +
{% endblock %}