From c2c5a66be6285556191e678a231ef1d5e70d4d5f Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 16 Dec 2024 19:52:30 +0100 Subject: [PATCH] Fixes --- config/services.php | 4 -- .../EasyAdminExtension.php | 4 +- templates/layout.html.twig | 40 +++++++++++-------- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/config/services.php b/config/services.php index b5f9eae70a..816d9d7e76 100644 --- a/config/services.php +++ b/config/services.php @@ -83,7 +83,6 @@ use EasyCorp\Bundle\EasyAdminBundle\Security\AuthorizationChecker; use EasyCorp\Bundle\EasyAdminBundle\Security\SecurityVoter; use EasyCorp\Bundle\EasyAdminBundle\Twig\Component\Alert; -use EasyCorp\Bundle\EasyAdminBundle\Twig\Component\ActionMenu; use EasyCorp\Bundle\EasyAdminBundle\Twig\Component\Flag; use EasyCorp\Bundle\EasyAdminBundle\Twig\Component\Icon; use EasyCorp\Bundle\EasyAdminBundle\Twig\EasyAdminTwigExtension; @@ -408,8 +407,5 @@ ->set(Alert::class) ->tag('twig.component') - - ->set(ActionMenu::class) - ->tag('twig.component') ; }; diff --git a/src/DependencyInjection/EasyAdminExtension.php b/src/DependencyInjection/EasyAdminExtension.php index b2fcbe0c07..fb11f2b743 100644 --- a/src/DependencyInjection/EasyAdminExtension.php +++ b/src/DependencyInjection/EasyAdminExtension.php @@ -56,10 +56,10 @@ public function prepend(ContainerBuilder $builder): void 'paths' => is_dir($bundleTemplatesOverrideDir) ? [ 'templates/bundles/EasyAdminBundle/' => null, - dirname(__DIR__).'/../templates/' => 'ea', + \dirname(__DIR__).'/../templates/' => 'ea', ] : [ - dirname(__DIR__).'/../templates/' => 'ea', + \dirname(__DIR__).'/../templates/' => 'ea', ], ]); } diff --git a/templates/layout.html.twig b/templates/layout.html.twig index 1106eb47d9..bacc3d50bf 100644 --- a/templates/layout.html.twig +++ b/templates/layout.html.twig @@ -81,20 +81,8 @@ {% endif %} {% endset %} - - - {% set impersonator_permission = constant('Symfony\\Component\\Security\\Core\\Authorization\\Voter\\AuthenticatedVoter::IS_IMPERSONATOR') is defined ? 'IS_IMPERSONATOR' : 'ROLE_PREVIOUS_ADMIN' %} - - {% set user_menu_dropdown %} - - -
{{ user_menu_avatar }}
-
- {{ 'user.logged_in_as'|trans(domain = 'EasyAdminBundle') }} - {{ ea.user is null ? 'user.anonymous'|trans(domain = 'EasyAdminBundle') : ea.userMenu.name }} -
-
- + {% set user_menu %} + {% block user_menu %} {% if ea.userMenu.items|length > 0 %} @@ -111,6 +99,22 @@ {% endif %} {% endfor %} {% endif %} + {% endblock %} + {% endset %} + + {% set impersonator_permission = constant('Symfony\\Component\\Security\\Core\\Authorization\\Voter\\AuthenticatedVoter::IS_IMPERSONATOR') is defined ? 'IS_IMPERSONATOR' : 'ROLE_PREVIOUS_ADMIN' %} + + {% set user_menu_dropdown %} + + +
{{ user_menu_avatar }}
+
+ {{ 'user.logged_in_as'|trans(domain = 'EasyAdminBundle') }} + {{ ea.user is null ? 'user.anonymous'|trans(domain = 'EasyAdminBundle') : ea.userMenu.name }} +
+
+ + {{ user_menu }}
{% endset %} @@ -123,9 +127,11 @@ - - {{ 'settings.locale'|trans(domain = 'EasyAdminBundle') }} - + {% if ea.dashboardLocales %} + + {{ 'settings.locale'|trans(domain = 'EasyAdminBundle') }} + + {% endif %} {% for localeDto in ea.dashboardLocales %}