{# -*- coding: utf-8 -*- This file is part of Invenio. Copyright (C) 2015-2018 CERN. Invenio is free software; you can redistribute it and/or modify it under the terms of the MIT License; see LICENSE file for more details. #} {% macro menu_icon(item) -%} {% set icon_type = item.get_icon_type() %} {%- if icon_type %} {% set icon_value = item.get_icon_value() %} {% if icon_type == 'glyph' %} {% elif icon_type == 'fa' %} {% elif icon_type == 'image' %} menu image {% elif icon_type == 'image-url' %} menu image {% endif %} {% endif %} {%- endmacro %} {% macro menu_overwrite() %} {%- for item in admin_view.admin.menu()|sort(attribute='name') %} {%- if item.is_category() -%} {% set children = item.get_children() %} {%- if children %} {% set class_name = item.get_class_name() %} {%- if item.is_active(admin_view) %}
  • {% else -%}
  • {%- endif %} {% if item.class_name %} {% endif %} {{ item.name }}
  • {% endif %} {%- else %} {%- if item.is_accessible() and item.is_visible() -%} {% set class_name = item.get_class_name() %} {%- if item.is_active(admin_view) %}
  • {%- else %}
  • {%- endif %} {{ menu_icon(item) }}{{ item.name }}
  • {%- endif -%} {% endif -%} {% endfor %} {% endmacro %}