Sha256: c8f1ef7979ef1c8bfb89e237362506d1f624d66a4f02bc6aefaeaf099ec2ec7b
Contents?: true
Size: 1.81 KB
Versions: 4
Compression:
Stored size: 1.81 KB
Contents
<script type="text/javascript"> function displayRow(){ var row = document.getElementById("captionRow"); if (row.style.display == '') row.style.display = 'none'; else row.style.display = ''; } </script> <h4><%= t('spree.available_parts') %></h4> <table class="index"> <thead> <tr> <th><%= t('spree.name') %></th> <th><%= t('spree.available_on') %></th> <th><%= t('spree.options') %></th> <th><%= t('spree.qty') %></th> <th></th> </tr> </thead> <tbody> <% @available_products.each do |product| %> <tr id="<%= dom_id(product) %>"> <td><%= product.name %></td> <td><%= product.available_on %></td> <td> <% if product.has_variants? %> <%= select_tag "part[id]", options_for_select(product.variants.map { |v| [variant_options(v), v.id] }) %> <% else %> <%= hidden_field_tag "part[id]", product.master.id %> <%= t(:no_variants) %> <% end %> </td> <td><%= text_field_tag "part[count]", 1 %></td> <td class="actions"> <%= link_to(t('spree.select'), admin_product_parts_path(@product), :class => "add_product_part_link btn btn-primary") %> </td> </tr> <% end %> <% if @available_products.empty? %> <tr><td colspan="3"><%= t('spree.no_match_found') %>.</td></tr> <% end %> </tbody> </table> <%= javascript_tag do %> $("a.add_product_part_link").click(function(){ part_id_val = $('select option:selected', $(this).parent().parent()).val() || $('input:first', $(this).parent().parent()).val(); params = { part_count : $('input:last', $(this).parent().parent()).val(), part_id : part_id_val}; return make_post_request($(this), params); }); <% end %>
Version data entries
4 entries across 4 versions & 1 rubygems