From 980c46c63fdb1232e33f17ca73e8ab5df7ad253c Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 11 Sep 2018 11:22:54 +0100 Subject: [PATCH 01/11] Convert Spree view to HAML --- app/views/spree/admin/orders/index.html.haml | 91 ++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 app/views/spree/admin/orders/index.html.haml diff --git a/app/views/spree/admin/orders/index.html.haml b/app/views/spree/admin/orders/index.html.haml new file mode 100644 index 0000000000..0eb540f349 --- /dev/null +++ b/app/views/spree/admin/orders/index.html.haml @@ -0,0 +1,91 @@ +- 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' +- 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) + .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%"} + %colgroup + %col{style: "width: 16%;"} + %col{style: "width: 10%;"} + %col{style: "width: 13%;"} + %col{style: "width: 13%;"} + %col{style: "width: 13%;"} + %col{style: "width: 17%;"} + %col{style: "width: 10%;"} + %col{style: "width: 8%;"} + %thead + %tr{"data-hook" => "admin_orders_index_headers"} + - 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= l (@show_only_completed ? order.completed_at : order.created_at).to_date + %td= link_to order.number, admin_order_path(order) + %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.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 +- else + .no-objects-found + = t(:no_orders_found) += paginate @orders \ No newline at end of file From 5a2491cb47d9b8b96f8c901343618b9402b87616 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 11 Sep 2018 11:30:14 +0100 Subject: [PATCH 02/11] Apply ng-app override --- app/overrides/spree/admin/orders/index/set_ng_app.deface | 2 -- app/views/spree/admin/orders/index.html.haml | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 app/overrides/spree/admin/orders/index/set_ng_app.deface diff --git a/app/overrides/spree/admin/orders/index/set_ng_app.deface b/app/overrides/spree/admin/orders/index/set_ng_app.deface deleted file mode 100644 index 9ca071be11..0000000000 --- a/app/overrides/spree/admin/orders/index/set_ng_app.deface +++ /dev/null @@ -1,2 +0,0 @@ -add_to_attributes "table#listing_orders" -attributes "ng-app" => "ofn.admin" diff --git a/app/views/spree/admin/orders/index.html.haml b/app/views/spree/admin/orders/index.html.haml index 0eb540f349..bd38bfbf5a 100644 --- a/app/views/spree/admin/orders/index.html.haml +++ b/app/views/spree/admin/orders/index.html.haml @@ -47,7 +47,7 @@ %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%"} + %table#listing_orders.index.responsive{"data-hook" => "", width: "100%", "ng-app" => "ofn.admin"} %colgroup %col{style: "width: 16%;"} %col{style: "width: 10%;"} From c7e2f817ed0e9b2a873a186e27a3a9bb1a4c8cec Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 11 Sep 2018 11:34:34 +0100 Subject: [PATCH 03/11] Apply colgroup override --- .../admin/orders/index/rearrange_cols.html.haml.deface | 5 ----- app/views/spree/admin/orders/index.html.haml | 9 +-------- 2 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 app/overrides/spree/admin/orders/index/rearrange_cols.html.haml.deface diff --git a/app/overrides/spree/admin/orders/index/rearrange_cols.html.haml.deface b/app/overrides/spree/admin/orders/index/rearrange_cols.html.haml.deface deleted file mode 100644 index 39344b460e..0000000000 --- a/app/overrides/spree/admin/orders/index/rearrange_cols.html.haml.deface +++ /dev/null @@ -1,5 +0,0 @@ -/ replace_contents "table#listing_orders colgroup" --# See also: add_capture_order_shortcut, admin/orders/index/add_distributor_*to_admin_orders - -%col{style: "width: 10%"} --# There are 8 other columns, but they seem to sort themselves out :) diff --git a/app/views/spree/admin/orders/index.html.haml b/app/views/spree/admin/orders/index.html.haml index bd38bfbf5a..1cc9bfc8a8 100644 --- a/app/views/spree/admin/orders/index.html.haml +++ b/app/views/spree/admin/orders/index.html.haml @@ -49,14 +49,7 @@ - unless @orders.empty? %table#listing_orders.index.responsive{"data-hook" => "", width: "100%", "ng-app" => "ofn.admin"} %colgroup - %col{style: "width: 16%;"} - %col{style: "width: 10%;"} - %col{style: "width: 13%;"} - %col{style: "width: 13%;"} - %col{style: "width: 13%;"} - %col{style: "width: 17%;"} - %col{style: "width: 10%;"} - %col{style: "width: 8%;"} + %col{style: "width: 10%"} %thead %tr{"data-hook" => "admin_orders_index_headers"} - if @show_only_completed From 1958ac9932140d669370907cb589ea7bd5724c72 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 11 Sep 2018 11:39:05 +0100 Subject: [PATCH 04/11] Apply distributor filter inputs override --- ...r_and_order_cycle_filter_inputs.html.haml.deface | 13 ------------- app/views/spree/admin/orders/index.html.haml | 11 +++++++++++ 2 files changed, 11 insertions(+), 13 deletions(-) delete mode 100644 app/overrides/spree/admin/orders/index/add_distributor_and_order_cycle_filter_inputs.html.haml.deface diff --git a/app/overrides/spree/admin/orders/index/add_distributor_and_order_cycle_filter_inputs.html.haml.deface b/app/overrides/spree/admin/orders/index/add_distributor_and_order_cycle_filter_inputs.html.haml.deface deleted file mode 100644 index 7068d94d2d..0000000000 --- a/app/overrides/spree/admin/orders/index/add_distributor_and_order_cycle_filter_inputs.html.haml.deface +++ /dev/null @@ -1,13 +0,0 @@ -/ insert_before "div.clearfix" - -.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.alpha.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}) diff --git a/app/views/spree/admin/orders/index.html.haml b/app/views/spree/admin/orders/index.html.haml index 1cc9bfc8a8..cfe3b3c2d9 100644 --- a/app/views/spree/admin/orders/index.html.haml +++ b/app/views/spree/admin/orders/index.html.haml @@ -42,6 +42,17 @@ %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.alpha.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"} From 6389c552ca80daefa703a98140ed5a11341ae0a0 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 11 Sep 2018 11:41:25 +0100 Subject: [PATCH 05/11] Apply distributor th override --- .../admin/orders/index/add_distributor_th.html.haml.deface | 4 ---- app/views/spree/admin/orders/index.html.haml | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) delete mode 100644 app/overrides/spree/admin/orders/index/add_distributor_th.html.haml.deface diff --git a/app/overrides/spree/admin/orders/index/add_distributor_th.html.haml.deface b/app/overrides/spree/admin/orders/index/add_distributor_th.html.haml.deface deleted file mode 100644 index bba71ef434..0000000000 --- a/app/overrides/spree/admin/orders/index/add_distributor_th.html.haml.deface +++ /dev/null @@ -1,4 +0,0 @@ -/ insert_top "[data-hook='admin_orders_index_headers']" - -%th - = t(:products_distributor) diff --git a/app/views/spree/admin/orders/index.html.haml b/app/views/spree/admin/orders/index.html.haml index cfe3b3c2d9..54ff656939 100644 --- a/app/views/spree/admin/orders/index.html.haml +++ b/app/views/spree/admin/orders/index.html.haml @@ -63,6 +63,8 @@ %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 From ba0701457e4a40407fab11bcfa4ade04ccf8d6d8 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 11 Sep 2018 11:42:08 +0100 Subject: [PATCH 06/11] Apply distributor td override --- .../admin/orders/index/add_distributor_td.html.haml.deface | 4 ---- app/views/spree/admin/orders/index.html.haml | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) delete mode 100644 app/overrides/spree/admin/orders/index/add_distributor_td.html.haml.deface diff --git a/app/overrides/spree/admin/orders/index/add_distributor_td.html.haml.deface b/app/overrides/spree/admin/orders/index/add_distributor_td.html.haml.deface deleted file mode 100644 index 5d9b7ab083..0000000000 --- a/app/overrides/spree/admin/orders/index/add_distributor_td.html.haml.deface +++ /dev/null @@ -1,4 +0,0 @@ -/ insert_top "[data-hook='admin_orders_index_rows']" - -%td.align-center - = order.distributor.andand.name diff --git a/app/views/spree/admin/orders/index.html.haml b/app/views/spree/admin/orders/index.html.haml index 54ff656939..1bb334e4ad 100644 --- a/app/views/spree/admin/orders/index.html.haml +++ b/app/views/spree/admin/orders/index.html.haml @@ -79,6 +79,8 @@ %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) %td.align-center From 8f174b130861432753e75d0e9edf2b7dd21b3d77 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 11 Sep 2018 11:43:38 +0100 Subject: [PATCH 07/11] Apply ship shortcut override --- .../admin/orders/index/add_ship_shortcut.html.haml.deface | 6 ------ app/views/spree/admin/orders/index.html.haml | 3 +++ 2 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 app/overrides/spree/admin/orders/index/add_ship_shortcut.html.haml.deface diff --git a/app/overrides/spree/admin/orders/index/add_ship_shortcut.html.haml.deface b/app/overrides/spree/admin/orders/index/add_ship_shortcut.html.haml.deface deleted file mode 100644 index a0ac8a7266..0000000000 --- a/app/overrides/spree/admin/orders/index/add_ship_shortcut.html.haml.deface +++ /dev/null @@ -1,6 +0,0 @@ -/ insert_bottom "[data-hook='admin_orders_index_row_actions']" --# See also: app/overrides/add_capture_order_shortcut.rb - -- 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)} diff --git a/app/views/spree/admin/orders/index.html.haml b/app/views/spree/admin/orders/index.html.haml index 1bb334e4ad..adfe35ee38 100644 --- a/app/views/spree/admin/orders/index.html.haml +++ b/app/views/spree/admin/orders/index.html.haml @@ -93,6 +93,9 @@ %td.align-center= order.display_total.to_html %td.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 + - 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)} - else .no-objects-found = t(:no_orders_found) From afedaea2b52aea121754ac4d263a3c737b1d3811 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 11 Sep 2018 11:45:40 +0100 Subject: [PATCH 08/11] Apply special instructions override --- .../orders/index/add_special_instructions.html.haml.deface | 6 ------ app/views/spree/admin/orders/index.html.haml | 7 ++++++- 2 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 app/overrides/spree/admin/orders/index/add_special_instructions.html.haml.deface diff --git a/app/overrides/spree/admin/orders/index/add_special_instructions.html.haml.deface b/app/overrides/spree/admin/orders/index/add_special_instructions.html.haml.deface deleted file mode 100644 index 1711343f3c..0000000000 --- a/app/overrides/spree/admin/orders/index/add_special_instructions.html.haml.deface +++ /dev/null @@ -1,6 +0,0 @@ -/ insert_bottom "[data-hook='admin_orders_index_rows'] td:nth-child(3)" - -- if order.special_instructions.present? - %br - %span{class: "icon-warning-sign", "ofn-with-tip" => order.special_instructions} - notes diff --git a/app/views/spree/admin/orders/index.html.haml b/app/views/spree/admin/orders/index.html.haml index adfe35ee38..8c76fe630a 100644 --- a/app/views/spree/admin/orders/index.html.haml +++ b/app/views/spree/admin/orders/index.html.haml @@ -82,7 +82,12 @@ %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) + %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 From 507f4d08789167b40c3cde21b08c1175974092d9 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 11 Sep 2018 11:53:37 +0100 Subject: [PATCH 09/11] OCD tidy up of visually misaligned filter --- app/views/spree/admin/orders/index.html.haml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/views/spree/admin/orders/index.html.haml b/app/views/spree/admin/orders/index.html.haml index 8c76fe630a..507fedc8fc 100644 --- a/app/views/spree/admin/orders/index.html.haml +++ b/app/views/spree/admin/orders/index.html.haml @@ -47,8 +47,7 @@ = 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.alpha.eight.columns + .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]), From f08d6389d8b1801e14f05c3ab5190fbccdd36d37 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 11 Sep 2018 12:06:58 +0100 Subject: [PATCH 10/11] Apply capture order override --- app/assets/stylesheets/admin/orders.css.scss | 4 ++++ app/overrides/add_capture_order_shortcut.rb | 11 ----------- app/views/spree/admin/orders/index.html.haml | 3 ++- 3 files changed, 6 insertions(+), 12 deletions(-) delete mode 100644 app/overrides/add_capture_order_shortcut.rb diff --git a/app/assets/stylesheets/admin/orders.css.scss b/app/assets/stylesheets/admin/orders.css.scss index 46e6b8aa0f..33c5a4a3e8 100644 --- a/app/assets/stylesheets/admin/orders.css.scss +++ b/app/assets/stylesheets/admin/orders.css.scss @@ -87,3 +87,7 @@ div#group_buy_calculation { th.actions { white-space: nowrap; } + +table.index td.actions { + text-align: left; +} diff --git a/app/overrides/add_capture_order_shortcut.rb b/app/overrides/add_capture_order_shortcut.rb deleted file mode 100644 index db6947cf08..0000000000 --- a/app/overrides/add_capture_order_shortcut.rb +++ /dev/null @@ -1,11 +0,0 @@ -Deface::Override.new(:virtual_path => "spree/admin/orders/index", - :name => "add_capture_order_shortcut", - :insert_bottom => "[data-hook='admin_orders_index_row_actions']", - :partial => 'spree/admin/orders/capture' - ) -# And align actions column (not spree standard, but looks better IMO) -Deface::Override.new(:virtual_path => "spree/admin/orders/index", - :name => "add_capture_order_shortcut_align", - :set_attributes => "[data-hook='admin_orders_index_row_actions']", - :attributes => {:class => "actions", :style => "text-align:left;"} #removes 'align-center' class - ) diff --git a/app/views/spree/admin/orders/index.html.haml b/app/views/spree/admin/orders/index.html.haml index 507fedc8fc..dae0c47089 100644 --- a/app/views/spree/admin/orders/index.html.haml +++ b/app/views/spree/admin/orders/index.html.haml @@ -95,11 +95,12 @@ %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.align-center{"data-hook" => "admin_orders_index_row_actions"} + %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) From 4d9ebf0550ae2e1eabee4e62f43eca9ec7cfb3fc Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 11 Sep 2018 12:17:28 +0100 Subject: [PATCH 11/11] Apply submenu override --- app/overrides/add_orders_admin_sub_menu.rb | 4 ---- app/views/spree/admin/orders/index.html.haml | 5 ++++- 2 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 app/overrides/add_orders_admin_sub_menu.rb diff --git a/app/overrides/add_orders_admin_sub_menu.rb b/app/overrides/add_orders_admin_sub_menu.rb deleted file mode 100644 index ff26145421..0000000000 --- a/app/overrides/add_orders_admin_sub_menu.rb +++ /dev/null @@ -1,4 +0,0 @@ -Deface::Override.new(:virtual_path => "spree/admin/orders/index", - :name => "add_orders_admin_sub_menu", - :insert_before => "code[erb-silent]:contains('content_for :table_filter_title do')", - :text => "<%= render :partial => 'spree/admin/shared/order_sub_menu' %>") diff --git a/app/views/spree/admin/orders/index.html.haml b/app/views/spree/admin/orders/index.html.haml index dae0c47089..3b233424cc 100644 --- a/app/views/spree/admin/orders/index.html.haml +++ b/app/views/spree/admin/orders/index.html.haml @@ -3,6 +3,7 @@ - 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 @@ -56,6 +57,7 @@ .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 @@ -104,4 +106,5 @@ - else .no-objects-found = t(:no_orders_found) -= paginate @orders \ No newline at end of file + += paginate @orders