{% extends 'knp_menu_base.html.twig' %}
{% import _self as self %}
{% macro attributes(attributes, classes) %}
{%- if classes is not empty -%}
{%- if attributes.class is defined and attributes.class is not empty -%}
{%- set classes = classes|merge([attributes.class]) -%}
{%- endif -%}
{%- set attributes = attributes|merge({'class': classes|join(' ')}) -%}
{%- endif -%}
{%- for name, value in attributes -%}
{%- if value is not none and value is not same as(false) -%}
{{- ' %s="%s"'|format(name, value is same as(true) ? name|e : value|e)|raw -}}
{%- endif -%}
{%- endfor -%}
{% endmacro %}
{% block compressed_root %}
{% apply spaceless %}
{{ block('root') }}
{% endapply %}
{% endblock %}
{% block root %}
<div id="kt_aside_menu" class="kt-aside-menu " data-ktmenu-vertical="1" data-ktmenu-scroll="1" data-ktmenu-dropdown-timeout="500">
{{ block('list') -}}
</div>
{% endblock %}
{% block list %}
{%- if item.level == 0 -%}
{%- set classes = ['kt-menu__nav'] -%}
{%- else -%}
{%- set classes = ['kt-menu__subnav', 'kt-menu__subnav--level' ~ item.level] -%}
{%- if item.level == 1 -%}
{%- set classes = classes|merge(['js-side-menu-submenu']) -%}
{%- endif -%}
{%- endif -%}
{% if item.hasChildren and options.depth is not same as(0) and item.displayChildren %}
{% if item.level == 1 %}
<div class="kt-menu__submenu kt-menu__submenu--classic kt-menu__submenu--left">
{% endif %}
{% if item.level == 2 %}
<div class="kt-menu__submenu kt-menu__submenu--classic kt-menu__submenu--right">
{% endif %}
<ul{{ self.attributes(item.childrenAttributes, classes) }}>
{{ block('children') }}
</ul>
{% if item.level == 1 %}
</div>
{% endif %}
{% if item.level == 2 %}
</div>
{% endif %}
{% endif %}
{% endblock %}
{% block children %}
{# save current variables #}
{%- set currentOptions = options -%}
{%- set currentItem = item -%}
{%- set currentSuperadmin = superadmin|default(false) -%}
{# update the depth for children #}
{%- if options.depth is not none -%}
{%- set options = options|merge({'depth': currentOptions.depth - 1}) -%}
{%- endif -%}
{# update the matchingDepth for children #}
{%- if options.matchingDepth is not none and options.matchingDepth > 0 -%}
{%- set options = options|merge({'matchingDepth': currentOptions.matchingDepth - 1}) -%}
{%- endif -%}
{%- for item in currentItem.children -%}
{%- set superadmin = currentSuperadmin or item.extra('superadmin', false) -%}
{{ block('item') }}
{%- endfor -%}
{# restore current variables #}
{%- set item = currentItem -%}
{%- set options = currentOptions -%}
{%- set superadmin = currentSuperadmin -%}
{% endblock %}
{% block item %}
{% if item.displayed %}
{%- if item.getExtra('section') == true -%}
{%- set classes = [] -%}
{%- else -%}
{%- if item.level == 1 -%}
{%- set classes = ['kt-menu__item', 'kt-menu__item--rel'] -%}
{%- else -%}
{%- set classes = ['kt-menu__item'] -%}
{%- endif -%}
{% if item.hasChildren %}
{%- set classes = classes|merge(['kt-menu__item--submenu']) -%}
{% endif %}
{%- endif -%}
{%- if matcher.isCurrent(item) or matcher.isAncestor(item, options.matchingDepth) -%}
{% if item.level == 1 %}
{%- set classes = classes|merge([classes[0] ~ '--here']) -%}
{% else %}
{%- set classes = classes|merge([classes[0] ~ '--active']) -%}
{% endif %}
{%- endif -%}
{%- if superadmin %}
{%- set classes = classes|merge([classes[0] ~ '--superadmin']) -%}
{%- endif -%}
{%- set icon = item.extra('icon')|default(item.level > 2 ? 'arrow-strong' : '') -%}
<li{{ self.attributes(item.attributes, classes) }}
{% if item.hasChildren and item.level == 1 %}
data-ktmenu-submenu-toggle="click" aria-haspopup="true"
{% elseif item.hasChildren %}
data-ktmenu-submenu-toggle="hover" aria-haspopup="true"
{% endif %}
>
{%- if item.getExtra('section') == true -%}
{{ block('sectionElement') }}
{%- elseif item.uri is not empty and (not matcher.isCurrent(item) or options.currentAsLink) -%}
{{ block('linkElement') }}
{%- else -%}
{{ block('spanElement') }}
{%- endif -%}
{{ block('list') }}
</li>
{% endif %}
{% endblock %}
{% block sectionElement %}
<h4 class="kt-menu__section-text">{{ item.label }}</h4>
<i class="kt-menu__section-icon flaticon-more-v2"></i>
{% endblock %}
{% block linkElement %}
{%- set attributes = item.linkAttribute('title') is empty ? item.linkAttributes|merge({'title': item.label}) : item.linkAttributes -%}
{%- set classes = item.level == 1 ? ['kt-menu__link']: ['kt-menu__link'] -%}
{%- set classes = item.hasChildren ? classes|merge(['kt-menu__toggle']) : classes -%}
{%- set uri = item.hasChildren ? 'javascript:;' : item.uri -%}
<a href="{{ uri }}"{{ self.attributes(attributes, classes) }}>
{% if item.level != 1 %}
<i class="kt-menu__link-bullet kt-menu__link-bullet--dot"><span></span></i>
{% endif %}
{{ block('label') }}
{% if item.hasChildren %}
<i class="kt-menu__ver-arrow la la-angle-right"></i>
{% endif %}
</a>
{% endblock %}
{% block spanElement %}
{%- set classes = item.level == 1 ? ['kt-menu__link']: ['kt-menu__link'] -%}
{%- set classes = item.hasChildren ? classes|merge(['kt-menu__toggle']) : classes -%}
{%- set uri = item.hasChildren ? 'javascript:;' : item.uri -%}
<a href="{{ uri }}"{{ self.attributes(item.labelAttributes, classes) }}>
{% if item.level != 1 %}
<i class="kt-menu__link-bullet kt-menu__link-bullet--dot"><span></span></i>
{% endif %}
{{ block('label') }}
{% if item.hasChildren %}
<i class="kt-menu__ver-arrow la la-angle-right"></i>
{% endif %}
</a>
{% endblock %}
{% block label %}
{%- if icon is not null and icon is not empty -%}
<span class="kt-menu__link-icon">
{% include 'Admin/Inline/Icon/svgIcons.html.twig' with {'icon': icon } %}
{#<i class="svg svg-{{ icon }}"></i>#}
</span>
{%- endif -%}
{%- if options.allow_safe_labels and item.getExtra('safe_label', false) -%}
<span class="kt-menu__link-text">{{ item.label|raw }}</span>
{%- else -%}
<span class="kt-menu__link-text">{{ item.label }}</span>
{%- endif -%}
{% endblock %}