@@ -34,7 +34,7 @@ Darkswarm.factory 'Products', (OrderCycleResource, OrderCycle, Shopfront, curren
|
||||
product.price = Math.min.apply(null, prices)
|
||||
product.hasVariants = product.variants?.length > 0
|
||||
product.primaryImage = product.images[0]?.small_url if product.images
|
||||
product.primaryImageOrMissing = product.primaryImage || "/assets/noimage/small.png"
|
||||
product.primaryImageOrMissing = product.primaryImage || "/noimage/small.png"
|
||||
product.largeImage = product.images[0]?.large_url if product.images
|
||||
|
||||
dereference: ->
|
||||
|
||||
@@ -15,6 +15,6 @@
|
||||
|
||||
.columns.small-12.medium-6.large-6.product-img
|
||||
%img{"ng-src" => "{{::product.largeImage}}", "ng-if" => "::product.largeImage"}
|
||||
%img.placeholder{ src: "/assets/noimage/large.png", "ng-if" => "::!product.largeImage"}
|
||||
%img.placeholder{ src: "/noimage/large.png", "ng-if" => "::!product.largeImage"}
|
||||
|
||||
%ng-include{src: "'partials/close.html'"}
|
||||
|
||||
@@ -12,7 +12,7 @@ class Api::Admin::ProductSerializer < ActiveModel::Serializer
|
||||
if object.images.present?
|
||||
object.images.first.attachment.url(:product)
|
||||
else
|
||||
"/assets/noimage/product.png"
|
||||
"/noimage/product.png"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -20,7 +20,7 @@ class Api::Admin::ProductSerializer < ActiveModel::Serializer
|
||||
if object.images.present?
|
||||
object.images.first.attachment.url(:mini)
|
||||
else
|
||||
"/assets/noimage/mini.png"
|
||||
"/noimage/mini.png"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class Api::VariantSerializer < ActiveModel::Serializer
|
||||
if object.product.images.present?
|
||||
object.product.images.first.attachment.url(:mini)
|
||||
else
|
||||
"/assets/noimage/mini.png"
|
||||
"/noimage/mini.png"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
- if @group.logo.present?
|
||||
%img.group-logo{"src" => @group.logo}
|
||||
- else
|
||||
%img.group-logo{"src" => image_path('noimage/group.png') }
|
||||
%img.group-logo{"src" => '/noimage/group.png' }
|
||||
%h2.group-name= @group.name
|
||||
%p= @group.description
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
%fieldset.no-border-bottom{ id: "image" }
|
||||
%legend{align: "center"}= t(".image")
|
||||
.row
|
||||
= image_tag "noimage/product.png", class: "four columns alpha"
|
||||
= image_tag "/noimage/product.png", class: "four columns alpha"
|
||||
.row
|
||||
= f.fields_for 'images_attributes[]', f.object.images.build do |image_fields|
|
||||
= image_fields.file_field :attachment
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{{#if variant.image }}
|
||||
<img src='{{variant.image}}' />
|
||||
{{ else }}
|
||||
<img src='<%= image_path("noimage/mini.png") %>' />
|
||||
<img src='/noimage/mini.png' />
|
||||
{{/if}}
|
||||
</figure>
|
||||
|
||||
|
||||
@@ -16,10 +16,7 @@
|
||||
%td.cart-item-description
|
||||
|
||||
%div.item-thumb-image
|
||||
- if variant.images.length == 0
|
||||
= mini_image(variant.product)
|
||||
- else
|
||||
= image_tag(variant.images.first.attachment.url(:mini))
|
||||
= render 'spree/shared/variant_thumbnail', variant: variant
|
||||
|
||||
= render 'spree/shared/line_item_name', line_item: line_item
|
||||
%span.already-confirmed= t(:orders_bought_already_confirmed)
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
%td.cart-item-description{'data-hook' => "cart_item_description"}
|
||||
|
||||
%div.item-thumb-image{"data-hook" => "cart_item_image"}
|
||||
- if variant.images.length == 0
|
||||
= mini_image(variant.product)
|
||||
- else
|
||||
= image_tag(variant.images.first.attachment.url(:mini))
|
||||
= render 'spree/shared/variant_thumbnail', variant: variant
|
||||
|
||||
= render 'spree/shared/line_item_name', line_item: line_item
|
||||
|
||||
|
||||
@@ -16,11 +16,7 @@
|
||||
%td(data-hook = "order_item_description")
|
||||
|
||||
%div.item-thumb-image{"data-hook" => "order_item_image"}
|
||||
- if item.variant.images.length == 0
|
||||
= mini_image(item.variant.product)
|
||||
- else
|
||||
= image_tag(item.variant.images.first.attachment.url(:mini))
|
||||
|
||||
= render 'spree/shared/variant_thumbnail', variant: item.variant
|
||||
|
||||
= render 'spree/shared/line_item_name', line_item: item
|
||||
|
||||
|
||||
4
app/views/spree/shared/_variant_thumbnail.html.haml
Normal file
@@ -0,0 +1,4 @@
|
||||
- if variant.product.images.length == 0
|
||||
= image_tag("/noimage/mini.png")
|
||||
- else
|
||||
= image_tag(variant.product.images.first.attachment.url(:mini))
|
||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 957 B After Width: | Height: | Size: 957 B |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
@@ -770,7 +770,7 @@ feature '
|
||||
expect(page).to have_selector "td.image"
|
||||
|
||||
# Shows default image when no image set
|
||||
expect(page).to have_css "img[src='/assets/noimage/mini.png']"
|
||||
expect(page).to have_css "img[src='/noimage/mini.png']"
|
||||
@old_thumb_src = page.find("a.image-modal img")['src']
|
||||
|
||||
# Click image
|
||||
|
||||
@@ -107,7 +107,7 @@ describe 'Products service', ->
|
||||
$httpBackend.expectGET(endpoint).respond([product])
|
||||
$httpBackend.flush()
|
||||
expect(Products.products[0].primaryImage).toBeUndefined()
|
||||
expect(Products.products[0].primaryImageOrMissing).toEqual "/assets/noimage/small.png"
|
||||
expect(Products.products[0].primaryImageOrMissing).toEqual "/noimage/small.png"
|
||||
|
||||
it "sets largeImage", ->
|
||||
$httpBackend.expectGET(endpoint).respond([productWithImage])
|
||||
|
||||