<commit_before><div data-hook="admin_product_rates_form_fields" class="col-md-12">
  <div class="form-group row">
     <%= label_tag :variant, Spree.t(:variant), :class => '' %>
     <%= select_tag 'rate[variant_id]', options_for_select(@product.variants.map { |v| [v.sku, v.id] }, @rate.variant_id), :class => 'select2 fullwidth' %>
  </div>
  <% prefix = "#{@product.product_type.name}_" %>
  <% @product.rate_option_types.each do |ot| %>
  <div class="form-group row">
    <%= label_tag ot.name, Spree.t(ot.presentation), :class => '' %>
       <% current_value = @rate.get_persisted_option_value(ot) %>
      <% if ot.attr_type == 'selection' %>
        <%= select_tag ot.name, options_for_select(ot.option_values.map { |ov| [ov.presentation, ov.id] }, current_value), :class => 'select2 fullwidth' %>
      <% elsif ot.attr_type == 'integer' %>
        <%= number_field_tag ot.name, current_value, :class => 'form-control', :min => 0 %>
      <% elsif ot.attr_type == 'float' %>
        <%= number_field_tag ot.name, current_value, :class => 'form-control' , :min => 0%>
      <% elsif ot.attr_type == 'boolean' %>
        <%= check_box_tag ot.name, 1 %>
      <% elsif ot.attr_type == 'date' %>
        <%= text_field_tag ot.name, current_value, :class => 'datepicker form-control col-md-6' %>
      <% else %>
        <%= text_field_tag ot.name, current_value, :class => 'fullwidth form-control' %>
      <% end %>
   </div>
  <% end %>
</div>
<commit_msg>why: the rates where not aligned with the spree css style and where not validated Changes: line up the inputs with the Spree layout view and added some front end validation<commit_after><div data-hook="admin_product_rates_form_fields" class="col-md-12">
  <div class="form-group field">
     <%= label_tag :variant, Spree.t(:variant) %>
     <%= select_tag 'rate[variant_id]', options_for_select(@product.variants.map { |v| [v.sku, v.id] }, @rate.variant_id), class: 'select2 fullwidth' %>
  </div>
  <% prefix = "#{@product.product_type.name}_" %>
  <% @product.rate_option_types.each do |ot| %>
  <div class="form-group field">
    <%= label_tag ot.name, raw(Spree.t(ot.name) + content_tag(:span, ' *', class: 'required'))%>
    <% current_value = @rate.get_persisted_option_value(ot) %>
      <% if ot.attr_type == 'selection' %>
        <%= select_tag ot.name, options_for_select(ot.option_values.map { |ov| [ov.presentation, ov.id] }, current_value), class: 'select2 fullwidth',  required: true%>
      <% elsif ot.attr_type == 'integer' %>
        <%= number_field_tag ot.name, current_value, class: 'form-control', min: 0, required: true %>
      <% elsif ot.attr_type == 'float' %>
        <%= number_field_tag ot.name, current_value, class: 'form-control' , min: 0, required: true%>
      <% elsif ot.attr_type == 'boolean' %>
        <%= check_box_tag ot.name, 1 %>
      <% elsif ot.attr_type == 'date' %>
        <%= text_field_tag ot.name, current_value, class: 'datepicker form-control', required: true%>
      <% else %>
        <%= text_field_tag ot.name, current_value, class: 'fullwidth form-control', required: true %>
      <% end %>
   </div>
  <% end %>
</div>

{'fraction_non_alphanumeric': 0.18308963763509217, 'fraction_numerical': 0.004767959313413859, 'mean_word_length': 3.634756995581738, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 65, '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': '3508506', 'n_tokens_mistral': 1163, 'n_tokens_neox': 1079, 'n_words': 230}