diff --git a/templates/elements/menu.html.twig b/templates/elements/menu.html.twig index 1b308c2..fecb6f2 100644 --- a/templates/elements/menu.html.twig +++ b/templates/elements/menu.html.twig @@ -1,61 +1,42 @@ + {# 1. Get the current route name into a variable for easier use #} + {% set current_route = app.request.attributes.get('_route') %} + {% if is_granted("ROLE_SUPER_ADMIN") %} - - + {# 2. Check if route is 'app_index' #} + + {{ ux_icon('material-symbols:dashboard-outline-rounded', {height: '16px', width: '16px'}) }} Dashboard {% endif %} -{# #} -{# #} -{# #} -{# {{ ux_icon('bi:menu-up', {height: '16px', width: '16px'}) }}#} -{# Menu#} -{# {{ ux_icon('bi:chevron-right', {height: '16px', width: '16px'}) }}#} -{# #} -{# #} -{# #} -{# {{ ux_icon('material-symbols-light:play-arrow-outline', {height: '16px', width: '16px'}) }}#} -{# Accordions#} -{# {{ ux_icon('material-symbols-light:play-arrow-outline', {height: '16px', width: '16px'}) }}#} -{# Buttons#} -{# {{ ux_icon('material-symbols-light:play-arrow-outline', {height: '16px', width: '16px'}) }}#} -{# Badges#} -{# {{ ux_icon('material-symbols-light:play-arrow-outline', {height: '16px', width: '16px'}) }}#} -{# Breadcrumbs#} -{# {{ ux_icon('material-symbols-light:play-arrow-outline', {height: '16px', width: '16px'}) }}#} -{# Dropdowns#} -{# #} -{# #} -{# #} - + + {# 3. Check if route starts with 'application_' (covers index, edit, show, etc.) #} + {{ ux_icon('material-symbols:settings-applications-outline', {height: '15px', width: '15px'}) }} Applications - {# if user is Super Admin #} + {% if is_granted('ROLE_SUPER_ADMIN') %} - + {{ ux_icon('fa6-regular:circle-user', {height: '15px', width: '15px'}) }} Users {% endif %} - + + {% if is_granted('ROLE_ADMIN') %} - {{ ux_icon('bi:buildings', {height: '15px', width: '15px'}) }} - - - Organizations + {{ ux_icon('bi:buildings', {height: '15px', width: '15px'}) }} + Organizations {% endif %} - \ No newline at end of file