mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Tweaking product image logic
This commit is contained in:
@@ -44,4 +44,5 @@ Darkswarm.factory 'Products', ($resource, Enterprises, Dereferencer, Taxons, Car
|
||||
product.price = Math.min.apply(null, prices)
|
||||
product.hasVariants = product.variants?.length > 0
|
||||
|
||||
product.primaryImage = product.images[0]?.small_url || "/assets/noimage/small.png"
|
||||
product.primaryImage = product.images[0]?.small_url
|
||||
product.primaryImageOrMissing = product.primaryImage || "/assets/noimage/small.png"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.row
|
||||
.columns.small-12.large-6
|
||||
%img.product-img{"ng-src" => "{{product.images[0].large_url}}", "ng-if" => "product.images[0]"}
|
||||
%img.product-img{"ng-src" => "{{product.primaryImage}}", "ng-if" => "product.primaryImage"}
|
||||
.columns.small-12.large-6.product-header
|
||||
%h2
|
||||
%render-svg{path: "{{product.primary_taxon.icon}}"}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.product-thumb
|
||||
%a{"ng-click" => "triggerProductModal()"}
|
||||
%img{"bo-src" => "product.primaryImage", "ng-click" => "triggerProductModal()"}
|
||||
%img{"bo-src" => "product.primaryImageOrMissing", "ng-click" => "triggerProductModal()"}
|
||||
|
||||
.row.summary
|
||||
.small-9.medium-10.large-11.columns.summary-header
|
||||
|
||||
Reference in New Issue
Block a user