From 8b06c351dfa0a87b124487a3ef2438414138ecff Mon Sep 17 00:00:00 2001 From: Remskei Date: Tue, 5 Oct 2021 13:30:14 +0200 Subject: [PATCH] fix badges container in menu (#167) Co-authored-by: Remy Keignart Co-authored-by: Kevin Papst --- Resources/views/Macros/menu.html.twig | 4 ++++ Resources/views/Partials/_menu.html.twig | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Resources/views/Macros/menu.html.twig b/Resources/views/Macros/menu.html.twig index 4860b92..0177169 100644 --- a/Resources/views/Macros/menu.html.twig +++ b/Resources/views/Macros/menu.html.twig @@ -5,7 +5,9 @@ {% if item.icon %} {% endif %} {% if item.badge is not same as(false) %} + {{ item.badge }} + {% endif %} {% if item.hasChildren %}{% endif %} {{ item.label|trans }} @@ -38,6 +40,8 @@ {{ item.label|trans }} {% if item.badge is not same as(false) %} + {{ item.badge }} + {% endif %} {% endmacro %} diff --git a/Resources/views/Partials/_menu.html.twig b/Resources/views/Partials/_menu.html.twig index 58ec0d3..7c677b4 100644 --- a/Resources/views/Partials/_menu.html.twig +++ b/Resources/views/Partials/_menu.html.twig @@ -21,11 +21,15 @@ {% macro badges(item) %} {% import _self as selfMacros %} {% if item.getExtra('badge') is not null %} - {{ selfMacros.badge(item.getExtra('badge')) }} + + {{ selfMacros.badge(item.getExtra('badge')) }} + {% elseif item.getExtra('badges') is not null %} - {% for badge in item.getExtra('badges') %} - {{ selfMacros.badge(badge) }} - {% endfor %} + + {% for badge in item.getExtra('badges') %} + {{ selfMacros.badge(badge) }} + {% endfor %} + {% endif %} {% endmacro %}