Skip to content

Commit 00a74ed

Browse files
Add env option to disable part image overlay (Part-DB#960)
* Add env option to disable part image overlay Fixes Part-DB#369 while preserving the state as-is * Added documentation and use 1 instead of true for new env --------- Co-authored-by: Jan Böhmer <[email protected]>
1 parent 699a5c9 commit 00a74ed

File tree

6 files changed

+10
-0
lines changed

6 files changed

+10
-0
lines changed

.docker/symfony.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
PassEnv PROVIDER_REICHELT_ENABLED PROVIDER_REICHELT_CURRENCY PROVIDER_REICHELT_COUNTRY PROVIDER_REICHELT_LANGUAGE PROVIDER_REICHELT_INCLUDE_VAT
4848
PassEnv PROVIDER_POLLIN_ENABLED
4949
PassEnv EDA_KICAD_CATEGORY_DEPTH
50+
PassEnv SHOW_PART_IMAGE_OVERLAY
5051

5152
# For most configuration files from conf-available/, which are
5253
# enabled or disabled at a global level, it is possible to

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,9 @@ FIXER_API_KEY=CHANGEME
305305
# When this is empty the content of config/banner.md is used as banner
306306
BANNER=""
307307

308+
# Enable the part image overlay which shows name and filename of the picture
309+
SHOW_PART_IMAGE_OVERLAY=1
310+
308311
APP_ENV=prod
309312
APP_SECRET=a03498528f5a5fc089273ec9ae5b2849
310313

config/packages/twig.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ twig:
2121
available_themes: '%partdb.available_themes%'
2222
saml_enabled: '%partdb.saml.enabled%'
2323
part_preview_generator: '@App\Services\Attachments\PartPreviewGenerator'
24+
img_overlay: '%partdb.show_part_image_overlay%'
2425

2526
when@test:
2627
twig:

config/parameters.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ parameters:
7474
# Miscellaneous
7575
######################################################################################################################
7676
partdb.demo_mode: '%env(bool:DEMO_MODE)%' # If set to true, all potentially dangerous things are disabled (like changing passwords of the own user)
77+
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
7778

7879
# Set the themes from which the user can choose from in the settings.
7980
# Themes commented here by default, are not really usable, because of display problems. Enable them at your own risk!

docs/configuration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ bundled with Part-DB. Set `DATABASE_MYSQL_SSL_VERIFY_CERT` if you want to accept
9595
particularly for securing and protecting various aspects of your application. It's a secret key that is used for
9696
cryptographic operations and security measures (session management, CSRF protection, etc..). Therefore this
9797
value should be handled as confidential data and not shared publicly.
98+
* `SHOW_PART_IMAGE_OVERLAY`: Set to 0 to disable the part image overlay, which appears if you hover over an image in the
99+
part image gallery
98100

99101
### E-Mail settings
100102

templates/parts/info/_picture.html.twig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<div class="carousel-item {% if loop.first %}active{% endif %}">
1414
<a href="{{ entity_url(pic, 'file_view') }}" data-turbo="false" target="_blank" rel="noopener">
1515
<img class="d-block w-100 img-fluid img-thumbnail bg-light part-info-image" src="{{ entity_url(pic, 'file_view') }}" alt="">
16+
{% if img_overlay %}
1617
<div class="mask"></div>
1718
<div class="carousel-caption-hover">
1819
<div class="carousel-caption text-white">
@@ -21,6 +22,7 @@
2122
<div>{{ entity_type_label(pic.element) }}</div>
2223
</div>
2324
</div>
25+
{% endif %}
2426
</a>
2527
</div>
2628
{% endfor %}

0 commit comments

Comments
 (0)