effective_orders 1.3.12 → 1.3.13
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8b46b9f926b8ab975a3e81e57164dc222f14a36
|
4
|
+
data.tar.gz: 4107592428dbfde1afe5247d6a813923f5a90f1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d65f51de361cb78dcc07dc27cae84ae0e11a1946240e5cf5bdb9638e2e7ba6482d8eda7156df9659304f1423ec6f2313515068ce7c0400b407f77897c0533d02
|
7
|
+
data.tar.gz: b2e93919ec0839a2cbb1b84e343cf3a0a0ce20c6b7b33adf0e08d046eb961bad72783afc44e0312c041011fb5881a53619ab0873380b897987763e8aea47abee
|
@@ -2,23 +2,25 @@ if defined?(EffectiveDatatables)
|
|
2
2
|
module Effective
|
3
3
|
module Datatables
|
4
4
|
class Customers < Effective::Datatable
|
5
|
-
|
5
|
+
datatable do
|
6
|
+
default_order :email, :asc
|
6
7
|
|
7
|
-
|
8
|
-
|
8
|
+
table_column :id, visible: false
|
9
|
+
table_column(:email, column: 'users.email') { |user| mail_to user.email, user.email }
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
if EffectiveOrders.stripe_enabled
|
12
|
+
table_column :stripe_customer_id
|
13
|
+
table_column :stripe_active_card
|
14
|
+
end
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
16
|
+
if EffectiveOrders.stripe_connect_enabled
|
17
|
+
table_column :stripe_connect_access_token
|
18
|
+
end
|
18
19
|
|
19
|
-
|
20
|
+
table_column :subscription_types, column: 'subscription_types'
|
20
21
|
|
21
|
-
|
22
|
+
table_column :actions, sortable: false, filter: false, partial: '/admin/customers/actions'
|
23
|
+
end
|
22
24
|
|
23
25
|
def collection
|
24
26
|
Effective::Customer.customers.uniq
|
@@ -2,43 +2,45 @@ if defined?(EffectiveDatatables)
|
|
2
2
|
module Effective
|
3
3
|
module Datatables
|
4
4
|
class OrderItems < Effective::Datatable
|
5
|
-
|
5
|
+
datatable do
|
6
|
+
default_order :purchased_at, :desc
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
8
|
+
table_column(:purchased_at, :type => :datetime, :column => 'orders.purchased_at') do |order_item|
|
9
|
+
Time.at(order_item[:purchased_at]).in_time_zone if order_item[:purchased_at].present?
|
10
|
+
end
|
10
11
|
|
11
|
-
|
12
|
+
table_column :id, :visible => false
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
table_column(:order, :type => :obfuscated_id, :sortable => false) do |order_item|
|
15
|
+
obfuscated_id = Effective::Order.obfuscate(order_item[:order_id])
|
16
|
+
link_to(obfuscated_id, (datatables_admin_path? ? effective_orders.admin_order_path(obfuscated_id) : effective_orders.order_path(obfuscated_id)))
|
17
|
+
end
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
table_column :email, column: 'users.email', label: 'Buyer Email', if: proc { attributes[:user_id].blank? } do |order_item|
|
20
|
+
link_to order_item[:email], (edit_admin_user_path(order_item[:user_id]) rescue admin_user_path(order_item[:user_id]) rescue '#')
|
21
|
+
end
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
23
|
+
if EffectiveOrders.require_billing_address
|
24
|
+
table_column :buyer_name, sortable: false, label: 'Buyer Name', if: proc { attributes[:user_id].blank? } do |order_item|
|
25
|
+
(order_item[:buyer_name] || '').split('!!SEP!!').find(&:present?)
|
26
|
+
end
|
25
27
|
end
|
26
|
-
end
|
27
28
|
|
28
|
-
|
29
|
-
|
30
|
-
|
29
|
+
table_column :purchase_state, column: 'orders.purchase_state', filter: { type: :select, values: [%w(abandoned abandoned), [EffectiveOrders::PURCHASED, EffectiveOrders::PURCHASED], [EffectiveOrders::DECLINED, EffectiveOrders::DECLINED]], selected: EffectiveOrders::PURCHASED } do |order_item|
|
30
|
+
order_item[:purchase_state] || 'abandoned'
|
31
|
+
end
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
33
|
+
table_column :title do |order_item|
|
34
|
+
order_item.quantity == 1 ? order_item.title : "#{order_item.title} (#{order_item.quantity} purchased)"
|
35
|
+
end
|
35
36
|
|
36
|
-
|
37
|
-
|
38
|
-
|
37
|
+
table_column(:subtotal) { |order_item| price_to_currency(order_item[:subtotal].to_i) }
|
38
|
+
table_column(:tax) { |order_item| price_to_currency(order_item[:tax].to_i) }
|
39
|
+
table_column(:total) { |order_item| price_to_currency(order_item[:total].to_i) }
|
39
40
|
|
40
|
-
|
41
|
-
|
41
|
+
table_column :created_at, :visible => false
|
42
|
+
table_column :updated_at, :visible => false
|
43
|
+
end
|
42
44
|
|
43
45
|
def collection
|
44
46
|
collection = Effective::OrderItem.unscoped
|
@@ -2,38 +2,40 @@ if defined?(EffectiveDatatables)
|
|
2
2
|
module Effective
|
3
3
|
module Datatables
|
4
4
|
class Orders < Effective::Datatable
|
5
|
-
|
5
|
+
datatable do
|
6
|
+
default_order :purchased_at, :desc
|
6
7
|
|
7
|
-
|
8
|
-
|
8
|
+
table_column :purchased_at
|
9
|
+
table_column :id
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
table_column :email, column: 'users.email', label: 'Buyer Email', if: proc { attributes[:user_id].blank? } do |order|
|
12
|
+
link_to order[:email], (edit_admin_user_path(order.user_id) rescue admin_user_path(order.user_id) rescue '#')
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
if EffectiveOrders.require_billing_address
|
16
|
+
table_column :buyer_name, sortable: false, label: 'Buyer Name', if: proc { attributes[:user_id].blank? } do |order|
|
17
|
+
(order[:buyer_name] || '').split('!!SEP!!').find(&:present?)
|
18
|
+
end
|
17
19
|
end
|
18
|
-
end
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
21
|
+
table_column :purchase_state, filter: { type: :select, values: [%w(abandoned abandoned), [EffectiveOrders::PURCHASED, EffectiveOrders::PURCHASED], [EffectiveOrders::DECLINED, EffectiveOrders::DECLINED]], selected: EffectiveOrders::PURCHASED } do |order|
|
22
|
+
order.purchase_state || 'abandoned'
|
23
|
+
end
|
23
24
|
|
24
|
-
|
25
|
-
|
26
|
-
|
25
|
+
table_column :order_items, sortable: false, column: 'order_items.title' do |order|
|
26
|
+
content_tag(:ul) do
|
27
|
+
(order[:order_items] || '').split('!!SEP!!').map { |oi| content_tag(:li, oi) }.join.html_safe
|
28
|
+
end
|
27
29
|
end
|
28
|
-
end
|
29
30
|
|
30
|
-
|
31
|
+
table_column(:total) { |order| price_to_currency(order[:total].to_i) }
|
31
32
|
|
32
|
-
|
33
|
-
|
33
|
+
table_column :created_at, :visible => false
|
34
|
+
table_column :updated_at, :visible => false
|
34
35
|
|
35
|
-
|
36
|
-
|
36
|
+
table_column :actions, sortable: false, filter: false do |order|
|
37
|
+
link_to('View', (datatables_admin_path? ? effective_orders.admin_order_path(order) : effective_orders.order_path(order)))
|
38
|
+
end
|
37
39
|
end
|
38
40
|
|
39
41
|
def collection
|
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: 1.3.
|
4
|
+
version: 1.3.13
|
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: 2015-07-
|
11
|
+
date: 2015-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: 2.0.0
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: 2.0.0
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: effective_obfuscation
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|