Adding button to order admin to reset digital downloads

* Resets expire time
* Resets download count
This commit is contained in:
Michael Bianco
2012-11-01 17:36:47 -04:00
parent 4dc2d9d54f
commit 23317eb0fb
4 changed files with 23 additions and 2 deletions

View File

@@ -0,0 +1,7 @@
Spree::Admin::OrdersController.class_eval do
def reset_digitals
@order.reset_digital_links!
flash[:notice] = t(:downloads_reset)
redirect_to admin_order_url(@order)
end
end

View File

@@ -0,0 +1,7 @@
Deface::Override.new(:virtual_path => "spree/admin/shared/_order_tabs",
:name => "add_reset_}digitals_to_admin_orders",
:insert_after => ".sidebar",
:text => %q{
<%= content_tag(:p, button_link_to(t(:reset_downloads), reset_digitals_admin_order_url(@order)), class: 'clear') if @order.digital? or true %>
},
:disabled => false)