% 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 :page_actions do %>
<%= button_link_to t('.new_subscription'), new_admin_subscription_path %>
<% end %>
<% content_for :table_filter_title do %>
<%= Spree.t(:search) %>
<% end %>
<% content_for :table_filter do %>
<%= search_form_for [:admin, @search] do |f| %>
<%= label_tag :q_created_at_gt, Spree.t(:date_range) %>
<%= f.text_field :created_at_gt, class: 'datepicker datepicker-from', placeholder: Spree.t(:start) %>
<%= f.text_field :created_at_lt, class: 'datepicker datepicker-to', placeholder: Spree.t(:stop) %>
<%= label_tag :q_actionable_date_gt, SolidusSubscriptions::Subscription.human_attribute_name(:actionable_date) %>
<%= f.text_field :actionable_date_gt, class: 'datepicker datepicker-from', placeholder: Spree.t(:start) %>
<%= f.text_field :actionable_date_lt, class: 'datepicker datepicker-to', placeholder: Spree.t(:stop) %>
<%= 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' %>
<%= label_tag :q_user_email_cont, Spree::User.human_attribute_name(:email) %>
<%= f.text_field :user_email_cont, size: 25 %>
<%= 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'
)
%>
<%= button Spree.t(:filter_results) %>
<% 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 %>
<% if @subscriptions.any? %>
<%= sort_link(@search, :created_at, SolidusSubscriptions::Subscription.human_attribute_name(:created_at)) %> |
<%= sort_link(@search, :user_email, SolidusSubscriptions::Subscription.human_attribute_name(:user)) %> |
<%= sort_link(@search, :actionable_date, SolidusSubscriptions::Subscription.human_attribute_name(:actionable_date)) %> |
<%= sort_link(@search, :line_item_interval_length, SolidusSubscriptions::Subscription.human_attribute_name(:interval)) %> |
<%= sort_link(@search, :state, SolidusSubscriptions::Subscription.human_attribute_name(:state)) %> |
<%= sort_link(@search, :processing_state, SolidusSubscriptions::Subscription.human_attribute_name(:processing_state)) %> |
|
<%= render @subscriptions %>
<% else %>
<%= render 'spree/admin/shared/no_objects_found', resource: SolidusSubscriptions::Subscription, new_resource_url: spree.new_admin_subscription_path %>
<% end %>