-
-
Notifications
You must be signed in to change notification settings - Fork 731
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2675 from Matt-Yorkley/bi/remake_views
Remake orders index view
- Loading branch information
Showing
11 changed files
with
114 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,3 +87,7 @@ div#group_buy_calculation { | |
th.actions { | ||
white-space: nowrap; | ||
} | ||
|
||
table.index td.actions { | ||
text-align: left; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
...s/spree/admin/orders/index/add_distributor_and_order_cycle_filter_inputs.html.haml.deface
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
app/overrides/spree/admin/orders/index/add_distributor_td.html.haml.deface
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
app/overrides/spree/admin/orders/index/add_distributor_th.html.haml.deface
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
app/overrides/spree/admin/orders/index/add_ship_shortcut.html.haml.deface
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
app/overrides/spree/admin/orders/index/add_special_instructions.html.haml.deface
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
app/overrides/spree/admin/orders/index/rearrange_cols.html.haml.deface
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
- content_for :page_title do | ||
= t(:listing_orders) | ||
- content_for :page_actions do | ||
%li | ||
= button_link_to t(:new_order), new_admin_order_url, :icon => 'icon-plus', :id => 'admin_new_order' | ||
= render partial: 'spree/admin/shared/order_sub_menu' | ||
- content_for :table_filter_title do | ||
= t(:search) | ||
- content_for :table_filter do | ||
%div{"data-hook" => "admin_orders_index_search"} | ||
= search_form_for [:admin, @search] do |f| | ||
.field-block.alpha.four.columns | ||
.date-range-filter.field | ||
= label_tag nil, t(:date_range) | ||
.date-range-fields | ||
= f.text_field :created_at_gt, :class => 'datepicker datepicker-from', :value => params[:q][:created_at_gt], :placeholder => t(:start) | ||
%span.range-divider | ||
%i.icon-arrow-right | ||
= f.text_field :created_at_lt, :class => 'datepicker datepicker-to', :value => params[:q][:created_at_lt], :placeholder => t(:stop) | ||
.field | ||
= label_tag nil, t(:status) | ||
= f.select :state_eq, Spree::Order.state_machines[:state].states.collect {|s| [t("order_state.#{s.name}"), s.value]}, {:include_blank => true}, :class => 'select2' | ||
.four.columns | ||
.field | ||
= label_tag nil, t(:order_number) | ||
= f.text_field :number_cont | ||
.field | ||
= label_tag nil, t(:email) | ||
= f.email_field :email_cont | ||
.four.columns | ||
.field | ||
= label_tag nil, t(:first_name_begins_with) | ||
= f.text_field :bill_address_firstname_start, :size => 25 | ||
.field | ||
= label_tag nil, t(:last_name_begins_with) | ||
= f.text_field :bill_address_lastname_start, :size => 25 | ||
.omega.four.columns | ||
.field.checkbox | ||
%label | ||
= f.check_box :completed_at_not_null, {:checked => @show_only_completed}, '1', '' | ||
= t(:show_only_complete_orders) | ||
.field.checkbox | ||
%label | ||
= f.check_box :inventory_units_shipment_id_null, { }, '1', '0' | ||
= t(:show_only_unfulfilled_orders) | ||
.field-block.alpha.eight.columns | ||
= label_tag nil, t(:distributors) | ||
= select_tag("q[distributor_id_in]", | ||
options_for_select(Enterprise.is_distributor.managed_by(spree_current_user).map {|e| [e.name, e.id]}, params[:distributor_ids]), | ||
{class: "select2 fullwidth", multiple: true}) | ||
.field-block.omega.eight.columns | ||
= label_tag nil, t(:order_cycles) | ||
= select_tag("q[order_cycle_id_in]", | ||
options_for_select(OrderCycle.managed_by(spree_current_user).where('order_cycles.orders_close_at is not null').order('order_cycles.orders_close_at DESC').map {|oc| [oc.name, oc.id]}, params[:order_cycle_ids]), | ||
{class: "select2 fullwidth", multiple: true}) | ||
.clearfix | ||
.actions.filter-actions | ||
%div{"data-hook" => "admin_orders_index_search_buttons"} | ||
= button t(:filter_results), 'icon-search' | ||
- unless @orders.empty? | ||
%table#listing_orders.index.responsive{"data-hook" => "", width: "100%", "ng-app" => "ofn.admin"} | ||
%colgroup | ||
%col{style: "width: 10%"} | ||
%thead | ||
%tr{"data-hook" => "admin_orders_index_headers"} | ||
%th | ||
= t(:products_distributor) | ||
- if @show_only_completed | ||
%th= sort_link @search, :completed_at, t(:completed_at, :scope => 'activerecord.attributes.spree/order') | ||
- else | ||
%th= sort_link @search, :created_at, t(:created_at, :scope => 'activerecord.attributes.spree/order') | ||
%th= sort_link @search, :number, t(:number, :scope => 'activerecord.attributes.spree/order') | ||
%th= sort_link @search, :state, t(:state, :scope => 'activerecord.attributes.spree/order') | ||
%th= sort_link @search, :payment_state, t(:payment_state, :scope => 'activerecord.attributes.spree/order') | ||
%th= sort_link @search, :shipment_state, t(:shipment_state, :scope => 'activerecord.attributes.spree/order') | ||
%th= sort_link @search, :email, t(:email, :scope => 'activerecord.attributes.spree/order') | ||
%th= sort_link @search, :total, t(:total, :scope => 'activerecord.attributes.spree/order') | ||
%th.actions{"data-hook" => "admin_orders_index_header_actions"} | ||
%tbody | ||
- @orders.each do |order| | ||
%tr{class: "state-#{order.state.downcase} #{cycle('odd', 'even')}", "data-hook" => "admin_orders_index_rows"} | ||
%td.align-center | ||
= order.distributor.andand.name | ||
%td.align-center= l (@show_only_completed ? order.completed_at : order.created_at).to_date | ||
%td | ||
= link_to order.number, admin_order_path(order) | ||
- if order.special_instructions.present? | ||
%br | ||
%span{class: "icon-warning-sign", "ofn-with-tip" => order.special_instructions} | ||
notes | ||
%td.align-center | ||
%span{class: "state #{order.state.downcase}"}= t("order_state.#{order.state.downcase}") | ||
%td.align-center | ||
%span{class: "state #{order.payment_state}"}= link_to t("payment_states.#{order.payment_state}"), admin_order_payments_path(order) if order.payment_state | ||
%td.align-center | ||
%span{class: "state #{order.shipment_state}"}= link_to t("shipment_states.#{order.shipment_state}"), admin_order_shipments_path(order) if order.shipment_state | ||
%td= mail_to order.email | ||
%td.align-center= order.display_total.to_html | ||
%td.actions{"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 | ||
- if order.ready_to_ship? | ||
- # copied from backend/app/views/spree/admin/payments/_list.html.erb | ||
= link_to_with_icon "icon-road", t('admin.orders.index.ship'), fire_admin_order_url(order, :e => 'ship'), :method => :put, :no_text => true, :data => {:action => 'ship', :confirm => t(:are_you_sure)} | ||
= render partial: 'spree/admin/orders/capture', locals: {order: order} | ||
- else | ||
.no-objects-found | ||
= t(:no_orders_found) | ||
|
||
= paginate @orders |