% content_for :page_title do %>
<%= Spree.t(:subscription_events) %>
<% end %>
<% content_for :page_actions do %>
<%= link_to_with_icon 'icon-arrow-left', Spree.t(:back_to_reports_list), spree.admin_reports_url, :class => 'button' %>
<% end %>
<% content_for :table_filter_title do %>
<%= Spree.t(:subscription_event_search) %>
<% end %>
<% content_for :table_filter do %>
<%= search_form_for @search, :url => spree.admin_subscription_events_url do |s| %>
<%= label_tag nil, Spree.t(:start), :class => 'inline' %>
<%= s.text_field :created_at_gt, :class => 'datepicker datepicker-from', :value => datepicker_field_value(params[:q][:created_at_gt]) %>
<%= s.text_field :created_at_lt, :class => 'datepicker datepicker-to', :value => datepicker_field_value(params[:q][:created_at_lt]) %>
<%= label_tag nil, Spree.t(:end), :class => 'inline' %>
<%= label_tag nil, Spree.t(:email), :class => 'inline' %>
<%= s.text_field :subscription_email_eq, style: "width:240px" %>
<%= button Spree.t(:search), 'icon-search' %>
<% end %>
<% end %>
<% if @subscription_events.any? %>
<%= Spree.t(:email) %> |
<%= Spree.t(:plan) %> |
<%= Spree.t(:request_type) %> |
<%= Spree.t(:created_at) %> |
<% @subscription_events.each do |subscription_event|%>
<% plan = subscription_event.subscription.plan %>
<%= subscription_event.subscription.email %> |
<%= link_to plan.api_plan_id, edit_admin_recurring_plan_url(plan.recurring, plan) %> |
<%= subscription_event.request_type %> |
<%= subscription_event.created_at.try(:strftime, '%d-%h-%Y') %> |
<% end %>
<%= paginate @subscription_events %>
<% else %>
<%= Spree.t(:no_resource_found, resource: I18n.t(:other, scope: 'activerecord.models.spree/subscription_event')) %>
<% end %>