File tree Expand file tree Collapse file tree
config/app/twig_hooks/common
templates/shared/crud/common/content Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # UPGRADE
2+
3+ ## Unreleased
4+
5+ ### BootstrapAdminUi
6+
7+ * The create/update content composition gained a ` body ` hookable that renders
8+ the Tabler ` .page-body ` wrapper. The ` form_error_alert ` and ` form ` hookables
9+ moved inside it:
10+
11+ | Before | After |
12+ | ---| ---|
13+ | ` sylius_admin.common.create.content.form_error_alert ` | ` sylius_admin.common.create.content.body.form_error_alert ` |
14+ | ` sylius_admin.common.create.content.form ` | ` sylius_admin.common.create.content.body.form ` |
15+ | ` sylius_admin.common.update.content.form_error_alert ` | ` sylius_admin.common.update.content.body.form_error_alert ` |
16+ | ` sylius_admin.common.update.content.form ` | ` sylius_admin.common.update.content.body.form ` |
17+
18+ Hook configuration and templates targeting these hookables or their children
19+ (e.g. ` …content.form.sections.general ` ) must be retargeted accordingly. Apps
20+ that overrode ` shared/crud/common/content/form.html.twig ` to add the missing
21+ ` .page-body ` themselves should drop that override to avoid double wrapping.
Original file line number Diff line number Diff line change 5454 'header ' => [
5555 'template ' => '@SyliusBootstrapAdminUi/shared/crud/common/content/header.html.twig ' ,
5656 ],
57+ 'body ' => [
58+ 'template ' => '@SyliusBootstrapAdminUi/shared/crud/common/content/body.html.twig ' ,
59+ ],
60+ ],
61+
62+ 'sylius_admin.common.create.content.body ' => [
5763 'form_error_alert ' => [
5864 'template ' => '@SyliusBootstrapAdminUi/shared/crud/common/content/form_error_alert.html.twig ' ,
5965 ],
8995 ],
9096 ],
9197
92- 'sylius_admin.common.create.content.form ' => [
98+ 'sylius_admin.common.create.content.body. form ' => [
9399 'sections ' => [
94100 'template ' => '@SyliusBootstrapAdminUi/shared/crud/common/content/form/sections.html.twig ' ,
95101 ],
96102 ],
97103
98- 'sylius_admin.common.create.content.form.sections ' => [
104+ 'sylius_admin.common.create.content.body. form.sections ' => [
99105 'general ' => [
100106 'template ' => '@SyliusBootstrapAdminUi/shared/crud/common/content/form/sections/general.html.twig ' ,
101107 ],
102108 ],
103109
104- 'sylius_admin.common.create.content.form.sections.general ' => [
110+ 'sylius_admin.common.create.content.body. form.sections.general ' => [
105111 'default ' => [
106112 'template ' => '@SyliusBootstrapAdminUi/shared/crud/common/content/form/sections/general/default.html.twig ' ,
107113 ],
Original file line number Diff line number Diff line change 5454 'header ' => [
5555 'template ' => '@SyliusBootstrapAdminUi/shared/crud/common/content/header.html.twig ' ,
5656 ],
57+ 'body ' => [
58+ 'template ' => '@SyliusBootstrapAdminUi/shared/crud/common/content/body.html.twig ' ,
59+ ],
60+ ],
61+
62+ 'sylius_admin.common.update.content.body ' => [
5763 'form_error_alert ' => [
5864 'template ' => '@SyliusBootstrapAdminUi/shared/crud/common/content/form_error_alert.html.twig ' ,
5965 ],
9197 ],
9298 ],
9399
94- 'sylius_admin.common.update.content.form ' => [
100+ 'sylius_admin.common.update.content.body. form ' => [
95101 'sections ' => [
96102 'template ' => '@SyliusBootstrapAdminUi/shared/crud/common/content/form/sections.html.twig ' ,
97103 ],
98104 ],
99105
100- 'sylius_admin.common.update.content.form.sections ' => [
106+ 'sylius_admin.common.update.content.body. form.sections ' => [
101107 'general ' => [
102108 'template ' => '@SyliusBootstrapAdminUi/shared/crud/common/content/form/sections/general.html.twig ' ,
103109 ],
104110 ],
105111
106- 'sylius_admin.common.update.content.form.sections.general ' => [
112+ 'sylius_admin.common.update.content.body. form.sections.general ' => [
107113 'default ' => [
108114 'template ' => '@SyliusBootstrapAdminUi/shared/crud/common/content/form/sections/general/default.html.twig ' ,
109115 ],
Original file line number Diff line number Diff line change 1+ <div class =" page-body" >
2+ {% hook ' body' %}
3+ </div >
Original file line number Diff line number Diff line change @@ -38,4 +38,17 @@ public function testIndexTemplate(): void
3838 $ this ->assertAnySelectorTextSame ('.nav-link-title ' , 'Dashboard ' ); // with "messages" domain
3939 $ this ->assertAnySelectorTextSame ('.nav-link-title ' , 'Library ' ); // with "menu" domain
4040 }
41+
42+ public function testCreateTemplatePageStructure (): void
43+ {
44+ $ this ->client ->request ('GET ' , '/books/new ' );
45+
46+ $ this ->assertResponseIsSuccessful ();
47+ // Tabler layout: .page-body must be the .page-header's sibling — its
48+ // top margin provides the header-to-content spacing.
49+ $ this ->assertSelectorExists ('.page-wrapper > .page-header ' );
50+ $ this ->assertSelectorExists ('.page-header + .page-body ' );
51+ $ this ->assertSelectorExists ('.page-body form ' );
52+ $ this ->assertSelectorExists ('.page-body form input[name="book_resource[name]"] ' );
53+ }
4154}
You can’t perform that action at this time.
0 commit comments