<commit_before><% if respond_to?(:admin_breadcrumb) %>
  <% admin_breadcrumb(SolidusSubscriptions::Subscription.model_name.human) %>
<% else %>
  <% content_for(:page_title, SolidusSubscriptions::Subscription.model_name.human) %>
<% end %>

<% content_for :table_filter_title do %>
  <%= Spree.t(:search) %>
<% end %>

<% content_for :table_filter do %>
  <%= search_form_for [:admin, @search] do |f| %>
    <div class='field-block alpha four columns'>
      <div class="date-range-filter field">
        <%= label_tag :q_created_at_gt, Spree.t(:date_range) %>
        <div class="date-range-fields">
          <%= f.text_field :created_at_gt, class: 'datepicker datepicker-from', placeholder: Spree.t(:start) %>

          <span class="range-divider">
            <i class="fa fa-arrow-right"></i>
          </span>

          <%= f.text_field :created_at_lt, class: 'datepicker datepicker-to', placeholder: Spree.t(:stop) %>
        </div>
      </div>

      <div class="date-range-filter field">
        <%= label_tag :q_actionable_date_gt, SolidusSubscriptions::Subscription.human_attribute_name(:actionable_date) %>
        <div class="date-range-fields">
          <%= f.text_field :actionable_date_gt, class: 'datepicker datepicker-from', placeholder: Spree.t(:start) %>

          <span class="range-divider">
            <i class="fa fa-arrow-right"></i>
          </span>

          <%= f.text_field :actionable_date_lt, class: 'datepicker datepicker-to', placeholder: Spree.t(:stop) %>
        </div>
      </div>
    </div>

    <div class="four columns">
      <div class="field">
        <%= label_tag :q_state_eq, Spree.t(:status) %>
        <%= f.select :state_eq, SolidusSubscriptions::Subscription.state_machines[:state].states.map {|s| [s.human_name, s.value]}, {include_blank: true}, class: 'select2 fullwidth' %>
      </div>
    </div>

    <div class="four columns">
      <div class="field">
        <%= label_tag :q_user_email_cont, Spree::User.human_attribute_name(:email) %>
        <%= f.text_field :user_email_cont, size: 25 %>
      </div>
    </div>

    <div class="omega four columns">
      <div class="field">
        <%= label_tag :q_processing_state_eq, SolidusSubscriptions::Subscription.human_attribute_name(:processing_state) %>

        <%
          processing_states = SolidusSubscriptions::Subscription.processing_states.map do |state|
            [
              SolidusSubscriptions::Subscription.human_attribute_name("processing_state.#{ state }"),
              state
            ]
          end
        %>

        <%=
          f.select(
            :in_processing_state,
            options_for_select(processing_states),
            { include_blank: true },
            class: 'select2 fullwidth'
          )
        %>
      </div>
    </div>

    <div class="clearfix"></div>

    <div class="actions filter-actions">
      <div><%= button Spree.t(:filter_results) %></div>
    </div>
  <% end %>
<% end %>

<%= paginate @subscriptions, theme: "solidus_admin" %>

<table id="listing_subscriptions" class="index">
  <thead>
    <tr>
      <th><%= SolidusSubscriptions::Subscription.human_attribute_name(:created_at) %></th>
      <th><%= SolidusSubscriptions::Subscription.human_attribute_name(:user) %></th>
      <th><%= SolidusSubscriptions::Subscription.human_attribute_name(:actionable_date) %></th>
      <th><%= SolidusSubscriptions::Subscription.human_attribute_name(:state) %></th>
      <th><%= SolidusSubscriptions::Subscription.human_attribute_name(:processing_state) %></th>
      <th class='actions'></th>
    </tr>
  </thead>

  <tbody>
    <%= render partial: 'subscription', collection: @subscriptions %>
  </tbody>
</table><commit_msg>Only use solidus_admin them in versions >= 1.3.0<commit_after><% if respond_to?(:admin_breadcrumb) %>
  <% admin_breadcrumb(SolidusSubscriptions::Subscription.model_name.human) %>
<% else %>
  <% content_for(:page_title, SolidusSubscriptions::Subscription.model_name.human) %>
