Sha256: e6ade57034a023d5f021e08261ffb2ee3e0ad3cdcb7d36d2a171050f1cfeea38

Contents?: true

Size: 1.71 KB

Versions: 3

Compression:

Stored size: 1.71 KB

Contents

<div data-hook="admin_variant_form_fields">
  <div class="clearfix">
    <div class="left" data-hook="variants">

      <% @product.options.each do |option| %>
        <p data-hook="presentation">
          <%= label :new_variant, option.option_type.presentation %><br />
          <% if @variant.new_record? %>
            <%= select(:new_variant, option.option_type.presentation,
              option.option_type.option_values.collect {|ov| [ ov.presentation, ov.id ] },
              {})
            %>
          <% else %>
            <% opt = @variant.option_values.detect {|o| o.option_type == option.option_type }.presentation %>
            <%= text_field(:new_variant,  option.option_type.presentation, :value => opt, :disabled => 'disabled') %>
          <% end %>
        </p>
      <% end %>

      <p data-hook="sku"><%= f.label :sku, t(:sku) %><br />
      <%= f.text_field :sku %></p>

      <p data-hook="price"><%= f.label :price, t(:price) %>:<br />
      <%= f.text_field :price, :value => number_to_currency(@variant.price, :unit => '') %></p>

      <p data-hook="cost_price"><%= f.label :cost_price, t(:cost_price) %>:<br />
      <%= f.text_field :cost_price, :value => number_to_currency(@variant.cost_price, :unit => '') %></p>

      <% if Spree::Config[:track_inventory_levels] %>
        <p data-hook="on_hand"><%= f.label :on_hand, t(:on_hand) %>: <br />
        <%= f.text_field :on_hand %></p>
      <% end %>
    </div>
    <div class="right">

      <% Spree::Variant.additional_fields.select{|af| af[:only].nil? || af[:only].include?(:variant) }.each do |field| %>
        <%= render :partial => 'spree/admin/shared/additional_field', :locals => { :field => field, :f => f } %>
      <% end %>

    </div>
  </div>
</div>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spree_core-1.1.6 app/views/spree/admin/variants/_form.html.erb
spree_core-1.1.5 app/views/spree/admin/variants/_form.html.erb
spree_core-1.1.4 app/views/spree/admin/variants/_form.html.erb