templates/bundles/EasyAdminBundle/menu.html.twig line 1
{# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #}
<nav id="main-menu">
{% block main_menu_before %}{% endblock %}
<ul class="menu">
{% block main_menu %}
{% for menuItem in ea.mainMenu.items %}
{% block menu_item %}
<li class="{{ menuItem.isMenuSection ? 'menu-header' : 'menu-item' }} {{ menuItem.hasSubItems ? 'has-submenu' }} {{ menuItem.isSelected ? 'active' }} {{ menuItem.isExpanded ? 'expanded' }}">
{{ _self.render_menu_item(menuItem) }}
{% if menuItem.hasSubItems %}
<ul class="submenu">
{% for menuSubItem in menuItem.subItems %}
{% block menu_subitem %}
<li class="{{ menuSubItem.isMenuSection ? 'menu-header' : 'menu-item' }} {{ menuSubItem.isSelected ? 'active' }}">
{{ _self.render_menu_item(menuSubItem) }}
</li>
{% endblock menu_subitem %}
{% endfor %}
</ul>
{% endif %}
</li>
{% endblock menu_item %}
{% endfor %}
{% endblock main_menu %}
</ul>
{% block main_menu_after %}{% endblock %}
</nav>
{% macro render_menu_item(item) %}
{% if item.isMenuSection %}
<span class="menu-header-contents">
{% if item.icon is not empty %}<img src="{{asset(item.icon)}}" style="width:28px;margin-right:5px;" />{% endif %}
<span class="menu-item-label position-relative {{ item.cssClass }}">
{{ item.label|trans|raw }}
</span>
{% if item.badge %}
<span class="menu-item-badge rounded-pill badge {{ item.badge.cssClass }}" style="{{ item.badge.htmlStyle }}">{{ item.badge.content }}</span>
{% endif %}
</span>
{% else %}
<a href="{{ item.linkUrl }}" class="menu-item-contents {{ item.hasSubItems ? 'submenu-toggle' }} {{ item.cssClass }}" rel="{{ item.linkRel }}" referrerpolicy="origin-when-cross-origin">
{% if item.icon is not empty %}<i class="menu-icon fa-fw {{ item.icon }}"></i>{% endif %}
<span class="menu-item-label position-relative">
{{ item.label|trans|raw }}
</span>
{% if item.hasSubItems %}<i class="fa fa-fw fa-angle-right submenu-toggle-icon"></i>{% endif %}
{% if item.badge %}
<span class="menu-item-badge rounded-pill badge {{ item.badge.cssClass }}" style="{{ item.badge.htmlStyle }}">{{ item.badge.content }}</span>
{% endif %}
</a>
{% endif %}
{% endmacro %}