effective_orders 2.1.8 → 2.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/admin/orders_controller.rb +14 -0
- data/app/models/effective/datatables/orders.rb +1 -1
- data/app/views/admin/orders/_actions.html.haml +5 -2
- data/app/views/effective/orders/_order_actions.html.haml +2 -1
- data/config/routes.rb +1 -1
- data/lib/effective_orders/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8856c89b4fe9a94251e4cf26f463f73206cfdff1
|
4
|
+
data.tar.gz: 557f83e8ad8e2c83a1fae4e9898472d9188c757a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: feb2f941ea0eb87892f58e9a6ef299f9274ff58ba5d545920b7b831bbc3036be3e5d06044753afa63b6544ffbffb01a880dd6ecb681a8c43d8fba1a7779d1aaf
|
7
|
+
data.tar.gz: 53cc8dc2d59ac523c333e1b3dd8856f857703f0cf72341dbeed60a1f32365366d3488b67c87443f3b1921d40b139d56855cfebf4fd95a7fc38052cfb71e35fc5
|
@@ -73,6 +73,20 @@ module Admin
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
+
def destroy
|
77
|
+
@order = Effective::Order.find(params[:id])
|
78
|
+
|
79
|
+
authorize_effective_order!
|
80
|
+
|
81
|
+
if @order.destroy
|
82
|
+
flash[:success] = 'Successfully deleted order'
|
83
|
+
else
|
84
|
+
flash[:danger] = "Unable to delete order: #{@order.errors.full_messages.to_sentence}"
|
85
|
+
end
|
86
|
+
|
87
|
+
redirect_to(effective_orders.admin_orders_path)
|
88
|
+
end
|
89
|
+
|
76
90
|
def mark_as_paid
|
77
91
|
@order = Effective::Order.find(params[:id])
|
78
92
|
@page_title = 'Mark as Paid'
|
@@ -52,7 +52,7 @@ if defined?(EffectiveDatatables)
|
|
52
52
|
|
53
53
|
table_column :total, as: :price
|
54
54
|
|
55
|
-
table_column :payment_provider, label: 'Provider', visible: false, filter: { values: ['nil'] + EffectiveOrders.payment_providers }
|
55
|
+
table_column :payment_provider, label: 'Provider', visible: false, filter: { values: ['nil'] + (EffectiveOrders.payment_providers + EffectiveOrders.other_payment_providers).sort }
|
56
56
|
table_column :payment_card, label: 'Card'
|
57
57
|
|
58
58
|
table_column :note, visible: false
|
@@ -1,6 +1,9 @@
|
|
1
|
+
= link_to (datatables_admin_path? ? effective_orders.admin_order_path(order) : effective_orders.order_path(order)), title: 'View' do
|
2
|
+
%span.glyphicon.glyphicon-eye-open
|
3
|
+
|
1
4
|
- if (order.purchased? == false) && (EffectiveOrders.authorized?(controller, :admin, :effective_orders) rescue false)
|
2
5
|
= link_to effective_orders.mark_as_paid_admin_order_path(order), title: 'Mark as Paid' do
|
3
6
|
%span.glyphicon.glyphicon-usd
|
4
7
|
|
5
|
-
= link_to
|
6
|
-
|
8
|
+
= link_to effective_orders.admin_order_path(order), title: 'Delete', data: { method: :delete, confirm: 'Are you sure you want to delete? This cannot be undone.' } do
|
9
|
+
%span.glyphicon.glyphicon-trash
|
@@ -7,4 +7,5 @@
|
|
7
7
|
|
8
8
|
- elsif (EffectiveOrders.authorized?(controller, :admin, :effective_orders) rescue false)
|
9
9
|
= link_to 'Admin: Mark as Paid', effective_orders.mark_as_paid_admin_order_path(order), class: 'btn btn-default'
|
10
|
-
= link_to 'Admin: Send Payment Request', effective_orders.send_payment_request_admin_order_path(order), class: 'btn btn-default', method: :post,
|
10
|
+
= link_to 'Admin: Send Payment Request', effective_orders.send_payment_request_admin_order_path(order), class: 'btn btn-default', data: { method: :post, confirm: 'This action will email buyer a payment request. Send it now?', disable_with: 'Sending...' }
|
11
|
+
= link_to 'Admin: Delete', effective_orders.admin_order_path(order), class: 'btn btn-default', data: { method: :delete, confirm: 'Are you sure you want to delete? This cannot be undone.', disable_with: 'Deleting...' }
|
data/config/routes.rb
CHANGED
@@ -64,7 +64,7 @@ EffectiveOrders::Engine.routes.draw do
|
|
64
64
|
if !EffectiveOrders.use_active_admin? || Rails.env.test?
|
65
65
|
namespace :admin do
|
66
66
|
resources :customers, only: [:index]
|
67
|
-
resources :orders,
|
67
|
+
resources :orders, except: [:edit] do
|
68
68
|
member do
|
69
69
|
get :mark_as_paid
|
70
70
|
post :mark_as_paid
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_orders
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|