mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-03 02:21:33 +00:00
Defaulting to OFN logo
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 25 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 25 KiB |
@@ -43,3 +43,5 @@ Darkswarm.factory 'Products', ($resource, Enterprises, Dereferencer, Taxons, Car
|
||||
prices = (v.price for v in product.variants)
|
||||
product.price = Math.min.apply(null, prices)
|
||||
product.hasVariants = product.variants?.length > 0
|
||||
|
||||
product.primaryImage = product.images[0]?.small_url || "/assets/noimage/small.png"
|
||||
|
||||
@@ -34,6 +34,7 @@ class Api::CachedProductSerializer < ActiveModel::Serializer
|
||||
has_many :variants, serializer: Api::VariantSerializer
|
||||
has_many :taxons, serializer: Api::IdSerializer
|
||||
has_many :properties, serializer: Api::PropertySerializer
|
||||
has_many :images, serializer: Api::ImageSerializer
|
||||
|
||||
has_one :supplier, serializer: Api::IdSerializer
|
||||
has_one :primary_taxon, serializer: Api::TaxonSerializer
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
class Api::VariantSerializer < ActiveModel::Serializer
|
||||
attributes :id, :is_master, :count_on_hand, :name_to_display, :unit_to_display,
|
||||
:on_demand, :price
|
||||
has_many :images, serializer: Api::ImageSerializer
|
||||
|
||||
def price
|
||||
object.price_with_fees(options[:current_distributor], options[:current_order_cycle])
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.product-thumb
|
||||
%a{"ng-click" => "triggerProductModal()"}
|
||||
%img{"bo-src" => "product.master.images[0].small_url", "ng-click" => "triggerProductModal()"}
|
||||
%img{"bo-src" => "product.primaryImage", "ng-click" => "triggerProductModal()"}
|
||||
|
||||
.row.summary
|
||||
.small-9.medium-10.large-11.columns.summary-header
|
||||
|
||||
Reference in New Issue
Block a user