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 %}