diff --git a/.env b/.env index 886de47f..6caa264d 100644 --- a/.env +++ b/.env @@ -111,6 +111,9 @@ TABLE_DEFAULT_PAGE_SIZE=50 # Configure which columns will be visible by default in the parts table (and in which order). # This is a comma separated list of column names. See documentation for available values. TABLE_PARTS_DEFAULT_COLUMNS=name,description,category,footprint,manufacturer,storage_location,amount +# The minimum and maximum size of preview images in tables (in pixels). Valid range: 10-100 +TABLE_IMAGE_PREVIEW_MIN_SIZE=10 +TABLE_IMAGE_PREVIEW_MAX_SIZE=30 ################################################################################## # Info provider settings diff --git a/assets/css/app/images.css b/assets/css/app/images.css index 214776e7..82263b64 100644 --- a/assets/css/app/images.css +++ b/assets/css/app/images.css @@ -18,8 +18,8 @@ */ .hoverpic { - min-width: 10px; - max-width: 30px; + min-width: var(--table-image-preview-min-size, 10px); + max-width: var(--table-image-preview-max-size, 30px); display: block; margin-left: auto; margin-right: auto; @@ -49,7 +49,7 @@ } .part-table-image { - max-height: 40px; + max-height: var(--table-image-preview-max-size, 30px); object-fit: contain; } diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index 044f7d21..560ee50e 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -22,6 +22,8 @@ twig: saml_enabled: '%partdb.saml.enabled%' part_preview_generator: '@App\Services\Attachments\PartPreviewGenerator' img_overlay: '%partdb.show_part_image_overlay%' + table_image_preview_min_size: '%partdb.table.image_preview_min_size%' + table_image_preview_max_size: '%partdb.table.image_preview_max_size%' when@test: twig: diff --git a/config/parameters.yaml b/config/parameters.yaml index 5e647766..febb0922 100644 --- a/config/parameters.yaml +++ b/config/parameters.yaml @@ -58,6 +58,8 @@ parameters: ###################################################################################################################### partdb.table.default_page_size: '%env(int:TABLE_DEFAULT_PAGE_SIZE)%' # The default number of entries shown per page in tables partdb.table.parts.default_columns: '%env(trim:string:TABLE_PARTS_DEFAULT_COLUMNS)%' # The default columns in part tables and their order + partdb.table.image_preview_min_size: '%env(int:TABLE_IMAGE_PREVIEW_MIN_SIZE)%' # The minimum size of preview images in tables (in pixels) + partdb.table.image_preview_max_size: '%env(int:TABLE_IMAGE_PREVIEW_MAX_SIZE)%' # The maximum size of preview images in tables (in pixels) ###################################################################################################################### # Sidebar @@ -134,6 +136,8 @@ parameters: env(ALLOW_EMAIL_PW_RESET): 0 env(TABLE_DEFAULT_PAGE_SIZE): 50 + env(TABLE_IMAGE_PREVIEW_MIN_SIZE): 10 + env(TABLE_IMAGE_PREVIEW_MAX_SIZE): 30 env(TRUSTED_PROXIES): '127.0.0.1' #By default trust only our own server env(TRUSTED_HOSTS): '' # Trust all host names by default diff --git a/templates/base.html.twig b/templates/base.html.twig index e7c641c6..81bd61ec 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -53,6 +53,13 @@ {% endif %} {{ encore_entry_link_tags('app') }} + + {% endblock %} {% block javascripts %}