<% end %>

<% content_for :table_filter_title do %>
  <%= Spree.t(:search) %>
<% end %>

<% content_for :table_filter do %>
  <%= search_form_for [:admin, @search] do |f| %>
    <div class='field-block alpha four columns'>
      <div class="date-range-filter field">
        <%= label_tag :q_created_at_gt, Spree.t(:date_range) %>
        <div class="date-range-fields">
          <%= f.text_field :created_at_gt, class: 'datepicker datepicker-from', placeholder: Spree.t(:start) %>

          <span class="range-divider">
            <i class="fa fa-arrow-right"></i>
          </span>

          <%= f.text_field :created_at_lt, class: 'datepicker datepicker-to', placeholder: Spree.t(:stop) %>
        </div>
      </div>

      <div class="date-range-filter field">
        <%= label_tag :q_actionable_date_gt, SolidusSubscriptions::Subscription.human_attribute_name(:actionable_date) %>
        <div class="date-range-fields">
          <%= f.text_field :actionable_date_gt, class: 'datepicker datepicker-from', placeholder: Spree.t(:start) %>

          <span class="range-divider">
            <i class="fa fa-arrow-right"></i>
          </span>

          <%= f.text_field :actionable_date_lt, class: 'datepicker datepicker-to', placeholder: Spree.t(:stop) %>
        </div>
      </div>
    </div>

    <div class="four columns">
      <div class="field">
        <%= label_tag :q_state_eq, Spree.t(:status) %>
        <%= f.select :state_eq, SolidusSubscriptions::Subscription.state_machines[:state].states.map {|s| [s.human_name, s.value]}, {include_blank: true}, class: 'select2 fullwidth' %>
      </div>
    </div>

    <div class="four columns">
      <div class="field">
        <%= label_tag :q_user_email_cont, Spree::User.human_attribute_name(:email) %>
        <%= f.text_field :user_email_cont, size: 25 %>
      </div>
    </div>

    <div class="omega four columns">
      <div class="field">
        <%= label_tag :q_processing_state_eq, SolidusSubscriptions::Subscription.human_attribute_name(:processing_state) %>

        <%
          processing_states = SolidusSubscriptions::Subscription.processing_states.map do |state|
            [
              SolidusSubscriptions::Subscription.human_attribute_name("processing_state.#{ state }"),
              state
            ]
          end
        %>

        <%=
          f.select(
            :in_processing_state,
            options_for_select(processing_states),
            { include_blank: true },
            class: 'select2 fullwidth'
          )
        %>
      </div>
    </div>

    <div class="clearfix"></div>

    <div class="actions filter-actions">
      <div><%= button Spree.t(:filter_results) %></div>
    </div>
  <% end %>
<% end %>

<% if Spree.respond_to?(:solidus_version) && (Spree.solidus_gem_version <=> Gem::Version.new('1.3.0')) >= 0  %>
  <%= paginate @subscriptions, theme: 'solidus_admin' %>
<% else %>
  <%= paginate @subscriptions %>
<% end %>

<table id="listing_subscriptions" class="index">
  <thead>
    <tr>
      <th><%= SolidusSubscriptions::Subscription.human_attribute_name(:created_at) %></th>
      <th><%= SolidusSubscriptions::Subscription.human_attribute_name(:user) %></th>
      <th><%= SolidusSubscriptions::Subscription.human_attribute_name(:actionable_date) %></th>
      <th><%= SolidusSubscriptions::Subscription.human_attribute_name(:state) %></th>
      <th><%= SolidusSubscriptions::Subscription.human_attribute_name(:processing_state) %></th>
      <th class='actions'></th>
    </tr>
  </thead>

  <tbody>
    <%= render partial: 'subscription', collection: @subscriptions %>
  </tbody>
</table>
{'fraction_non_alphanumeric': 0.1649376231122784, 'fraction_numerical': 0.001969796454366382, 'mean_word_length': 3.1526717557251906, 'pattern_counts': {'":': 0, '<': 186, '<?xml version=': 0, '>': 188, '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': '2135052', 'n_tokens_mistral': 2568, 'n_tokens_neox': 2402, 'n_words': 408}