<%= f.field_container :name, class: ['form-group'] do %> <%= f.label :name, Spree.t(:name) %> <%= f.text_field :name, class: 'form-control' %> <%= f.error_message_on :name %> <% end %>
<%= f.field_container :display_on, class: ['form-group'] do %> <%= f.label :display_on, Spree.t(:display) %> <%= select(:shipping_method, :display_on, Spree::ShippingMethod::DISPLAY.collect { |display| [Spree.t(display), display.to_s] }, { include_blank: true }, { class: 'select2' }) %> <%= f.error_message_on :display_on %> <% end %>
<%= f.field_container :admin_name, class: ['form-group'] do %> <%= f.label :admin_name, Spree.t(:internal_name) %> <%= f.text_field :admin_name, class: 'form-control', label: false %> <%= f.error_message_on :admin_name %> <% end %>
<%= f.field_container :code, class: ['form-group'] do %> <%= f.label :code, Spree.t(:code) %> <%= f.text_field :code, class: 'form-control', label: false %> <%= f.error_message_on :code %> <% end %>
<%= f.field_container :tracking_url, class: ['form-group'] do %> <%= f.label :tracking_url, Spree.t(:tracking_url) %> <%= f.text_field :tracking_url, class: 'form-control', placeholder: Spree.t(:tracking_url_placeholder) %> <%= f.error_message_on :tracking_url %> <% end %>

<%= Spree.t(:shipping_categories) %>

<%= f.field_container :categories, class: ['form-group'] do %> <% Spree::ShippingCategory.all.each do |category| %>
<%= label_tag do %> <%= check_box_tag('shipping_method[shipping_categories][]', category.id, @shipping_method.shipping_categories.include?(category)) %> <%= category.name %> <% end %>
<% end %> <%= f.error_message_on :shipping_category_id %> <% end %>

<%= Spree.t(:zones) %>

<%= f.field_container :zones, class: ['form-group'] do %> <% shipping_method_zones = @shipping_method.zones.to_a %> <% Spree::Zone.all.each do |zone| %>
<%= label_tag do %> <%= check_box_tag('shipping_method[zones][]', zone.id, shipping_method_zones.include?(zone)) %> <%= zone.name %> <% end %>
<% end %> <%= f.error_message_on :zone_id %> <% end %>
<%= render partial: 'spree/admin/shared/calculator_fields', locals: { f: f } %>

<%= Spree.t(:tax_category) %>

<%= f.field_container :categories, class: ['form-group'] do %> <%= f.select :tax_category_id, @tax_categories.map { |tc| [tc.name, tc.id] }, { include_blank: true }, class: "select2" %> <%= f.error_message_on :tax_category_id %> <% end %>