Allow to configure which tree panels are shown in the sidebar

Adresses issue #158
This commit is contained in:
Jan Böhmer 2022-08-04 23:13:43 +02:00
parent 2486bc5d7b
commit cb16819340
4 changed files with 15 additions and 5 deletions

View file

@ -15,6 +15,7 @@ twig:
label_profile_dropdown_helper: '@App\Services\LabelSystem\LabelProfileDropdownHelper' label_profile_dropdown_helper: '@App\Services\LabelSystem\LabelProfileDropdownHelper'
error_page_admin_email: '%partdb.error_pages.admin_email%' error_page_admin_email: '%partdb.error_pages.admin_email%'
error_page_show_help: '%partdb.error_pages.show_help%' error_page_show_help: '%partdb.error_pages.show_help%'
sidebar_items: '%partdb.sidebar.items%'
when@test: when@test:
twig: twig:

View file

@ -39,6 +39,15 @@ parameters:
partdb.error_pages.admin_email: '' # You can set an email address here, which is shown on an error page, how to contact an administrator partdb.error_pages.admin_email: '' # You can set an email address here, which is shown on an error page, how to contact an administrator
partdb.error_pages.show_help: true # If this is set to true, solutions to common problems are shown on error pages. Disable this, if you do not want your users to see them... partdb.error_pages.show_help: true # If this is set to true, solutions to common problems are shown on error pages. Disable this, if you do not want your users to see them...
######################################################################################################################
# Sidebar
######################################################################################################################
# You can configures the default shown tree items in the sidebar here. You can add or remove entries here, to change the number of trees in the sidebar. The possible entries are: categories, locations, footprints, manufacturers, suppliers, devices, tools
partdb.sidebar.items:
- categories
- devices
- tools
###################################################################################################################### ######################################################################################################################
# Miscellaneous # Miscellaneous
###################################################################################################################### ######################################################################################################################

View file

@ -2,8 +2,8 @@
<div class="nav flex-column"> <div class="nav flex-column">
{% for item in sidebar_items %}
{{ tree.treeview_sidebar('sidebar-panel-1', 'categories') }} {{ tree.treeview_sidebar('sidebar-panel-' ~ loop.index, item) }}
{{ tree.treeview_sidebar('sidebar-panel-2', 'devices') }} <div class="mb-2"></div>
{{ tree.treeview_sidebar('sidebar-panel-3', 'tools') }} {% endfor %}
</div> </div>

View file

@ -4,7 +4,7 @@
['categories', path('tree_category_root'), 'category.labelp'], ['categories', path('tree_category_root'), 'category.labelp'],
['locations', path('tree_location_root'), 'storelocation.labelp'], ['locations', path('tree_location_root'), 'storelocation.labelp'],
['footprints', path('tree_footprint_root'), 'footprint.labelp'], ['footprints', path('tree_footprint_root'), 'footprint.labelp'],
['manufacturer', path('tree_manufacturer_root'), 'manufacturer.labelp'], ['manufacturers', path('tree_manufacturer_root'), 'manufacturer.labelp'],
['suppliers', path('tree_supplier_root'), 'supplier.labelp'], ['suppliers', path('tree_supplier_root'), 'supplier.labelp'],
['devices', path('tree_device_root'), 'device.labelp'], ['devices', path('tree_device_root'), 'device.labelp'],
['tools', path('tree_tools'), 'tools.label'], ['tools', path('tree_tools'), 'tools.label'],