mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Improved product picture display on the productcard
This commit is contained in:
@@ -80,13 +80,11 @@ Grocy.Components.ProductCard.Refresh = function(productId)
|
||||
|
||||
if (productDetails.product.picture_file_name !== null && !productDetails.product.picture_file_name.isEmpty())
|
||||
{
|
||||
$("#productcard-no-product-picture").addClass("d-none");
|
||||
$("#productcard-product-picture").removeClass("d-none");
|
||||
$("#productcard-product-picture").attr("src", U('/api/files/productpictures/' + btoa(productDetails.product.picture_file_name) + '?force_serve_as=picture&best_fit_width=400'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#productcard-no-product-picture").removeClass("d-none");
|
||||
$("#productcard-product-picture").addClass("d-none");
|
||||
}
|
||||
|
||||
|
@@ -27,9 +27,7 @@
|
||||
@if (GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING)<strong>{{ $__t('Average shelf life') }}:</strong> <span id="productcard-product-average-shelf-life"></span><br>@endif
|
||||
<strong>{{ $__t('Spoil rate') }}:</strong> <span id="productcard-product-spoil-rate"></span>
|
||||
|
||||
<h5 class="mt-3">{{ $__t('Product picture') }}</h5>
|
||||
<p class="w-75 mx-auto"><img id="productcard-product-picture" data-src="" class="img-fluid img-thumbnail d-none lazy"></p>
|
||||
<span id="productcard-no-product-picture" class="font-italic d-none">{{ $__t('No picture available') }}</span>
|
||||
<p class="w-75 mt-3 mx-auto"><img id="productcard-product-picture" data-src="" class="img-fluid img-thumbnail d-none lazy"></p>
|
||||
|
||||
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
|
||||
<h5 class="mt-3">{{ $__t('Price history') }}</h5>
|
||||
|
Reference in New Issue
Block a user