<div data-hook="admin_shipping_method_form_fields">
  <%= f.field_container :name do %>
    <%= f.label :name, t(:name) %><br />
    <%= f.text_field :name %>
    <%= error_message_on :shipping_method, :name %>
  <% end %>

  <%= f.field_container :zone_id do %>
    <%= f.label :zone_id, t(:zone) %><br />
    <%= f.collection_select(:zone_id, @available_zones, :id, :name, {}, {'style' => 'width:200px;'}) %>
    <%= error_message_on :shipping_method, :zone_id %>
  <% end %>

  <%= f.field_container :display_on do %>
    <%= f.label :display_on, t(:display) %><br />
    <%= select(:shipping_method, :display_on, Spree::ShippingMethod::DISPLAY.collect { |display| [t(display), display == :both ? nil : display.to_s] }) %>
    <%= error_message_on :shipping_method, :display_on %>
  <% end %>
</div>

<div data-hook"admin_shipping_method_form_availability_fields">
  <fieldset class="categories">
    <legend><%= t(:availability) %></legend>
    <%= f.field_container :shipping_category do %>
      <%= f.label :shipping_category, t(:shipping_category_choose) %>
      <%= select(:shipping_method, :shipping_category_id, Spree::ShippingCategory.all.collect { |s| [s.name, s.id] }, { :include_blank => true }) %>
    <% end %>

    <b><%= t(:match_rule) %></b>&nbsp;&nbsp;
    <%= f.check_box :match_none %>&nbsp;<%= f.label :match_none, t('match_choices.none') %>
    <%= f.check_box :match_one %>&nbsp;<%= f.label :match_one, t('match_choices.one') %>
    <%= f.check_box :match_all %>&nbsp;<%= f.label :match_all, t('match_choices.all') %>
  </fieldset>
</div>

<div data-hook="admin_shipping_method_form_calculator_fields">
  <%= render :partial => 'spree/admin/shared/calculator_fields', :locals => { :f => f } %>
</div>
