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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd6de56034ed84b15b02ab52785db58b37b0839e67a0db8cf31b77da8f4db148
4
- data.tar.gz: e7a59c34d1c681a582c7c7c510ad9cc8c8f911e7bfbe339864678bca3f4db4d7
3
+ metadata.gz: 57266684ebdd641086150769be175ade40a9fb2761655a9d0c83ee04c233b750
4
+ data.tar.gz: 7770a4aaebaaf1048c5ef8cba5a4b56c6bd791a39402ff2877464407a6e5019f
5
5
  SHA512:
6
- metadata.gz: 4383a40c636b788b989b22a8dedbc8d7afac6be72313ec737d3fe3ea1457365054194f99739651e3d61cacfa5a412e3aaa0d7068c39bfa3d41819446a226119f
7
- data.tar.gz: b33a258e854dfdd4211edfb7143105d1c6af606cd8274886c548e65e414919a0d41e651cbd07e8399e497e2b06e9137f695cc053e43acf4509b663b01149f1de
6
+ metadata.gz: 30d1a478d0569578fb665ad6dcbee2c3c6c59cb14f1222fac9c123c60526fb35cb7acf3ac9c2dc48d6a141db56bd491646f31a70cfed4acd6142eac00bc2a728
7
+ data.tar.gz: f2b66599466397300d83108fbe6c0ce3584c023fcf54b6db260754c338c873af36f259e12dbdadd752ae175597e6426aa5bd51645fa49c8932ce0135a9ef4846
@@ -1,3 +1,2 @@
1
1
  module EffectiveProductsHelper
2
-
3
2
  end
@@ -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
- = card('Ring') do
2
- - ring = ring_wizard.ring
3
- - owner = ring_wizard.owner
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
- %table.table.table-sm
6
- %tbody
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
- - if owner.try(:phone).present?
16
- %br
17
- = owner.phone
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
- - if owner.try(:membership).try(:number).present?
20
- %br
21
- Member Number #{owner.membership.number}
22
+ - if owner.try(:phone).present?
23
+ %br
24
+ = owner.phone
22
25
 
23
- %tr
24
- %th Address
25
- %td= ring.shipping_address.to_html
26
+ - if owner.try(:membership).try(:number).present?
27
+ %br
28
+ Member Number #{owner.membership.number}
26
29
 
27
- %tr
28
- %th Metal
29
- %td= ring.metal
30
+ %tr
31
+ %th Address
32
+ %td= ring.shipping_address.to_html
30
33
 
31
- %tr
32
- %th Size
33
- %td Size #{ring.size}
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
- - blacklist = ring_wizard.class.required_wizard_steps + [:summary]
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
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveProducts
2
- VERSION = '0.0.3'.freeze
2
+ VERSION = '0.0.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_products
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect