Sha256: b9e992c2c0f67ea6c35fd523bd02cb7c95d30a7fab18aafa153f281ad2b1b087

Contents?: true

Size: 1.29 KB

Versions: 18

Compression:

Stored size: 1.29 KB

Contents

<!-- no need for thumnails unless there is more then one image -->
<% if product.images.size > 1 %>
  <ul id="product-thumbnails" class="thumbnails">
    <% product.images.each do |i| %>  
      <li><%= link_to(image_tag(i.attachment.url(:mini)), i.attachment.url(:product)) %></li>
    <% end %>
  </ul>
<% end %>

<% if @product.has_variants?
  has_checked = false %>
  <h4 id="variant-images">
    <%= t('images_for') %>:
    <span><%= @selected_variant.options_text %></span>
  </h4>
  <ul id="variant-thumbnails" class="thumbnails">
    <% @variants.each do |v|
        checked = !has_checked && (v.available?)
   		  has_checked = true if checked
        
        if checked 
          v.images.each do |i| %>  
            <li><%= link_to(image_tag(i.attachment.url(:mini)), i.attachment.url(:product)) %></li>
          <% end %>
        <% end %>
      <% end %>
    </ul>
<% end %>

<% content_for :head do %>
  <script type="text/javascript" charset="utf-8">
    var images = new Array();
    <% @variants.each do |v| %>
      images[<%= v.id.to_s %>] = new Array();
      <% v.images.each_with_index do |image, i| %>
        images[<%= v.id.to_s %>][<%= i %>] = <%= raw link_to(image_tag(image.attachment.url(:mini)), image.attachment.url(:product)).to_json %>;
      <% end %>
    <% end %>
  </script>
<% end %>

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
spree-0.11.4 vendor/extensions/theme_default/app/views/products/_thumbnails.html.erb
spree-0.11.3 vendor/extensions/theme_default/app/views/products/_thumbnails.html.erb
spree_core-0.30.2 app/views/products/_thumbnails.html.erb
spree_core-0.40.4 app/views/products/_thumbnails.html.erb
spree_core-0.50.4 app/views/products/_thumbnails.html.erb
spree_core-0.50.3 app/views/products/_thumbnails.html.erb
spree_core-0.50.2 app/views/products/_thumbnails.html.erb
spree_core-0.50.1 app/views/products/_thumbnails.html.erb
spree_core-0.50.0 app/views/products/_thumbnails.html.erb
spree_core-0.40.3 app/views/products/_thumbnails.html.erb
spree_core-0.40.2 app/views/products/_thumbnails.html.erb
spree_core-0.40.1 app/views/products/_thumbnails.html.erb
spree_core-0.40.0 app/views/products/_thumbnails.html.erb
spree_core-0.30.1 app/views/products/_thumbnails.html.erb
spree_core-0.30.0 app/views/products/_thumbnails.html.erb
spree-0.11.2 vendor/extensions/theme_default/app/views/products/_thumbnails.html.erb
spree-0.11.1 vendor/extensions/theme_default/app/views/products/_thumbnails.html.erb
spree_core-0.30.0.beta1 app/views/products/_thumbnails.html.erb