app/views/spree/admin/variants/_form.html.erb in solidus_backend-2.0.3 vs app/views/spree/admin/variants/_form.html.erb in solidus_backend-2.1.0.beta1
- old
+ new
@@ -1,77 +1,101 @@
<div data-hook="variants">
<fieldset class="no-border-top no-border-bottom">
- <div class="field four columns alpha" data-hook="sku">
- <%= f.label :sku %>
- <%= f.text_field :sku, :class => 'fullwidth' %>
+ <div class="row">
+ <div class="col-xs-3">
+ <div class="field" data-hook="sku">
+ <%= f.label :sku %>
+ <%= f.text_field :sku, :class => 'fullwidth' %>
+ </div>
+ </div>
+ <div class="col-xs-3">
+ <div class="field checkbox" data-hook="track_inventory">
+ <%= f.label :track_inventory do %>
+ <%= f.check_box :track_inventory %>
+ <%= Spree::Variant.human_attribute_name(:track_inventory) %>
+ <% end %>
+ </div>
+ </div>
</div>
- <div class="field four columns checkbox" data-hook="track_inventory">
- <%= f.label :track_inventory do %>
- <%= f.check_box :track_inventory %>
- <%= Spree::Variant.human_attribute_name(:track_inventory) %>
- <% end %>
- </div>
</fieldset>
<% if f.object.new_record? %>
<fieldset class="no-border-top no-border-bottom">
+ <div class="row">
<% @product.option_types.each_with_index do |option_type, index| %>
- <div class="field four columns <%= 'alpha' if index % 3 == 0 %><%= 'omega' if index % 3 == 2 %>" data-hook="presentation">
- <%= label :new_variant, option_type.presentation %>
- <%= f.collection_select 'option_value_ids',
- option_type.option_values,
- :id,
- :presentation,
- { include_blank: true },
- {
- name: 'variant[option_value_ids][]',
- class: "select2 fullwidth"
- } %>
- </div>
+ <div class="col-xs-3">
+ <div class="field" data-hook="presentation">
+ <%= label :new_variant, option_type.presentation %>
+ <%= f.collection_select 'option_value_ids',
+ option_type.option_values,
+ :id,
+ :presentation,
+ { include_blank: true },
+ {
+ name: 'variant[option_value_ids][]',
+ class: "select2 fullwidth"
+ } %>
+ </div>
+ </div>
<% end %>
+ </div>
</fieldset>
<% end %>
</div>
<div data-hook="admin_variant_form_additional_fields">
<fieldset class="no-border-top no-border-bottom">
- <% [:weight, :height, :width, :depth].each_with_index do |field, index| %>
- <div class="field four columns <%= 'alpha' if index % 4 == 0 %> <%= 'omega' if index % 4 == 3 %>" data-hook="<%= field %>">
- <%= f.label field %>
- <%= f.text_field field,
- value: number_with_precision(@variant.send(field), :precision => 2),
- class: 'fullwidth' %>
- </div>
- <% end %>
+ <div class="row">
+ <% [:weight, :height, :width, :depth].each_with_index do |field, index| %>
+ <div class="col-xs-3">
+ <div class="field" data-hook="<%= field %>">
+ <%= f.label field %>
+ <%= f.text_field field,
+ value: number_with_precision(@variant.send(field), :precision => 2),
+ class: 'fullwidth' %>
+ </div>
+ </div>
+ <% end %>
+ </div>
</fieldset>
</div>
<div data-hook="admin_variant_form_fields">
<fieldset class="no-border-top no-border-bottom">
<p> <%== t('.pricing_hint') %> </p>
- <div class="field four columns alpha" data-hook="price">
- <%= f.label :price %>
- <%= f.text_field :price, :value => number_to_currency(@variant.price, :unit => ''), :class => 'fullwidth' %>
- </div>
+ <div class="row">
+ <div class="col-xs-3">
+ <div class="field" data-hook="price">
+ <%= f.label :price %>
+ <%= f.text_field :price, :value => number_to_currency(@variant.price, :unit => ''), :class => 'fullwidth' %>
+ </div>
+ </div>
- <% if show_rebuild_vat_checkbox? %>
- <%= render "spree/admin/shared/rebuild_vat_prices_checkbox", form: f, model_name: "variant", wrapper_class: "field four columns" %>
- <% end %>
+ <% if show_rebuild_vat_checkbox? %>
+ <div class="col-xs-3">
+ <%= render "spree/admin/shared/rebuild_vat_prices_checkbox", form: f, model_name: "variant", wrapper_class: "field" %>
+ </div>
+ <% end %>
- <div class="field four columns" data-hook="cost_price">
- <%= f.label :cost_price %>
- <%= f.text_field :cost_price, :value => number_to_currency(@variant.cost_price, :unit => ''), :class => 'fullwidth' %>
- </div>
+ <div class="col-xs-3">
+ <div class="field" data-hook="cost_price">
+ <%= f.label :cost_price %>
+ <%= f.text_field :cost_price, :value => number_to_currency(@variant.cost_price, :unit => ''), :class => 'fullwidth' %>
+ </div>
+ </div>
- <div class="field four columns omega" data-hook="tax_category">
- <%= f.label :tax_category %>
- <%= f.field_hint :tax_category %>
- <%= f.collection_select :tax_category_id,
- @tax_categories,
- :id,
- :name,
- { :include_blank => t('.use_product_tax_category') },
- { :class => 'select2 fullwidth' } %>
+ <div class="col-xs-3">
+ <div class="field" data-hook="tax_category">
+ <%= f.label :tax_category %>
+ <%= f.field_hint :tax_category %>
+ <%= f.collection_select :tax_category_id,
+ @tax_categories,
+ :id,
+ :name,
+ { :include_blank => t('.use_product_tax_category') },
+ { :class => 'select2 fullwidth' } %>
+ </div>
+ </div>
</div>
</fieldset>
</div>