From dfea88915f82248215a927683e3ae0d50111e466 Mon Sep 17 00:00:00 2001 From: Sam V Date: Mon, 2 Nov 2026 21:56:36 +0100 Subject: [PATCH] fix(bootstrap-admin-ui): space the create and update forms from the page header The form's container followed .page-header with no margin, so the form card touched the header's action buttons. Its .card-body wrapper has no padding outside a .card, where --tblr-card-spacer-y is undefined. Wrap the form in .page-body like the index grid, and give the form error alert the same top margin so every gap is the page padding. The alert also compares the form validity strictly. Co-Authored-By: Claude Opus 5.5 --- .../shared/crud/common/content/form.html.twig | 26 ++++++++++--------- .../common/content/form_error_alert.html.twig | 6 ++--- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/BootstrapAdminUi/templates/shared/crud/common/content/form.html.twig b/src/BootstrapAdminUi/templates/shared/crud/common/content/form.html.twig index dacf3d35..43b2c5a9 100644 --- a/src/BootstrapAdminUi/templates/shared/crud/common/content/form.html.twig +++ b/src/BootstrapAdminUi/templates/shared/crud/common/content/form.html.twig @@ -9,19 +9,21 @@ {% if form is not null %} {% form_theme form '@SyliusBootstrapAdminUi/shared/form_theme.html.twig' %} -
- {{ form_start(form, {'attr': {'novalidate': 'novalidate', 'id': form.vars.id}}) }} -
- {% if hookable_metadata.configuration.method is defined %} - - {% elseif form.vars.data.id|default(null) is not null %} - - {% endif %} - {{ form_errors(form) }} - {{ form_widget(form._token) }} +
+
+ {{ form_start(form, {'attr': {'novalidate': 'novalidate', 'id': form.vars.id}}) }} +
+ {% if hookable_metadata.configuration.method is defined %} + + {% elseif form.vars.data.id|default(null) is not null %} + + {% endif %} + {{ form_errors(form) }} + {{ form_widget(form._token) }} - {% hook 'form' with { form, resource } %} + {% hook 'form' with { form, resource } %} +
+ {{ form_end(form, {render_rest: hookable_metadata.configuration.render_rest|default(false)}) }}
- {{ form_end(form, {render_rest: hookable_metadata.configuration.render_rest|default(false)}) }}
{% endif %} diff --git a/src/BootstrapAdminUi/templates/shared/crud/common/content/form_error_alert.html.twig b/src/BootstrapAdminUi/templates/shared/crud/common/content/form_error_alert.html.twig index 5db1f4ce..9ea60dd5 100644 --- a/src/BootstrapAdminUi/templates/shared/crud/common/content/form_error_alert.html.twig +++ b/src/BootstrapAdminUi/templates/shared/crud/common/content/form_error_alert.html.twig @@ -1,8 +1,8 @@ {% set form = hookable_metadata.context.form|default(null) %} -{% if form is not null and form.vars.valid == false %} -
-