<commit_before><%= render :partial => 'spree/shared/error_messages', :locals => { :target => @product } %>

<%= form_for [:admin, @product], method: :post, url: admin_products_path, :html => { :multipart => true } do |f| %>

  <fieldset data-hook="new_product">

    <legend align="center"><%= Spree.t(:new_product) %></legend>

    <%= f.field_container :name do %>
      <%= f.label :name, class: 'required' %><br />
      <%= f.text_field :name, :class => 'fullwidth title', :required => true %>
      <%= f.error_message_on :name %>
    <% end %>

    <div data-hook="new_product_attrs" class="row">
      <% unless @product.has_variants? %>
        <div data-hook="new_product_sku" class="alpha four columns">
          <%= f.field_container :sku do %>
            <%= f.label :sku, Spree.t(:sku) %><br />
            <%= f.text_field :sku, :size => 16, :class => 'fullwidth' %>
            <%= f.error_message_on :sku %>
          <% end %>
        </div>
      <% end %>

      <div data-hook="new_product_prototype" class="four columns">
        <%= f.field_container :prototype do %>
          <%= f.label :prototype_id, Spree::Prototype.model_name.human %><br />
          <%= f.collection_select :prototype_id, Spree::Prototype.all, :id, :name, {:include_blank => true}, {:class => 'select2 fullwidth'} %>
        <% end %>
      </div>

      <div data-hook="new_product_price" class="four columns">
        <%= f.field_container :price do %>
          <%= f.label :price, class: 'required' %><br />
          <%= f.text_field :price, :value => number_to_currency(@product.price, :unit => ''), :class => 'fullwidth', :required => true %>
          <%= f.error_message_on :price %>
        <% end %>
      </div>

      <div data-hook="new_product_available_on" class="omega four columns">
        <%= f.field_container :available_on do %>
          <%= f.label :available_on %>
          <%= f.error_message_on :available_on %>
          <%= f.text_field :available_on, :class => 'datepicker fullwidth' %>
        <% end %>
      </div>

    </div>

    <div class='row'>
      <div data-hook="new_product_shipping_category" class="alpha four columns">
        <%= f.field_container :shipping_category do %>
          <%= f.label :shipping_category_id, Spree::ShippingCategory.
                model_name.human, class: 'required' %><br />
          <%= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, { :include_blank => Spree.t('match_choices.none') }, { :class => 'select2 fullwidth' }) %>
          <%= f.error_message_on :shipping_category_id %>
        <% end %>
      </div>
    </div><commit_msg>Allow setting a product's tax category on creation<commit_after><%= render :partial => 'spree/shared/error_messages', :locals => { :target => @product } %>

<%= form_for [:admin, @product], method: :post, url: admin_products_path, :html => { :multipart => true } do |f| %>

  <fieldset data-hook="new_product">

    <legend align="center"><%= Spree.t(:new_product) %></legend>

    <%= f.field_container :name do %>
      <%= f.label :name, class: 'required' %><br />
      <%= f.text_field :name, :class => 'fullwidth title', :required => true %>
      <%= f.error_message_on :name %>
    <% end %>

    <div data-hook="new_product_attrs" class="row">
      <% unless @product.has_variants? %>
        <div data-hook="new_product_sku" class="alpha four columns">
          <%= f.field_container :sku do %>
            <%= f.label :sku, Spree.t(:sku) %><br />
            <%= f.text_field :sku, :size => 16, :class => 'fullwidth' %>
            <%= f.error_message_on :sku %>
          <% end %>
        </div>
      <% end %>

      <div data-hook="new_product_prototype" class="four columns">
        <%= f.field_container :prototype do %>
          <%= f.label :prototype_id, Spree::Prototype.model_name.human %><br />
          <%= f.collection_select :prototype_id, Spree::Prototype.all, :id, :name, {:include_blank => true}, {:class => 'select2 fullwidth'} %>
        <% end %>
      </div>

      <div data-hook="new_product_price" class="four columns">
        <%= f.field_container :price do %>
          <%= f.label :price, class: 'required' %><br />
          <%= f.text_field :price, :value => number_to_currency(@product.price, :unit => ''), :class => 'fullwidth', :required => true %>
          <%= f.error_message_on :price %>
        <% end %>
      </div>

      <div data-hook="new_product_available_on" class="omega four columns">
        <%= f.field_container :available_on do %>
          <%= f.label :available_on %>
          <%= f.error_message_on :available_on %>
          <%= f.text_field :available_on, :class => 'datepicker fullwidth' %>
        <% end %>
      </div>

    </div>

    <div class='row'>
      <div data-hook="new_product_shipping_category" class="alpha field four columns">
        <%= f.field_container :shipping_category do %>
          <%= f.label :shipping_category_id, Spree::ShippingCategory.
                model_name.human, class: 'required' %><br />
          <%= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, { :include_blank => Spree.t('match_choices.none') }, { :class => 'select2 fullwidth' }) %>
          <%= f.error_message_on :shipping_category_id %>
        <% end %>
      </div>

      <div data-hook="new_product_tax_category" class="field four columns">
        <%= f.field_container :tax_category do %>
          <%= f.label :tax_category_id, Spree::TaxCategory.model_name.human %>
          <%= f.collection_select(:tax_category_id, @tax_categories, :id, :name, { :include_blank => Spree.t('match_choices.none') }, { :class => 'select2 fullwidth' }) %>
          <%= f.error_message_on :tax_category %>
        <% end %>
      </div>
    </div>
{'fraction_non_alphanumeric': 0.18341968911917098, 'fraction_numerical': 0.0015544041450777201, 'mean_word_length': 2.830026455026455, 'pattern_counts': {'":': 0, '<': 122, '<?xml version=': 0, '>': 160, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1686327', 'n_tokens_mistral': 2016, 'n_tokens_neox': 1849, 'n_words': 371}