{% macro sidebar_dropdown() %} {% set currentLocale = app.request.locale %} {# Format is [mode, route, label, show_condition] #} {% set data_sources = [ ['categories', path('tree_category_root'), '@category@@', is_granted('@categories.read') and is_granted('@parts.read')], ['locations', path('tree_location_root'), '@storage_location@@', is_granted('@storelocations.read') and is_granted('@parts.read'), ], ['footprints', path('tree_footprint_root'), '@footprint@@', is_granted('@footprints.read') and is_granted('@parts.read')], ['manufacturers', path('tree_manufacturer_root'), '@manufacturer@@', is_granted('@manufacturers.read') and is_granted('@parts.read'), 'manufacturer'], ['suppliers', path('tree_supplier_root'), '@supplier@@', is_granted('@suppliers.read') and is_granted('@parts.read'), 'supplier'], ['projects', path('tree_device_root'), '@project@@', is_granted('@projects.read'), 'project'], ['tools', path('tree_tools'), 'tools.label', true, 'tool'], ] %}
  • {% for source in data_sources %} {% if source[3] %} {# show_condition #}
  • {% if source[2] starts with '@' %} {% set label = type_label_p(source[2]|replace({'@': ''})) %} {% else %} {% set label = source[2]|trans %} {% endif %}
  • {% endif %} {% endfor %} {% endmacro %} {% macro treeview_sidebar(id, default_mode) %}
    {% endmacro %} {% macro treeview(entity) %}
    {% endmacro %}