{% macro sidebar_dropdown() %} {# Format is [mode, route, label, show_condition] #} {% set data_sources = [ ['categories', path('tree_category_root'), 'category.labelp', is_granted('@categories.read') and is_granted('@parts.read')], ['locations', path('tree_location_root'), 'storelocation.labelp', is_granted('@storelocations.read') and is_granted('@parts.read')], ['footprints', path('tree_footprint_root'), 'footprint.labelp', is_granted('@footprints.read') and is_granted('@parts.read')], ['manufacturers', path('tree_manufacturer_root'), 'manufacturer.labelp', is_granted('@manufacturers.read') and is_granted('@parts.read')], ['suppliers', path('tree_supplier_root'), 'supplier.labelp', is_granted('@suppliers.read') and is_granted('@parts.read')], ['devices', path('tree_device_root'), 'project.labelp', is_granted('@projects.read')], ['tools', path('tree_tools'), 'tools.label', true], ] %}
  • {% for source in data_sources %} {% if source[3] %} {# show_condition #}
  • {% endif %} {% endfor %} {% endmacro %} {% macro treeview_sidebar(id, default_mode) %}
    {% endmacro %} {% macro treeview(entity) %}
    {% endmacro %}