Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions assets/css/app/images.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -49,7 +49,7 @@
}

.part-table-image {
max-height: 40px;
max-height: var(--table-image-preview-max-size, 30px);
object-fit: contain;
}

Expand Down
2 changes: 2 additions & 0 deletions config/packages/twig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions config/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions templates/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@
{% endif %}

{{ encore_entry_link_tags('app') }}

<style>
:root {
--table-image-preview-min-size: {{ table_image_preview_min_size }}px;
--table-image-preview-max-size: {{ table_image_preview_max_size }}px;
}
</style>
{% endblock %}

{% block javascripts %}
Expand Down
Loading