effective_products 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/effective_products_helper.rb +0 -1
- data/app/models/concerns/effective_products_ring_wizard.rb +1 -16
- data/app/models/effective/ring.rb +0 -12
- data/app/views/effective/ring_wizards/_ring.html.haml +34 -27
- data/app/views/effective/ring_wizards/_ring_wizard.html.haml +1 -6
- data/app/views/effective/ring_wizards/submitted.html.haml +1 -0
- data/lib/effective_products/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57266684ebdd641086150769be175ade40a9fb2761655a9d0c83ee04c233b750
|
4
|
+
data.tar.gz: 7770a4aaebaaf1048c5ef8cba5a4b56c6bd791a39402ff2877464407a6e5019f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30d1a478d0569578fb665ad6dcbee2c3c6c59cb14f1222fac9c123c60526fb35cb7acf3ac9c2dc48d6a141db56bd491646f31a70cfed4acd6142eac00bc2a728
|
7
|
+
data.tar.gz: f2b66599466397300d83108fbe6c0ce3584c023fcf54b6db260754c338c873af36f259e12dbdadd752ae175597e6426aa5bd51645fa49c8932ce0135a9ef4846
|
@@ -15,14 +15,6 @@ module EffectiveProductsRingWizard
|
|
15
15
|
|
16
16
|
module ClassMethods
|
17
17
|
def effective_products_ring_wizard?; true; end
|
18
|
-
|
19
|
-
def all_wizard_steps
|
20
|
-
const_get(:WIZARD_STEPS).keys
|
21
|
-
end
|
22
|
-
|
23
|
-
def required_wizard_steps
|
24
|
-
[:start, :billing, :checkout, :submitted]
|
25
|
-
end
|
26
18
|
end
|
27
19
|
|
28
20
|
included do
|
@@ -117,14 +109,7 @@ module EffectiveProductsRingWizard
|
|
117
109
|
end
|
118
110
|
|
119
111
|
def build_ring
|
120
|
-
ring = rings.build(
|
121
|
-
owner: owner,
|
122
|
-
first_name: owner.try(:first_name),
|
123
|
-
last_name: owner.try(:last_name),
|
124
|
-
email: owner.try(:email),
|
125
|
-
phone: owner.try(:phone)
|
126
|
-
)
|
127
|
-
|
112
|
+
ring = rings.build(owner: owner)
|
128
113
|
address = owner.try(:shipping_address) || owner.try(:billing_address)
|
129
114
|
|
130
115
|
if address.present?
|
@@ -53,17 +53,5 @@ module Effective
|
|
53
53
|
issued_at.present?
|
54
54
|
end
|
55
55
|
|
56
|
-
# This is the Admin Save and Mark Paid action
|
57
|
-
def mark_paid!
|
58
|
-
raise('expected a blank ring payment') if ring_wizard.present?
|
59
|
-
|
60
|
-
save!
|
61
|
-
|
62
|
-
order = Effective::Order.new(items: self, user: owner)
|
63
|
-
order.purchase!(skip_buyer_validations: true, email: false)
|
64
|
-
|
65
|
-
true
|
66
|
-
end
|
67
|
-
|
68
56
|
end
|
69
57
|
end
|
@@ -1,33 +1,40 @@
|
|
1
|
-
|
2
|
-
-
|
3
|
-
|
1
|
+
.card
|
2
|
+
.card-body
|
3
|
+
.row
|
4
|
+
.col-sm
|
5
|
+
%h5.card-title= ring_wizard.wizard_step_title(:ring)
|
6
|
+
.col-sm-auto.text-right
|
7
|
+
= link_to('Edit', wizard_path(:ring)) if edit_effective_wizard?
|
4
8
|
|
5
|
-
|
6
|
-
|
7
|
-
%tr
|
8
|
-
%th Owner
|
9
|
-
%td
|
10
|
-
= owner.to_s
|
11
|
-
- if owner.try(:email).present?
|
12
|
-
%br
|
13
|
-
= mail_to(owner.email)
|
9
|
+
- ring = ring_wizard.ring
|
10
|
+
- owner = ring_wizard.owner
|
14
11
|
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
%table.table.table-sm
|
13
|
+
%tbody
|
14
|
+
%tr
|
15
|
+
%th Owner
|
16
|
+
%td
|
17
|
+
= owner.to_s
|
18
|
+
- if owner.try(:email).present?
|
19
|
+
%br
|
20
|
+
= mail_to(owner.email)
|
18
21
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
+
- if owner.try(:phone).present?
|
23
|
+
%br
|
24
|
+
= owner.phone
|
22
25
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
+
- if owner.try(:membership).try(:number).present?
|
27
|
+
%br
|
28
|
+
Member Number #{owner.membership.number}
|
26
29
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
+
%tr
|
31
|
+
%th Address
|
32
|
+
%td= ring.shipping_address.to_html
|
30
33
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
+
%tr
|
35
|
+
%th Metal
|
36
|
+
%td= ring.metal
|
37
|
+
|
38
|
+
%tr
|
39
|
+
%th Size
|
40
|
+
%td Size #{ring.size}
|
@@ -1,8 +1,3 @@
|
|
1
1
|
.effective-ring-payment
|
2
|
-
-
|
3
|
-
- steps = ring_wizard.required_steps - blacklist
|
4
|
-
|
5
|
-
= render "effective/ring_wizards/summary", ring_wizard: ring_wizard
|
6
|
-
|
7
|
-
- steps.select { |step| ring_wizard.has_completed_step?(step) }.each do |partial|
|
2
|
+
- ring_wizard.render_steps.each do |partial|
|
8
3
|
= render "effective/ring_wizards/#{partial}", ring_wizard: ring_wizard, step: partial
|
@@ -9,6 +9,7 @@
|
|
9
9
|
|
10
10
|
= link_to "Return to Dashboard", root_path, class: 'btn btn-lg btn-primary mb-4'
|
11
11
|
|
12
|
+
= render 'effective/ring_wizards/summary', ring_wizard: resource
|
12
13
|
= render 'effective/ring_wizards/ring_wizard', ring_wizard: resource
|
13
14
|
= render 'effective/ring_wizards/orders', ring_wizard: resource
|
14
15
|
|