diff --git a/src/Bundle/ChillMainBundle/Form/Type/CommentType.php b/src/Bundle/ChillMainBundle/Form/Type/CommentType.php index 9b8fc4701..542a429c6 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/CommentType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/CommentType.php @@ -56,12 +56,7 @@ class CommentType extends AbstractType public function buildView(FormView $view, FormInterface $form, array $options) { - $view->vars = array_replace( - $view->vars, - [ - 'fullWidth' => true, - ] - ); + $view->vars['fullWidth'] = true; } public function configureOptions(OptionsResolver $resolver) diff --git a/src/Bundle/ChillMainBundle/Form/Type/PrivateCommentType.php b/src/Bundle/ChillMainBundle/Form/Type/PrivateCommentType.php index 2ab318d9c..5c29f4d42 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PrivateCommentType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PrivateCommentType.php @@ -39,7 +39,7 @@ class PrivateCommentType extends AbstractType $builder ->add('comments', ChillTextareaType::class, [ 'disable_editor' => $options['disable_editor'], - 'label' => false, + 'label' => $options['label'], ]) ->setDataMapper($this->dataMapper); } diff --git a/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php b/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php index f65677dc7..79ed6df40 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php @@ -95,12 +95,7 @@ class ScopePickerType extends AbstractType public function buildView(FormView $view, FormInterface $form, array $options) { - $view->vars = array_replace( - $view->vars, - [ - 'fullWidth' => true, - ] - ); + $view->vars['fullWidth'] = true; } public function configureOptions(OptionsResolver $resolver) diff --git a/src/Bundle/ChillMainBundle/Resources/views/Form/bootstrap5/bootstrap_5_horizontal_layout.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Form/bootstrap5/bootstrap_5_horizontal_layout.html.twig index f4a2c3294..1afdbb2c9 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Form/bootstrap5/bootstrap_5_horizontal_layout.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Form/bootstrap5/bootstrap_5_horizontal_layout.html.twig @@ -68,7 +68,8 @@ {{- form_errors(form) -}} {% else %} -
+
{{- form_label(form) -}}
+
{{- form_widget(form, widget_attr) -}} {{- form_help(form) -}} {{- form_errors(form) -}} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig index 96c194a76..28c55c9c1 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig @@ -18,43 +18,48 @@ {% block form_row %} {% apply spaceless %} - {% if form.vars.fullWidth is not defined or form.vars.fullWidth == false %}
-
+ {% if attr.class is not defined or ('cf-title' not in attr.class and 'cf-fields' not in attr.class ) %} + {{ form_label(form) }} {% endif %} - {% endapply %}"> - {% if attr.class is not defined or ('cf-title' not in attr.class and 'cf-fields' not in attr.class ) %} - {{ form_label(form) }} +
+
+ {{ form_widget(form) }} + {{ form_errors(form) }} +
+ {% else %} +
{{ form_label(form) }}
+
{{ form_widget(form) }}
{% endif %} -
-
- {{ form_widget(form) }} - {{ form_errors(form) }} -
- {% else %} - {{ form_widget(form) }} - {% endif %} {% endapply %} {% endblock form_row %} +{# + The block 'form_row' above may be removed ! + Read this note: https://gitlab.com/Chill-Projet/chill-bundles/-/merge_requests/502#note_1311993084 +#} {% block choice_widget_expanded %} {% apply spaceless %} @@ -200,7 +205,6 @@ {% block private_comment_row %} - {{ form_label(form) }} {{ form_row(form) }} {% endblock %} @@ -211,7 +215,6 @@ {% endblock %} {% block comment_row %} - {{ form_label(form) }} {{ form_row(form) }} {% endblock %}