From 1dd92d0133d55a053f54f48f12cb323aaa602787 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Tue, 23 Jul 2013 16:50:42 +1000 Subject: [PATCH] Move deface to a partial --- app/overrides/add_capture_order_shortcut.rb | 7 +------ app/views/spree/admin/orders/_capture.html.haml | 5 +++++ 2 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 app/views/spree/admin/orders/_capture.html.haml diff --git a/app/overrides/add_capture_order_shortcut.rb b/app/overrides/add_capture_order_shortcut.rb index 0fef9db5d4..f733d31531 100644 --- a/app/overrides/add_capture_order_shortcut.rb +++ b/app/overrides/add_capture_order_shortcut.rb @@ -1,12 +1,7 @@ Deface::Override.new(:virtual_path => "spree/admin/orders/index", :name => "add_capture_order_shortcut", :insert_bottom => "[data-hook='admin_orders_index_row_actions']", - #copied from backend / app / views / spree / admin / payments / _list.html.erb: - :text => '<% if ! order.payments.empty? %> - <% order.payments.last.actions.grep(/^capture$/).each do |action| %> - <%= link_to_with_icon "icon-#{action}", t(action), fire_admin_order_payment_path(order, order.payments.last, :e => action), :method => :put, :no_text => true, :data => {:action => action} %> - <% end %> - <% end %>' + :partial => 'spree/admin/orders/capture' ) #Resize columns to fit new button (note: this may break with a new version of spree) diff --git a/app/views/spree/admin/orders/_capture.html.haml b/app/views/spree/admin/orders/_capture.html.haml new file mode 100644 index 0000000000..80a7481066 --- /dev/null +++ b/app/views/spree/admin/orders/_capture.html.haml @@ -0,0 +1,5 @@ +-# copied from backend/app/views/spree/admin/payments/_list.html.erb + +- if order.payments.present? + - order.payments.last.actions.grep(/^capture$/).each do |action| + = link_to_with_icon "icon-#{action}", t(action), fire_admin_order_payment_path(order, order.payments.last, :e => action), :method => :put, :no_text => true, :data => {:action => action}