summaryrefslogtreecommitdiff
path: root/app/views/spree/admin/subscription_orders/index.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/spree/admin/subscription_orders/index.html.erb')
-rw-r--r--app/views/spree/admin/subscription_orders/index.html.erb93
1 files changed, 93 insertions, 0 deletions
diff --git a/app/views/spree/admin/subscription_orders/index.html.erb b/app/views/spree/admin/subscription_orders/index.html.erb
new file mode 100644
index 0000000..2366e56
--- /dev/null
+++ b/app/views/spree/admin/subscription_orders/index.html.erb
@@ -0,0 +1,93 @@
+<% content_for(:page_title, t('.title')) %>
+
+<%= render 'spree/admin/shared/subscription_breadcrumbs', subscription: @subscription %>
+<%= render 'spree/admin/shared/subscription_sidebar', subscription: @subscription %>
+<%= render 'spree/admin/shared/subscription_tabs', current: :orders, subscription: @subscription %>
+<%= render 'spree/admin/shared/subscription_actions', subscription: @subscription %>
+
+<% content_for :table_filter_title do %>
+ <%= t('spree.filter') %>
+<% end %>
+
+<% content_for :table_filter do %>
+ <div data-hook="admin_orders_index_search">
+ <%= search_form_for [:admin, @search], url: admin_subscription_subscription_orders_path(@subscription) do |f| %>
+ <div class="row">
+ <div class="field-block col-12 col-md-6 col-lg-8">
+ <div class="date-range-filter field">
+ <%= label_tag :q_created_at_gt, t('spree.date_range') %>
+ <div class="date-range-fields input-group">
+ <%= f.text_field :created_at_gt, class: 'datepicker form-control datepicker-from', placeholder: t('spree.start') %>
+
+ <div class="input-group-prepend input-group-append">
+ <span class="input-group-text range-divider">
+ <i class="fa fa-arrow-right"></i>
+ </span>
+ </div>
+
+ <%= f.text_field :created_at_lt, class: 'datepicker form-control datepicker-to', placeholder: t('spree.stop') %>
+ </div>
+ </div>
+ </div>
+ <div class="field-block col-12 col-md-6 col-lg-4">
+ <div class="field">
+ <%= label_tag :q_state_eq, t('spree.status') %>
+ <%= f.select :state_eq, Spree::Order.state_machines[:state].states.collect {|s| [t(s.name, scope: 'spree.order_state'), s.value]}, {include_blank: true}, class: 'custom-select fullwidth' %>
+ </div>
+ </div>
+ </div>
+
+ <div class="clearfix"></div>
+
+ <div class="actions filter-actions">
+ <div data-hook="admin_orders_index_search_buttons">
+ <%= button_tag t('spree.filter_results'), class: 'btn btn-primary' %>
+ </div>
+ </div>
+ <% end %>
+ </div>
+<% end %>
+
+<fieldset class="no-border-bottom">
+ <legend><%= t('spree.admin.subscription_orders.index.title') %></legend>
+
+ <%= paginate @subscription_orders, theme: 'solidus_admin' %>
+
+ <% if @subscription_orders.any? %>
+ <table id="listing_subscription_orders" class="index">
+ <thead>
+ <tr data-hook="admin_subscription_orders_index_headers">
+ <th><%= sort_link @search, :created_at %></th>
+ <th><%= sort_link @search, :number %></th>
+ <th><%= sort_link @search, :state %></th>
+ <th class="align-right"><%= sort_link @search, :total %></th>
+ <th data-hook="admin_orders_index_header_actions" class="actions"></th>
+ </tr>
+ </thead>
+
+ <tbody>
+ <% @subscription_orders.each do |order| %>
+ <tr class="admin_subscription_order">
+ <td><%= l order.created_at.to_date %></td>
+ <td><%= link_to order.number, edit_admin_order_path(order) %></td>
+ <td>
+ <span class="pill pill-<%= order.state %>">
+ <%= t(order.state, scope: 'spree.order_state') %>
+ </span>
+ </td>
+ <td class="align-right"><%= order.display_total.to_html %></td>
+ <td class='actions align-center' data-hook="admin_orders_index_row_actions">
+ <%= link_to_edit_url edit_admin_order_path(order), title: "admin_edit_#{dom_id(order)}", no_text: true %>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ <% else %>
+ <div class="no-objects-found">
+ <%= render 'spree/admin/shared/no_objects_found', resource: Spree::Order %>
+ </div>
+ <% end %>
+
+ <%= paginate @subscription_orders, theme: 'solidus_admin' %>
+</fieldset>