mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 04:12:59 +00:00
Automatically downscale pictures to reduce page loading times (closes #275)
This commit is contained in:
@@ -275,7 +275,7 @@
|
||||
<label class="mt-2">{{ $__t('Picture') }}</label>
|
||||
<button id="delete-current-product-picture-button" class="btn btn-sm btn-danger @if(empty($product->picture_file_name)) disabled @endif"><i class="fas fa-trash"></i> {{ $__t('Delete') }}</button>
|
||||
@if(!empty($product->picture_file_name))
|
||||
<p><img id="current-product-picture" src="{{ $U('/api/files/productpictures/' . base64_encode($product->picture_file_name)) }}" class="img-fluid img-thumbnail mt-2"></p>
|
||||
<p><img id="current-product-picture" src="{{ $U('/api/files/productpictures/' . base64_encode($product->picture_file_name) . '?force_serve_as=picture&best_fit_height=400&best_fit_width=400') }}" class="img-fluid img-thumbnail mt-2"></p>
|
||||
<p id="delete-current-product-picture-on-save-hint" class="form-text text-muted font-italic d-none">{{ $__t('The current picture will be deleted when you save the product') }}</p>
|
||||
@else
|
||||
<p id="no-current-product-picture-hint" class="form-text text-muted font-italic">{{ $__t('No picture available') }}</p>
|
||||
|
@@ -209,7 +209,7 @@
|
||||
<label class="mt-2">{{ $__t('Picture') }}</label>
|
||||
<button id="delete-current-recipe-picture-button" class="btn btn-sm btn-danger @if(empty($recipe->picture_file_name)) disabled @endif"><i class="fas fa-trash"></i> {{ $__t('Delete') }}</button>
|
||||
@if(!empty($recipe->picture_file_name))
|
||||
<p><img id="current-recipe-picture" src="{{ $U('/api/files/recipepictures/' . base64_encode($recipe->picture_file_name)) }}" class="img-fluid img-thumbnail mt-2"></p>
|
||||
<p><img id="current-recipe-picture" src="{{ $U('/api/files/recipepictures/' . base64_encode($recipe->picture_file_name) . '?force_serve_as=picture&best_fit_height=400&best_fit_width=400') }}" class="img-fluid img-thumbnail mt-2"></p>
|
||||
<p id="delete-current-recipe-picture-on-save-hint" class="form-text text-muted font-italic d-none">{{ $__t('The current picture will be deleted when you save the recipe') }}</p>
|
||||
@else
|
||||
<p id="no-current-recipe-picture-hint" class="form-text text-muted font-italic">{{ $__t('No picture available') }}</p>
|
||||
|
@@ -102,7 +102,7 @@
|
||||
<a class="discrete-link recipe-gallery-item" data-recipe-id="{{ $recipe->id }}" href="#">
|
||||
<div id="recipe-card-{{ $recipe->id }}" class="card border-white mb-0 recipe-card">
|
||||
@if(!empty($recipe->picture_file_name))
|
||||
<img src="{{ $U('/api/files/recipepictures/' . base64_encode($recipe->picture_file_name)) }}" class="img-fluid">
|
||||
<img src="{{ $U('/api/files/recipepictures/' . base64_encode($recipe->picture_file_name) . '?force_serve_as=picture&best_fit_height=400&best_fit_width=400') }}" class="img-fluid">
|
||||
@endif
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title mb-1">{{ $recipe->name }}</h5>
|
||||
@@ -173,7 +173,7 @@
|
||||
</div>
|
||||
|
||||
@if(!empty($selectedRecipeSubRecipe->picture_file_name))
|
||||
<p class="w-75 mx-auto"><img src="{{ $U('/api/files/recipepictures/' . base64_encode($selectedRecipeSubRecipe->picture_file_name)) }}" class="img-fluid img-thumbnail"></p>
|
||||
<p class="w-75 mx-auto txt-center"><img src="{{ $U('/api/files/recipepictures/' . base64_encode($selectedRecipeSubRecipe->picture_file_name) . '?force_serve_as=picture&best_fit_height=400&best_fit_width=400') }}" class="img-fluid img-thumbnail"></p>
|
||||
@endif
|
||||
|
||||
@php $selectedRecipeSubRecipePositionsFiltered = FindAllObjectsInArrayByPropertyValue($selectedRecipeSubRecipesPositions, 'child_recipe_id', $selectedRecipeSubRecipe->id); @endphp
|
||||
@@ -225,7 +225,7 @@
|
||||
|
||||
<!-- Selected recipe -->
|
||||
@if(!empty($selectedRecipe->picture_file_name))
|
||||
<p class="w-75 mx-auto"><img src="{{ $U('/api/files/recipepictures/' . base64_encode($selectedRecipe->picture_file_name)) }}" class="img-fluid img-thumbnail"></p>
|
||||
<p class="w-75 mx-auto text-center"><img src="{{ $U('/api/files/recipepictures/' . base64_encode($selectedRecipe->picture_file_name) . '?force_serve_as=picture&best_fit_height=400&best_fit_width=400') }}" class="img-fluid img-thumbnail"></p>
|
||||
@endif
|
||||
|
||||
@if($selectedRecipePositionsResolved->count() > 0)
|
||||
|
Reference in New Issue
Block a user