From f6c4e21f7608b2c62b0cabbfa3b87ba3609cef73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81ro=CC=82me=20Engeln?= Date: Mon, 25 Nov 2024 21:07:57 +0100 Subject: [PATCH 1/2] fix: change action path with dynamics routes name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Engeln --- .../header/title_block/actions/edit.html.twig | 18 +++++++++++------- .../header/title_block/actions/show.html.twig | 3 +-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/Sylius/Bundle/AdminBundle/templates/shared/crud/show/content/header/title_block/actions/edit.html.twig b/src/Sylius/Bundle/AdminBundle/templates/shared/crud/show/content/header/title_block/actions/edit.html.twig index 45db33b300a..d73729c5227 100644 --- a/src/Sylius/Bundle/AdminBundle/templates/shared/crud/show/content/header/title_block/actions/edit.html.twig +++ b/src/Sylius/Bundle/AdminBundle/templates/shared/crud/show/content/header/title_block/actions/edit.html.twig @@ -1,8 +1,12 @@ -{% set resource_id = hookable_metadata.context.resource.id %} -{% set resource_name = hookable_metadata.context.metadata.name %} -{% set url = 'sylius_admin_' ~ resource_name ~ '_update' %} +{% set configuration = hookable_metadata.context.configuration %} +{% set update_route_name = configuration.vars.update.route.name|default(configuration.getRouteName('update')) %} - - {{ ux_icon('tabler:pencil') }} - {{ 'sylius.ui.edit'|trans }} - +{% if sylius_route_exists(update_route_name) %} + {% set resource_id = hookable_metadata.context.resource.id %} + {% set resource_name = hookable_metadata.context.metadata.name %} + + + {{ ux_icon('tabler:pencil') }} + {{ 'sylius.ui.edit'|trans }} + +{% endif %} diff --git a/src/Sylius/Bundle/AdminBundle/templates/shared/crud/update/content/header/title_block/actions/show.html.twig b/src/Sylius/Bundle/AdminBundle/templates/shared/crud/update/content/header/title_block/actions/show.html.twig index 9a08c20ba51..79f05f8d546 100644 --- a/src/Sylius/Bundle/AdminBundle/templates/shared/crud/update/content/header/title_block/actions/show.html.twig +++ b/src/Sylius/Bundle/AdminBundle/templates/shared/crud/update/content/header/title_block/actions/show.html.twig @@ -4,9 +4,8 @@ {% if sylius_route_exists(show_route_name) %} {% set resource_id = hookable_metadata.context.resource.id %} {% set resource_name = hookable_metadata.context.metadata.name %} - {% set url = 'sylius_admin_' ~ resource_name ~ '_show' %} - + {{ ux_icon('tabler:eye') }} {{ 'sylius.ui.show'|trans }} From 29b1a7d2a2683eb7169803c5ea610cadbf3f7c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81ro=CC=82me=20Engeln?= Date: Mon, 25 Nov 2024 21:11:31 +0100 Subject: [PATCH 2/2] fix: typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Engeln --- .../update/content/header/title_block/actions/show.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sylius/Bundle/AdminBundle/templates/shared/crud/update/content/header/title_block/actions/show.html.twig b/src/Sylius/Bundle/AdminBundle/templates/shared/crud/update/content/header/title_block/actions/show.html.twig index 79f05f8d546..cc26e24a167 100644 --- a/src/Sylius/Bundle/AdminBundle/templates/shared/crud/update/content/header/title_block/actions/show.html.twig +++ b/src/Sylius/Bundle/AdminBundle/templates/shared/crud/update/content/header/title_block/actions/show.html.twig @@ -5,7 +5,7 @@ {% set resource_id = hookable_metadata.context.resource.id %} {% set resource_name = hookable_metadata.context.metadata.name %} - + {{ ux_icon('tabler:eye') }} {{ 'sylius.ui.show'|trans }}