Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Dec 16, 2024
1 parent e967d95 commit c2c5a66
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
4 changes: 0 additions & 4 deletions config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -408,8 +407,5 @@

->set(Alert::class)
->tag('twig.component')

->set(ActionMenu::class)
->tag('twig.component')
;
};
4 changes: 2 additions & 2 deletions src/DependencyInjection/EasyAdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
]);
}
Expand Down
40 changes: 23 additions & 17 deletions templates/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
<twig:ea:ActionMenu:ActionList>
<twig:ea:ActionMenu:ActionList:Content class="dropdown-user-details">
<div>{{ user_menu_avatar }}</div>
<div>
<span class="user-label">{{ 'user.logged_in_as'|trans(domain = 'EasyAdminBundle') }}</span>
<span class="user-name">{{ ea.user is null ? 'user.anonymous'|trans(domain = 'EasyAdminBundle') : ea.userMenu.name }}</span>
</div>
</twig:ea:ActionMenu:ActionList:Content>

{% set user_menu %}
{% block user_menu %}
{% if ea.userMenu.items|length > 0 %}
<twig:ea:ActionMenu:ActionList:Divider/>

Expand All @@ -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 %}
<twig:ea:ActionMenu:ActionList>
<twig:ea:ActionMenu:ActionList:Content class="dropdown-user-details">
<div>{{ user_menu_avatar }}</div>
<div>
<span class="user-label">{{ 'user.logged_in_as'|trans(domain = 'EasyAdminBundle') }}</span>
<span class="user-name">{{ ea.user is null ? 'user.anonymous'|trans(domain = 'EasyAdminBundle') : ea.userMenu.name }}</span>
</div>
</twig:ea:ActionMenu:ActionList:Content>

{{ user_menu }}
</twig:ea:ActionMenu:ActionList>
{% endset %}

Expand All @@ -123,9 +127,11 @@

<twig:ea:ActionMenu:Overlay>
<twig:ea:ActionMenu:ActionList>
<twig:ea:ActionMenu:ActionList:Header class="dropdown-locales-label">
{{ 'settings.locale'|trans(domain = 'EasyAdminBundle') }}
</twig:ea:ActionMenu:ActionList:Header>
{% if ea.dashboardLocales %}
<twig:ea:ActionMenu:ActionList:Header class="dropdown-locales-label">
{{ 'settings.locale'|trans(domain = 'EasyAdminBundle') }}
</twig:ea:ActionMenu:ActionList:Header>
{% endif %}

{% for localeDto in ea.dashboardLocales %}
<twig:ea:ActionMenu:ActionList:Item
Expand Down

0 comments on commit c2c5a66

Please sign in to comment.