<commit_before><%= render :partial => 'spree/admin/shared/sub_menu/configuration' %>

<% content_for :page_title do %>
    <%= Spree.t(:clear_sale_settings) %>
<% end %>

<script type='text/template' id='clear_sale_provider_template'>
  {{#each providers}}
  <tr>
    <td>{{provider.text}}</td>
    <td>{{payment_type.text}}</td>
    <td class='actions actions-1 text-center'>
      <button class='icon_link btn btn-danger btn-sm clear_sale_remove_provider' data-provider='{{provider.id}}'>
        <span class='icon icon-delete' data-provider='{{provider.id}}'></span>
      </button>
      <input type='hidden' id='providers[]' name='providers[]' value='{{provider.id}}'>
      <input type='hidden' id='payment_types[]' name='payment_types[]' value='{{payment_type.id}}'>
    </td>
  </tr>
  {{/each}}
</script>

<%= form_tag admin_clear_sale_settings_path, :method => :put  do |form| %>
    <div id="clear_sale_preferences" data-hook="clear_sale_preferences">
      <div class="panel panel-default">
        <div class="panel-heading">
          <h1 class="panel-title">
            <%= Spree.t(:settings) %>
          </h1>
        </div>
        <div class="panel-body">
          <div class="row">
            <div class="col-sm-12">
              <%= label_tag(:state, Spree.t(:state) + ': ') + tag(:br) %>
              <%= radio_button_tag :state, true, @config.state %>
              <%= label_tag(:state_true, Spree.t(:state_true)) %>
              <%= radio_button_tag :state, false, @config.state == false %>
              <%= label_tag(:state_false, Spree.t(:state_false)) %>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6">
              <%= label_tag(:token, Spree.t(:token) + ': ') + tag(:br) %>
              <%= text_field_tag :token, @config.token, class: 'form-control' %>
            </div>
            <div class="col-sm-6">
              <%= label_tag(:doc_customer_attr, Spree.t(:doc_customer_attr) + ': ') + tag(:br) %>
              <%= select_tag :doc_customer_attr,
                             options_for_select(@user_attr.collect { |item| [t(item), item] }, @config.doc_customer_attr),
                             class: 'select2', include_blank: true %>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6">
              <%= check_box_tag :test_mode, true, @config.test_mode == true %>
              <%= label_tag :test_mode, Spree.t(:test_mode) %>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6">
              <div class="col-sm-12 p-l-n p-r-n">
                <%= check_box_tag :enable_birth_date, true, @config.birth_date_customer_attr.present? %>
                <%= label_tag :enable_birth_date, Spree.t(:enable_birth_date) %>
              </div>
              <div class="col-sm-12 p-l-n p-r-n" id="birth_date_container">
                <%= select_tag :birth_date_customer_attr,
                               options_for_select(@user_attr.collect { |item| [t(item), item] }, @config.birth_date_customer_attr),
                               class: 'select2', include_blank: true %>
              </div>
            </div><commit_msg>Translate the user attributes in settings<commit_after><%= render :partial => 'spree/admin/shared/sub_menu/configuration' %>

<% content_for :page_title do %>
    <%= Spree.t(:clear_sale_settings) %>
<% end %>

<script type='text/template' id='clear_sale_provider_template'>
  {{#each providers}}
  <tr>
    <td>{{provider.text}}</td>
    <td>{{payment_type.text}}</td>
    <td class='actions actions-1 text-center'>
      <button class='icon_link btn btn-danger btn-sm clear_sale_remove_provider' data-provider='{{provider.id}}'>
        <span class='icon icon-delete' data-provider='{{provider.id}}'></span>
      </button>
      <input type='hidden' id='providers[]' name='providers[]' value='{{provider.id}}'>
      <input type='hidden' id='payment_types[]' name='payment_types[]' value='{{payment_type.id}}'>
    </td>
  </tr>
  {{/each}}
</script>

<%= form_tag admin_clear_sale_settings_path, :method => :put  do |form| %>
    <div id="clear_sale_preferences" data-hook="clear_sale_preferences">
      <div class="panel panel-default">
        <div class="panel-heading">
          <h1 class="panel-title">
            <%= Spree.t(:settings) %>
          </h1>
        </div>
        <div class="panel-body">
          <div class="row">
            <div class="col-sm-12">
              <%= label_tag(:state, Spree.t(:state) + ': ') + tag(:br) %>
              <%= radio_button_tag :state, true, @config.state %>
              <%= label_tag(:state_true, Spree.t(:state_true)) %>
              <%= radio_button_tag :state, false, @config.state == false %>
              <%= label_tag(:state_false, Spree.t(:state_false)) %>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6">
              <%= label_tag(:token, Spree.t(:token) + ': ') + tag(:br) %>
              <%= text_field_tag :token, @config.token, class: 'form-control' %>
            </div>
            <div class="col-sm-6">
              <%= label_tag(:doc_customer_attr, Spree.t(:doc_customer_attr) + ': ') + tag(:br) %>
              <%= select_tag :doc_customer_attr,
                             options_for_select(@user_attr.collect { |item| [Spree.t(item), item] }, @config.doc_customer_attr),
                             class: 'select2', include_blank: true %>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6">
              <%= check_box_tag :test_mode, true, @config.test_mode == true %>
              <%= label_tag :test_mode, Spree.t(:test_mode) %>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6">
              <div class="col-sm-12 p-l-n p-r-n">
                <%= check_box_tag :enable_birth_date, true, @config.birth_date_customer_attr.present? %>
                <%= label_tag :enable_birth_date, Spree.t(:enable_birth_date) %>
              </div>
              <div class="col-sm-12 p-l-n p-r-n" id="birth_date_container">
                <%= select_tag :birth_date_customer_attr,
                               options_for_select(@user_attr.collect { |item| [Spree.t(item), item] }, @config.birth_date_customer_attr),
                               class: 'select2', include_blank: true %>
              </div>
            </div>
{'fraction_non_alphanumeric': 0.17725030826140567, 'fraction_numerical': 0.004623921085080148, 'mean_word_length': 2.1997041420118344, 'pattern_counts': {'":': 0, '<': 131, '<?xml version=': 0, '>': 135, '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': '3015274', 'n_tokens_mistral': 2178, 'n_tokens_neox': 2041, 'n_words': 342}