Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue with duplicate thumbnails on ProductController#show
Fixes #2361
- Loading branch information
1 parent
f042ee0
commit 32edfed
Showing
2 changed files
with
18 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
<!-- no need for thumnails unless there is more then one image --> | ||
<% if product.images.size > 1 || product.variant_images.size > 0 %> | ||
<%# no need for thumbnails unless there is more then one image %> | ||
<% if (@product.images + @product.variant_images).uniq.size > 1 %> | ||
<ul id="product-thumbnails" class="thumbnails inline" data-hook> | ||
<% product.images.each do |i| %> | ||
<li class="tmb-all" id="tmb-<%= i.id.to_s %>"><%= link_to image_tag(i.attachment.url(:mini)), i.attachment.url(:product) %></li> | ||
<% @product.images.each do |i| %> | ||
<li class='tmb-all' id='tmb-<%= i.id %>'> | ||
<%= link_to(image_tag(i.attachment.url(:mini)), i.attachment.url(:product), :class => 'tmb-all', :id => "tmb-#{i.id}") %> | ||
</li> | ||
<% end %> | ||
<% if @product.has_variants? %> | ||
<% @variants.select(&:available?).each do |v| %> | ||
<% v.images.each do |i| %> | ||
<% next if @product.images.include?(i) %> | ||
<li class='vtmb-<%= v.id %> vtmb' id='tmb-<%= i.id %>'> | ||
<%= link_to(image_tag(i.attachment.url(:mini)), i.attachment.url(:product)) %> | ||
</li> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% if @product.has_variants? | ||
@variants.each do |v| | ||
if v.available? | ||
v.images.each do |i| %> | ||
<li class="vtmb-<%= v.id.to_s %> vtmb" id="tmb-<%= i.id.to_s %>"><%= link_to image_tag(i.attachment.url(:mini)), i.attachment.url(:product) %></li> | ||
<% | ||
end | ||
end | ||
end | ||
end | ||
%> | ||
</ul> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters