{% macro sidebar_dropdown() %} {% set currentLocale = app.request.locale %} {# 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'), 'category'], ['locations', path('tree_location_root'), 'storelocation.labelp', is_granted('@storelocations.read') and is_granted('@parts.read'), 'storagelocation'], ['footprints', path('tree_footprint_root'), 'footprint.labelp', is_granted('@footprints.read') and is_granted('@parts.read'), 'footprint'], ['manufacturers', path('tree_manufacturer_root'), 'manufacturer.labelp', is_granted('@manufacturers.read') and is_granted('@parts.read'), 'manufacturer'], ['suppliers', path('tree_supplier_root'), 'supplier.labelp', is_granted('@suppliers.read') and is_granted('@parts.read'), 'supplier'], ['projects', path('tree_device_root'), 'project.labelp', is_granted('@projects.read'), 'project'], ['tools', path('tree_tools'), 'tools.label', true, 'tool'], ] %}
  • {% for source in data_sources %} {% if source[3] %} {# show_condition #}
  • {% endif %} {% endfor %} {% endmacro %} {% macro treeview_sidebar(id, default_mode) %}
    {% endmacro %} {% macro treeview(entity) %}
    {% endmacro %}