Sha256: e486a2f4b86d60d585e33ce1f3484a0e2bf276dd6c60d3cab74b8a9f613684fb

Contents?: true

Size: 1.78 KB

Versions: 1

Compression:

Stored size: 1.78 KB

Contents

<h2>Variants</h2>
<%=error_message_on :product, :variants %>
<table class="basic-table">
	<thead>
		<tr>
			<th>Options</th>
		  <th>SKU</th>
		  <th>On Hand</th>
			<th>Action</th>
		</tr>
	</thead>
	<tbody>
	  <% if @product.variants? %>
      <% @product.variants.each do |@variant| %>
        <% next if @variant.option_values.empty? %>
        <tr>
        	<td><%= variant_options @variant %></td>
          <td>
            <%= text_field :variant, :sku, :index => @variant.id, :class => :sku %>
          </td>
          <td><%= on_hand(@variant) %></td>
        	<td>
        	  <%= link_to "Inventory", :controller => 'inventory_units', :action => 'adjust', :id => @variant %>
        	  <%= link_to_remote "Remove",
        	                     :url => {:action => 'delete_variant', :id=> @product, :variant_id => @variant},
        	                     :before => "Element.show('busy_indicator')", 
        	                     :complete => "Element.hide('busy_indicator')",
        	                     :update => 'variant-listing' %>
        	</td>
        </tr>
      <% end %>
		<% else %>
			<tr>
				<td colspan="3">None Available.</td>
			</tr>
		<% end %>
	</tbody>
</table>
<% unless @product.new_record? or @product.selected_options.empty? %>
  <span id="new-var-link">
	  <%= link_to_remote "New Product Variant",
	                     :url => {:controller => 'products', :action => 'new_variant', :id=> @product},
	                     :before => "Element.hide('new-var-link');Element.show('var_busy_indicator')", 
	                     :complete => "Element.hide('var_busy_indicator')",
	                     :update => 'new-variant' %>
  </span>
	<%= image_tag "spinner.gif", :plugin=>"spree", :style => "display:none", :id => 'var_busy_indicator' %>
<% end %>

<div id="new-variant"></div>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spree-0.0.9 app/views/admin/products/_variants.rhtml