templates/Admin/Inline/Menu/profileMenu.html.twig line 1

Open in your IDE?
  1. {% extends 'knp_menu_base.html.twig' %}
  2. {% import _self as self %}
  3. {% macro attributes(attributes, classes) %}
  4.     {%- if classes is not empty -%}
  5.         {%- if attributes.class is defined and attributes.class is not empty -%}
  6.             {%- set classes = classes|merge([attributes.class]) -%}
  7.         {%- endif -%}
  8.         {%- set attributes = attributes|merge({'class': classes|join(' ')}) -%}
  9.     {%- endif -%}
  10.     {%- for name, value in attributes -%}
  11.         {%- if value is not none and value is not same as(false) -%}
  12.             {{- ' %s="%s"'|format(name, value is same as(true) ? name|e : value|e)|raw -}}
  13.         {%- endif -%}
  14.     {%- endfor -%}
  15. {% endmacro %}
  16. {% block compressed_root %}
  17.     {% apply spaceless %}
  18.         {{ block('root') }}
  19.     {% endapply %}
  20. {% endblock %}
  21. {% block root %}
  22.     {#<div class="kt-notification">#}
  23.         {{ block('list') -}}
  24.     {#</div>#}
  25. {% endblock %}
  26. {% block list %}
  27.     {% if item.hasChildren and options.depth is not same as(0) and item.displayChildren %}
  28.         {{ block('children') }}
  29.     {% endif %}
  30. {% endblock %}
  31. {% block children %}
  32.     {# save current variables #}
  33.     {%- set currentOptions = options -%}
  34.     {%- set currentItem = item -%}
  35.     {%- set currentSuperadmin = superadmin|default(false) -%}
  36.     {# update the depth for children #}
  37.     {%- if options.depth is not none -%}
  38.         {%- set options = options|merge({'depth': currentOptions.depth - 1}) -%}
  39.     {%- endif -%}
  40.     {# update the matchingDepth for children #}
  41.     {%- if options.matchingDepth is not none and options.matchingDepth > 0 -%}
  42.         {%- set options = options|merge({'matchingDepth': currentOptions.matchingDepth - 1}) -%}
  43.     {%- endif -%}
  44.     {%- for item in currentItem.children -%}
  45.         {%- set superadmin = currentSuperadmin or item.extra('superadmin', false) -%}
  46.         {{ block('item') }}
  47.     {%- endfor -%}
  48.     {# restore current variables #}
  49.     {%- set item = currentItem -%}
  50.     {%- set options = currentOptions -%}
  51.     {%- set superadmin = currentSuperadmin -%}
  52. {% endblock %}
  53. {% block item %}
  54.     {% if item.displayed %}
  55.         {{ block('linkElement') }}
  56.     {%- endif -%}
  57. {% endblock %}
  58. {% block linkElement %}
  59.     {%- set uri = item.hasChildren ? 'javascript:;' : item.uri -%}
  60.     <a href="{{ uri }}" class="kt-notification__item">
  61.         {{ block('label') }}
  62.     </a>
  63. {% endblock %}
  64. {% block label %}
  65.     {%- set icon = item.extra('icon')|default('') -%}
  66.     {%- set description = item.extra('description')|default('') -%}
  67.     {%- if icon is not null and icon is not empty -%}
  68.         <div class="kt-notification__item-icon">
  69.             {% include 'Admin/Inline/Icon/svgIcons.html.twig' with {'icon': icon } %}
  70.             {#<i class="{{ icon }}"></i>#}
  71.         </div>
  72.     {%- endif -%}
  73.     <div class="kt-notification__item-details">
  74.         <div class="kt-notification__item-title kt-font-bolder">
  75.             {%- if options.allow_safe_labels and item.getExtra('safe_label', false) -%}
  76.                 {{ item.label|raw }}
  77.             {%- else -%}
  78.                 {{ item.label }}
  79.             {%- endif -%}
  80.         </div>
  81.         {%- if icon is not null and icon is not empty -%}
  82.             <div class="kt-notification__item-time">
  83.                 {{ description }}
  84.             </div>
  85.         {%- endif -%}
  86.     </div>
  87. {% endblock %}