Defaulting to OFN logo

This commit is contained in:
Will Marshall
2014-07-29 12:55:58 +10:00
parent 118e0f9fd8
commit f1c4ca98a1
6 changed files with 4 additions and 2 deletions

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

View File

@@ -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"

View File

@@ -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

View File

@@ -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])

View File

@@ -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