diff --git a/migrations/0099.sql b/migrations/0099.sql new file mode 100644 index 00000000..d9a923c2 --- /dev/null +++ b/migrations/0099.sql @@ -0,0 +1,2 @@ +ALTER TABLE products +ADD picture_url TEXT; \ No newline at end of file diff --git a/public/viewjs/components/productcard.js b/public/viewjs/components/productcard.js index 76117d83..3fd4ff44 100644 --- a/public/viewjs/components/productcard.js +++ b/public/viewjs/components/productcard.js @@ -92,6 +92,11 @@ Grocy.Components.ProductCard.Refresh = function(productId) $("#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 if (productDetails.product.picture_url !== null && !productDetails.product.picture_url.isEmpty()) + { + $("#productcard-product-picture").removeClass("d-none"); + $("#productcard-product-picture").attr("src", productDetails.product.picture_url); + } else { $("#productcard-product-picture").addClass("d-none"); diff --git a/public/viewjs/mealplan.js b/public/viewjs/mealplan.js index b1dedbc7..25daeaba 100644 --- a/public/viewjs/mealplan.js +++ b/public/viewjs/mealplan.js @@ -226,9 +226,19 @@ var calendar = $("#calendar").fullCalendar({ \ '); + var pictureUrl = null; if (productDetails.product.picture_file_name && !productDetails.product.picture_file_name.isEmpty()) { - element.html(element.html() + '