From cb1681934062b257f5de641871acb8c7d5a3df7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Thu, 4 Aug 2022 23:13:43 +0200 Subject: [PATCH] Allow to configure which tree panels are shown in the sidebar Adresses issue #158 --- config/packages/twig.yaml | 1 + config/parameters.yaml | 9 +++++++++ templates/_sidebar.html.twig | 8 ++++---- templates/components/tree_macros.html.twig | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index 99cefa0c..5fdd5bec 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -15,6 +15,7 @@ twig: label_profile_dropdown_helper: '@App\Services\LabelSystem\LabelProfileDropdownHelper' error_page_admin_email: '%partdb.error_pages.admin_email%' error_page_show_help: '%partdb.error_pages.show_help%' + sidebar_items: '%partdb.sidebar.items%' when@test: twig: diff --git a/config/parameters.yaml b/config/parameters.yaml index 9ca1a48d..36d56906 100644 --- a/config/parameters.yaml +++ b/config/parameters.yaml @@ -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.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 ###################################################################################################################### diff --git a/templates/_sidebar.html.twig b/templates/_sidebar.html.twig index b95ef13f..99f035d7 100644 --- a/templates/_sidebar.html.twig +++ b/templates/_sidebar.html.twig @@ -2,8 +2,8 @@ \ No newline at end of file diff --git a/templates/components/tree_macros.html.twig b/templates/components/tree_macros.html.twig index 07c93ef9..37e50be3 100644 --- a/templates/components/tree_macros.html.twig +++ b/templates/components/tree_macros.html.twig @@ -4,7 +4,7 @@ ['categories', path('tree_category_root'), 'category.labelp'], ['locations', path('tree_location_root'), 'storelocation.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'], ['devices', path('tree_device_root'), 'device.labelp'], ['tools', path('tree_tools'), 'tools.label'],