From 7bf319e194be77924458fdeb93b12561b7a3deb6 Mon Sep 17 00:00:00 2001 From: Rafikooo Date: Thu, 2 May 2024 16:55:20 +0200 Subject: [PATCH 1/4] [Admin] Add footer template --- .../crud/common/content/footer.html.twig | 45 +++++++++++++++++++ .../Resources/translations/messages.en.yml | 4 ++ 2 files changed, 49 insertions(+) create mode 100644 src/Sylius/Bundle/AdminBundle/templates/shared/crud/common/content/footer.html.twig diff --git a/src/Sylius/Bundle/AdminBundle/templates/shared/crud/common/content/footer.html.twig b/src/Sylius/Bundle/AdminBundle/templates/shared/crud/common/content/footer.html.twig new file mode 100644 index 00000000000..4d603ef47ad --- /dev/null +++ b/src/Sylius/Bundle/AdminBundle/templates/shared/crud/common/content/footer.html.twig @@ -0,0 +1,45 @@ + diff --git a/src/Sylius/Bundle/UiBundle/Resources/translations/messages.en.yml b/src/Sylius/Bundle/UiBundle/Resources/translations/messages.en.yml index 3a51e957439..6383a921c5f 100644 --- a/src/Sylius/Bundle/UiBundle/Resources/translations/messages.en.yml +++ b/src/Sylius/Bundle/UiBundle/Resources/translations/messages.en.yml @@ -58,6 +58,7 @@ sylius: administration_panel_login: 'Administration panel login' administration_reset_password: 'Administration reset password' all: 'All' + all_rights_reserved: 'All rights reserved' all_your_addresses: 'All your addresses' amount: 'Amount' an_error_occurred: 'An error occurred' @@ -156,6 +157,7 @@ sylius: contain_variants: 'Contain Variants' contains: 'Contains' content: 'Content' + copyright: 'Copyright' countries: 'Countries' country: 'Country' country_code: 'Country code' @@ -438,6 +440,7 @@ sylius: latest_orders: 'Latest orders' latest_products: 'Latest products' less_than: 'Less than' + license: 'License' links: 'Links' list_coupons: 'List coupons' list_variants: 'List variants' @@ -821,6 +824,7 @@ sylius: slug: 'Slug' sort: 'Sort' sort_by_date: 'Sort by date' + source_code: 'Source code' source_currency: 'Source currency' start_date: 'Start Date' starts_at: 'Starts at' From 758fde0cdd208ad25f0150f85f9786006d870cf3 Mon Sep 17 00:00:00 2001 From: Rafikooo Date: Thu, 2 May 2024 16:56:37 +0200 Subject: [PATCH 2/4] [Admin] Include footer hookable in default crud content hooks --- .../Resources/config/app/twig_hooks/common/create.yaml | 2 ++ .../Resources/config/app/twig_hooks/common/index.yaml | 2 ++ .../Resources/config/app/twig_hooks/common/show.yaml | 2 ++ .../Resources/config/app/twig_hooks/common/update.yaml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/create.yaml b/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/create.yaml index 700affc23dd..7b84ea6df7a 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/create.yaml +++ b/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/create.yaml @@ -17,6 +17,8 @@ twig_hooks: template: '@SyliusAdmin/shared/crud/create/content/form.html.twig' configuration: render_rest: true + footer: + template: '@SyliusAdmin/Shared/Crud/Common/Content/footer.html.twig' 'sylius_admin.common.create.content.header': breadcrumbs: diff --git a/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/index.yaml b/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/index.yaml index 6a90b6cdad5..d42a6dfc380 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/index.yaml +++ b/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/index.yaml @@ -15,6 +15,8 @@ twig_hooks: template: '@SyliusAdmin/shared/crud/common/content/header.html.twig' grid: template: '@SyliusAdmin/shared/crud/index/content/grid.html.twig' + footer: + template: '@SyliusAdmin/shared/crud/common/content/footer.html.twig' 'sylius_admin.common.index.content.header': breadcrumbs: diff --git a/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/show.yaml b/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/show.yaml index 6834d9af046..73e61dfe37b 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/show.yaml +++ b/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/show.yaml @@ -13,6 +13,8 @@ twig_hooks: template: '@SyliusAdmin/shared/crud/common/content/flashes.html.twig' header: template: '@SyliusAdmin/shared/crud/common/content/header.html.twig' + footer: + template: '@SyliusAdmin/shared/crud/common/content/footer.html.twig' 'sylius_admin.common.show.content.header': breadcrumbs: diff --git a/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/update.yaml b/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/update.yaml index 7d12c594719..d345d08be6f 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/update.yaml +++ b/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/update.yaml @@ -17,6 +17,8 @@ twig_hooks: template: '@SyliusAdmin/shared/crud/update/content/form.html.twig' configuration: render_rest: true + footer: + template: '@SyliusAdmin/Shared/Crud/Common/Content/footer.html.twig' 'sylius_admin.common.update.content.header': breadcrumbs: From 97215973bcf4fdcb39a301078a8c55bfda784125 Mon Sep 17 00:00:00 2001 From: Rafikooo Date: Thu, 2 May 2024 17:25:29 +0200 Subject: [PATCH 3/4] [Admin] Include custom footer hookable in variant generation hook config --- .../config/app/twig_hooks/product/generate_variants.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/product/generate_variants.yaml b/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/product/generate_variants.yaml index bea0bdeec2e..aa5075f7600 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/product/generate_variants.yaml +++ b/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/product/generate_variants.yaml @@ -18,6 +18,8 @@ twig_hooks: props: resource: '@=_context.resource' form: '@=_context.form' + footer: + template: '@SyliusAdmin/shared/crud/common/content/footer.html.twig' 'sylius_admin.product.generate_variants.content.header': breadcrumbs: From 94b623e05ab5ae382704a4070adcbdcaa9ab13a7 Mon Sep 17 00:00:00 2001 From: Rafikooo Date: Thu, 2 May 2024 18:45:26 +0200 Subject: [PATCH 4/4] [Admin] Set explicit priorities for footer hookable in default views hook configs --- .../Resources/config/app/twig_hooks/common/create.yaml | 3 ++- .../Resources/config/app/twig_hooks/common/index.yaml | 1 + .../Resources/config/app/twig_hooks/common/show.yaml | 1 + .../Resources/config/app/twig_hooks/common/update.yaml | 3 ++- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/create.yaml b/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/create.yaml index 7b84ea6df7a..c8b052950d3 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/create.yaml +++ b/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/create.yaml @@ -18,7 +18,8 @@ twig_hooks: configuration: render_rest: true footer: - template: '@SyliusAdmin/Shared/Crud/Common/Content/footer.html.twig' + template: '@SyliusAdmin/shared/crud/common/content/footer.html.twig' + priority: -100 'sylius_admin.common.create.content.header': breadcrumbs: diff --git a/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/index.yaml b/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/index.yaml index d42a6dfc380..d3d3f6bebf3 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/index.yaml +++ b/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/index.yaml @@ -17,6 +17,7 @@ twig_hooks: template: '@SyliusAdmin/shared/crud/index/content/grid.html.twig' footer: template: '@SyliusAdmin/shared/crud/common/content/footer.html.twig' + priority: -100 'sylius_admin.common.index.content.header': breadcrumbs: diff --git a/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/show.yaml b/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/show.yaml index 73e61dfe37b..90dba62fbe3 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/show.yaml +++ b/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/show.yaml @@ -15,6 +15,7 @@ twig_hooks: template: '@SyliusAdmin/shared/crud/common/content/header.html.twig' footer: template: '@SyliusAdmin/shared/crud/common/content/footer.html.twig' + priority: -100 'sylius_admin.common.show.content.header': breadcrumbs: diff --git a/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/update.yaml b/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/update.yaml index d345d08be6f..cf8b880cf96 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/update.yaml +++ b/src/Sylius/Bundle/AdminBundle/Resources/config/app/twig_hooks/common/update.yaml @@ -18,7 +18,8 @@ twig_hooks: configuration: render_rest: true footer: - template: '@SyliusAdmin/Shared/Crud/Common/Content/footer.html.twig' + template: '@SyliusAdmin/shared/crud/common/content/footer.html.twig' + priority: -100 'sylius_admin.common.update.content.header': breadcrumbs: