Add env option to disable part image overlay

Fixes #369 while preserving the state as-is
This commit is contained in:
d-buchmann 2025-07-02 15:30:52 +02:00
parent c44535990b
commit 95ef9c6dae
4 changed files with 7 additions and 0 deletions

3
.env
View file

@ -305,6 +305,9 @@ FIXER_API_KEY=CHANGEME
# When this is empty the content of config/banner.md is used as banner
BANNER=""
# Enable the part image overlay which shows name and filename of the picture
SHOW_PART_IMAGE_OVERLAY=true
APP_ENV=prod
APP_SECRET=a03498528f5a5fc089273ec9ae5b2849

View file

@ -21,6 +21,7 @@ twig:
available_themes: '%partdb.available_themes%'
saml_enabled: '%partdb.saml.enabled%'
part_preview_generator: '@App\Services\Attachments\PartPreviewGenerator'
img_overlay: '%partdb.show_part_image_overlay%'
when@test:
twig:

View file

@ -74,6 +74,7 @@ parameters:
# Miscellaneous
######################################################################################################################
partdb.demo_mode: '%env(bool:DEMO_MODE)%' # If set to true, all potentially dangerous things are disabled (like changing passwords of the own user)
partdb.show_part_image_overlay: '%env(bool:SHOW_PART_IMAGE_OVERLAY)%' # If set to false, the filename overlay of the part image will be disabled
# Set the themes from which the user can choose from in the settings.
# Themes commented here by default, are not really usable, because of display problems. Enable them at your own risk!

View file

@ -13,6 +13,7 @@
<div class="carousel-item {% if loop.first %}active{% endif %}">
<a href="{{ entity_url(pic, 'file_view') }}" data-turbo="false" target="_blank" rel="noopener">
<img class="d-block w-100 img-fluid img-thumbnail bg-light part-info-image" src="{{ entity_url(pic, 'file_view') }}" alt="">
{% if img_overlay %}
<div class="mask"></div>
<div class="carousel-caption-hover">
<div class="carousel-caption text-white">
@ -21,6 +22,7 @@
<div>{{ entity_type_label(pic.element) }}</div>
</div>
</div>
{% endif %}
</a>
</div>
{% endfor %}