effective_products 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/admin/stamps_controller.rb +6 -1
  3. data/app/datatables/admin/effective_stamps_datatable.rb +10 -5
  4. data/app/datatables/effective_stamp_wizards_datatable.rb +1 -1
  5. data/app/models/concerns/effective_products_ring_wizard.rb +1 -1
  6. data/app/models/concerns/effective_products_stamp_wizard.rb +1 -2
  7. data/app/models/effective/ring.rb +6 -1
  8. data/app/models/effective/stamp.rb +13 -14
  9. data/app/views/admin/stamps/_form.html.haml +17 -8
  10. data/app/views/admin/stamps/_stamp.html.haml +13 -49
  11. data/app/views/effective/ring_wizards/_ring_wizard.html.haml +3 -2
  12. data/app/views/effective/stamp_wizards/_dashboard.html.haml +9 -10
  13. data/app/views/effective/stamp_wizards/_stamp.html.haml +14 -41
  14. data/app/views/effective/stamp_wizards/_stamp_requirements.html.haml +1 -0
  15. data/app/views/effective/stamp_wizards/_stamp_wizard.html.haml +3 -2
  16. data/app/views/effective/stamp_wizards/_summary.html.haml +2 -2
  17. data/app/views/effective/stamp_wizards/billing.html.haml +1 -3
  18. data/app/views/effective/stamp_wizards/stamp.html.haml +12 -11
  19. data/app/views/effective/stamp_wizards/start.html.haml +1 -1
  20. data/app/views/effective/stamp_wizards/submitted.html.haml +8 -5
  21. data/app/views/effective/stamps/_fields.html.haml +10 -6
  22. data/config/effective_products.rb +3 -0
  23. data/config/locales/effective_products.en.yml +12 -0
  24. data/config/routes.rb +2 -0
  25. data/lib/effective_products/version.rb +1 -1
  26. data/lib/effective_products.rb +5 -0
  27. metadata +4 -3
  28. data/app/views/effective/stamp_wizards/_stamp_fields.html.haml +0 -45
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11a058d2af660cecc167db7c68d34813d400bb65d4fe71c983dd543b77f1bf74
4
- data.tar.gz: c815c2d731ed89a9700d6f32e694c512af60b7a7404d8fc173cd7c497cf6508d
3
+ metadata.gz: e74238b949c2002ffd532f7b4a941f8d8cee5e95c32c7195baa81239ed103dc8
4
+ data.tar.gz: ae82acec74f21a38bdcfd1e7da9225c79b2b3871f0977b22832d6b84490b4ce4
5
5
  SHA512:
6
- metadata.gz: 6d80c772b8bf58c9902d551f2d05d13829cb5490e5c1cd584e076466ef699bf1a50b1d2ed75c4584fa5da0bd02d05dea37efccfd986471da465bdea098c4065c
7
- data.tar.gz: 18d173346225ff749ab36406bb8ad552e2c102fb1d860d4c40ecf91bc974736633f9549fd7a0dfcd8893960ff6c5a570c7f6e32b3b1ce1cdac09c08d58d94f27
6
+ metadata.gz: bb9987e2605b3c1f81ba771ea785eca19f4eb169024cf7a22645ddc0cf53e30eeb11ef1d66199f9ff6313efe2b5289f1b04cd4b3a2d43a908f703e30ed6ad364
7
+ data.tar.gz: '072629bc4c54d07109f5be7c76746d655e2a189e0fbb4f9dbb91622fe8f38e8053cd499cecee167c4cf024e50a359b062e3d4975a1edbc1cad3dc708174b6ced'
@@ -5,7 +5,12 @@ module Admin
5
5
 
6
6
  include Effective::CrudController
7
7
 
8
- submit :mark_paid, 'Save and Mark Paid'
8
+ # Admin can go straight to submitted
9
+ submit :mark_as_submitted, 'Save'
10
+ submit :mark_paid, 'Save and Mark Paid', redirect: :index
11
+
12
+ on :mark_as_submitted, redirect: :index
13
+ on :mark_as_issued, redirect: :index
9
14
 
10
15
  end
11
16
  end
@@ -19,7 +19,7 @@ module Admin
19
19
  col :applicant, visible: false
20
20
  col :stamp_wizard, visible: false
21
21
 
22
- col(:email) { |stamp| stamp.owner.email }
22
+ col(:email) { |stamp| mail_to stamp.owner.email }
23
23
  col(:phone) { |stamp| stamp.owner.phone }
24
24
 
25
25
  col :member_number, label: 'Member #' do |stamp|
@@ -29,17 +29,22 @@ module Admin
29
29
  col :name
30
30
  col :name_confirmation, visible: false
31
31
 
32
- col :category, visible: false
32
+ col :category, search: EffectiveProducts.stamp_categories
33
33
 
34
- col :shipping_address, label: 'Address'
34
+ col :shipping_address, visible: false
35
+ col(:address1) { |stamp| stamp.shipping_address.try(:address1) }
36
+ col(:address2) { |stamp| stamp.shipping_address.try(:address2) }
37
+ col(:city) { |stamp| stamp.shipping_address.try(:city) }
38
+ col(:state_code, label: 'Prov') { |stamp| stamp.shipping_address.try(:state_code) }
39
+ col(:postal_code, label: 'Postal') { |stamp| stamp.shipping_address.try(:postal_code) }
40
+ col(:country_code, label: 'Country') { |stamp| stamp.shipping_address.try(:country_code) }
35
41
 
36
42
  col :purchased_order, visible: false
37
- col :price, visible: false
43
+ col :price, as: :price, visible: false
38
44
  col :tax_exempt, visible: false
39
45
  col :qb_item_name, visible: false
40
46
 
41
47
  col :status, visible: false
42
-
43
48
  col :issued_at
44
49
 
45
50
  actions_col
@@ -10,7 +10,7 @@ class EffectiveStampWizardsDatatable < Effective::Datatable
10
10
  resource.submitted_at&.strftime('%F') || 'Incomplete'
11
11
  end
12
12
 
13
- col :owner, visible: false, search: :ststamp
13
+ col :owner, visible: false, search: :string
14
14
  col :status, visible: false
15
15
  col :orders, action: :show
16
16
 
@@ -119,7 +119,7 @@ module EffectiveProductsRingWizard
119
119
  end
120
120
 
121
121
  def assign_pricing
122
- raise('to be implemented by including class')
122
+ raise('assign_pricing() to be implemented by including class')
123
123
 
124
124
  # raise('expected a persisted ring') unless ring&.persisted?
125
125
 
@@ -88,7 +88,6 @@ module EffectiveProductsStampWizard
88
88
  def after_submit_purchased!
89
89
  stamps.each { |stamp| stamp.submit! }
90
90
  end
91
-
92
91
  end
93
92
 
94
93
  # Instance Methods
@@ -119,7 +118,7 @@ module EffectiveProductsStampWizard
119
118
  end
120
119
 
121
120
  def assign_pricing
122
- raise('to be implemented by including class')
121
+ raise('assign_pricing() to be implemented by including class')
123
122
 
124
123
  # price = (stamp.physical? ? 100_00 : 50_00)
125
124
  # qb_item_name = "Professional Stamp"
@@ -31,7 +31,8 @@ module Effective
31
31
  timestamps
32
32
  end
33
33
 
34
- scope :deep, -> { includes(:owner) }
34
+ scope :deep, -> { includes(:addresses, owner: [:membership]) }
35
+
35
36
  scope :ready_to_issue, -> { purchased.where(issued_at: nil) }
36
37
  scope :issued, -> { where.not(issued_at: nil) }
37
38
 
@@ -49,6 +50,10 @@ module Effective
49
50
  update!(issued_at: Time.zone.now)
50
51
  end
51
52
 
53
+ def submitted?
54
+ purchased?
55
+ end
56
+
52
57
  def issued?
53
58
  issued_at.present?
54
59
  end
@@ -11,9 +11,6 @@ module Effective
11
11
  :issued # Issued by an admin
12
12
  )
13
13
 
14
- #CATEGORIES = ['Physical', 'Digital-only']
15
- CATEGORIES = ['Physical']
16
-
17
14
  log_changes if respond_to?(:log_changes)
18
15
 
19
16
  # This stamp is charged to an owner
@@ -46,37 +43,39 @@ module Effective
46
43
  timestamps
47
44
  end
48
45
 
49
- scope :deep, -> { includes(:owner) }
46
+ scope :deep, -> { includes(:addresses, owner: [:membership]) }
50
47
 
51
48
  scope :with_approved_applicants, -> { where(applicant_id: EffectiveMemberships.Applicant.approved) }
52
49
  scope :with_stamp_wizards, -> { purchased.where(applicant_id: nil).where.not(stamp_wizard_id: nil) }
50
+ scope :created_by_admin, -> { where(applicant_id: nil, stamp_wizard_id: nil) }
53
51
 
54
52
  scope :ready_to_issue, -> {
55
- with_approved_applicants.or(with_stamp_wizards).where.not(status: :issued)
53
+ with_approved_applicants.or(with_stamp_wizards).or(created_by_admin).where.not(status: :issued)
56
54
  }
57
55
 
58
- validates :category, presence: true, inclusion: { in: CATEGORIES }
59
56
  validates :name, presence: true
60
57
  validates :name_confirmation, presence: true
58
+ validates :category, presence: true
59
+ validates :shipping_address, presence: true, unless: -> { category == 'Digital-only' }
61
60
 
62
61
  validate(if: -> { name.present? && name_confirmation.present? }) do
63
62
  self.errors.add(:name_confirmation, "doesn't match name") unless name == name_confirmation
64
63
  end
65
64
 
66
- validate(if: -> { physical? }) do
67
- self.errors.add(:shipping_address, "can't be blank when physical stamp") unless shipping_address.present?
65
+ validate(if: -> { category.present? }) do
66
+ self.errors.add(:category, "is not included") unless EffectiveProducts.stamp_categories.include?(category)
68
67
  end
69
68
 
70
69
  def to_s
71
- ['Professional Stamp', *name.presence].join(' ')
70
+ [model_name.human, *name.presence].join(' ')
72
71
  end
73
72
 
74
- def mark_as_issued!
75
- issued!
73
+ def mark_as_submitted!
74
+ submitted!
76
75
  end
77
76
 
78
- def physical?
79
- category == 'Physical'
77
+ def mark_as_issued!
78
+ issued!
80
79
  end
81
80
 
82
81
  def created_by_admin?
@@ -102,7 +101,7 @@ module Effective
102
101
  qb_item_name: category.stamp_fee_qb_item_name
103
102
  )
104
103
 
105
- save!
104
+ submitted!
106
105
  Effective::Order.new(items: self, user: owner).mark_as_purchased!
107
106
  end
108
107
 
@@ -1,12 +1,21 @@
1
1
  = effective_form_with(model: [:admin, stamp], engine: true) do |f|
2
- - if f.object.new_record?
3
- = f.select :owner, { 'Users' => current_user.class.members.sorted }, polymorphic: true
2
+ - if inline_datatable?
3
+ = f.hidden_field :owner_id
4
+ = f.hidden_field :owner_type
5
+
4
6
  - else
5
- = f.static_field :owner
7
+ - ajax_url = (@select2_ajax_path || effective_resources.users_admin_select2_ajax_index_path) unless Rails.env.test?
8
+ - f.object.owner_type ||= current_user.class.name
6
9
 
7
- = render 'effective/stamps/fields', f: f, stamp: f.object
10
+ = f.select :owner_id, current_user.class.all, label: 'User', ajax_url: ajax_url,
11
+ 'data-load-ajax-url': effective_products.new_admin_stamp_path,
12
+ 'data-load-ajax-div': '#effective-stamps-ajax'
8
13
 
9
- - if f.object.new_record?
10
- = f.submit 'Save and Mark Paid'
11
- - else
12
- = f.submit 'Save'
14
+ #effective-stamps-ajax
15
+ = render 'effective/stamps/fields', f: f, stamp: f.object
16
+
17
+ = f.submit do
18
+ = f.save 'Save'
19
+
20
+ - if f.object.new_record?
21
+ = f.save 'Save and Mark Paid'
@@ -1,53 +1,17 @@
1
- %table.table
2
- %tbody
3
- %tr
4
- %th Owner
5
- %td
6
- - url = (edit_polymorphic_path(stamp.owner) rescue "/admin/users/#{stamp.owner.to_param}/edit")
7
- = link_to(stamp.owner, url)
1
+ = effective_table_with(stamp) do |f|
2
+ = f.content_for :owner, label: 'User' do
3
+ - owner = f.object.owner
8
4
 
9
- %tr
10
- %th Purchased Order
11
- %td
12
- - if stamp.purchased_order.present?
13
- = link_to(stamp.purchased_order, effective_orders.admin_order_path(stamp.purchased_order))
5
+ = owner.to_s
14
6
 
15
- %tr
16
- %th Contact
17
- %td
18
- - owner = stamp.owner
7
+ - if owner.try(:email).present?
8
+ %br
9
+ = mail_to(owner.email)
19
10
 
20
- = owner.to_s
11
+ - if owner.try(:phone).present?
12
+ %br
13
+ = owner.phone
21
14
 
22
- - if owner.try(:email).present?
23
- %br
24
- = mail_to(owner.email)
25
-
26
- - if owner.try(:phone).present?
27
- %br
28
- = owner.phone
29
-
30
- - if owner.try(:membership).try(:number).present?
31
- %br
32
- Member Number #{owner.membership.number}
33
-
34
- %tr
35
- %th
36
- %td= stamp.physical? ? 'Physical' : 'Digital Only'
37
-
38
- - if stamp.shipping_address.present?
39
- %tr
40
- %th Address
41
- %td= stamp.shipping_address.to_html
42
-
43
- %tr
44
- %th Name on Stamp
45
- %td= stamp.name
46
-
47
- %tr
48
- %th Name Confirmation
49
- %td= stamp.name_confirmation
50
-
51
- %tr
52
- %th Issued At
53
- %td= stamp.issued_at&.strftime('%F') || 'Not Issued'
15
+ - if owner.try(:membership).try(:number).present?
16
+ %br
17
+ Member Number #{owner.membership.number}
@@ -1,3 +1,4 @@
1
- .effective-ring-payment
1
+ .effective-ring-wizard
2
2
  - ring_wizard.render_steps.each do |partial|
3
- = render "effective/ring_wizards/#{partial}", ring_wizard: ring_wizard, step: partial
3
+ - ring_wizard.render_step = partial
4
+ = render "effective/ring_wizards/#{partial}", ring_wizard: ring_wizard
@@ -1,11 +1,11 @@
1
1
  -# In progress
2
2
  - existing = EffectiveProducts.StampWizard.in_progress.for(current_user).first
3
- - datatable = EffectiveResources.best('EffectiveStampWizardsDatatable').new(self, namespace: :effective)
3
+ - completed = EffectiveResources.best('EffectiveStampWizardsDatatable').new(self, namespace: :effective)
4
4
 
5
- - if existing.present?
6
- %h2 In Progress Stamp Requests
5
+ %h2= ets(EffectiveProducts.StampWizard)
7
6
 
8
- %p Your request for Professional Stamp is incomplete
7
+ - if existing.present?
8
+ %p Your request is in progress.
9
9
 
10
10
  %p
11
11
  Please
@@ -16,14 +16,13 @@
16
16
 
17
17
  %hr
18
18
 
19
- %h2 Stamp Replacement Requests
20
-
21
19
  = yield
22
20
 
23
- - if datatable.present?
24
- = render_simple_datatable(datatable)
21
+ - if completed.present?
22
+ %p You have completed these past #{ets(EffectiveProducts.StampWizard).downcase}:
23
+ = render_simple_datatable(completed)
25
24
  - else
26
- %p You have no past professional stamp replacement requests. When you do, we'll show them here.
25
+ %p You have no past #{ets(EffectiveProducts.StampWizard).downcase}. When you do, we'll show them here.
27
26
 
28
27
  - if existing.blank?
29
- %p= link_to 'Start Stamp Replacement Request', effective_products.new_stamp_wizard_path, class: 'btn btn-primary'
28
+ %p= link_to "Start #{et(EffectiveProducts.StampWizard)}", effective_products.new_stamp_wizard_path, class: 'btn btn-primary'
@@ -1,45 +1,18 @@
1
- .card
2
- .card-body
3
- .row
4
- .col-sm
5
- %h5.card-title= stamp_wizard.wizard_step_title(:stamp)
6
- .col-sm-auto.text-right
7
- = link_to('Edit', wizard_path(:stamp)) if edit_effective_wizard?
1
+ = wizard_card(stamp_wizard) do
2
+ = effective_table_with(stamp_wizard.stamp, only: [:owner, :category, :shipping_address, :name, :name_confirmation]) do |f|
3
+ = f.content_for :owner, label: 'User' do
4
+ - owner = f.object.owner
8
5
 
9
- - stamp = stamp_wizard.stamp
10
- - owner = stamp_wizard.owner
6
+ = owner.to_s
11
7
 
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)
8
+ - if owner.try(:email).present?
9
+ %br
10
+ = mail_to(owner.email)
21
11
 
22
- - if owner.try(:phone).present?
23
- %br
24
- = owner.phone
12
+ - if owner.try(:phone).present?
13
+ %br
14
+ = owner.phone
25
15
 
26
- - if owner.try(:membership).try(:number).present?
27
- %br
28
- Member Number #{owner.membership.number}
29
-
30
- %tr
31
- %th Category
32
- %td= stamp.category
33
-
34
- - if stamp.shipping_address.present?
35
- %tr
36
- %th Address
37
- %td= stamp.shipping_address.to_html
38
-
39
- %tr
40
- %th Name
41
- %td= stamp.name
42
-
43
- %tr
44
- %th Name Confirmation
45
- %td= stamp.name_confirmation
16
+ - if owner.try(:membership).try(:number).present?
17
+ %br
18
+ Member Number #{owner.membership.number}
@@ -0,0 +1 @@
1
+ %p Stamp Requirements
@@ -1,3 +1,4 @@
1
- .effective-stamp-payment
1
+ .effective-stamp-wizard
2
2
  - stamp_wizard.render_steps.each do |partial|
3
- = render "effective/stamp_wizards/#{partial}", stamp_wizard: stamp_wizard, step: partial
3
+ - stamp_wizard.render_step = partial
4
+ = render "effective/stamp_wizards/#{partial}", stamp_wizard: stamp_wizard
@@ -1,6 +1,6 @@
1
- = card('Stamp Payment') do
2
- - stamp = stamp_wizard.stamp
1
+ - stamp = stamp_wizard.stamp
3
2
 
3
+ = card(et(stamp)) do
4
4
  %table.table.table-sm
5
5
  %tbody
6
6
  - if request.path.start_with?('/admin')
@@ -3,9 +3,7 @@
3
3
 
4
4
  - raise('expected owner to respond to billing_address') unless resource.owner.respond_to?(:billing_address)
5
5
 
6
- = card('Billing Address') do
7
- %p Please enter your billing address
8
-
6
+ = card do
9
7
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
10
8
  = f.hidden_field :id
11
9
 
@@ -1,18 +1,19 @@
1
1
  = render 'layout' do
2
2
  = render 'effective/stamp_wizards/content', resource: resource
3
3
 
4
- .card
5
- .card-body
6
- = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
7
- = f.hidden_field :id
4
+ = card do
5
+ .mb-2= render('stamp_requirements', stamp_wizard: resource)
8
6
 
9
- = f.fields_for :stamps, (f.object.stamp || f.object.build_stamp) do |fr|
10
- = fr.hidden_field :stamp_wizard_id
11
- = fr.hidden_field :stamp_wizard_type
7
+ = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
8
+ = f.hidden_field :id
12
9
 
13
- = fr.hidden_field :owner_id
14
- = fr.hidden_field :owner_type
10
+ = f.fields_for :stamps, (f.object.stamp || f.object.build_stamp) do |fr|
11
+ = fr.hidden_field :stamp_wizard_id
12
+ = fr.hidden_field :stamp_wizard_type
15
13
 
16
- = render('effective/stamp_wizards/stamp_fields', f: fr)
14
+ = fr.hidden_field :owner_id
15
+ = fr.hidden_field :owner_type
17
16
 
18
- = f.save 'Save and Continue'
17
+ = render('effective/stamps/fields', f: fr)
18
+
19
+ = f.save 'Save and Continue'
@@ -5,7 +5,7 @@
5
5
  .card-body
6
6
  %p Welcome #{current_user}!
7
7
 
8
- %p You are about to request a replacement Professional Stamp.
8
+ %p You are about to request a replacement #{et(Effective::Stamp)}.
9
9
 
10
10
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
11
11
  = f.hidden_field :id
@@ -4,13 +4,16 @@
4
4
  - raise('expected a submitted resource') unless resource.was_submitted?
5
5
  - raise('expected a purchased resource submit_order') unless resource.submit_order&.purchased?
6
6
 
7
- .alert.alert-warning.mb-4
8
- Successfully paid on #{resource.submit_order.purchased_at.strftime('%F')}.
7
+ .alert.alert-success.mb-4
8
+ Successfully submitted on #{resource.submit_order.purchased_at.strftime('%F')}.
9
9
 
10
- = link_to "Return to Dashboard", root_path, class: 'btn btn-lg btn-primary mb-4'
10
+ .mb-4= link_to "Return to Dashboard", return_to_dashboard_path, class: 'btn btn-lg btn-primary btn-block'
11
11
 
12
12
  = render 'effective/stamp_wizards/summary', stamp_wizard: resource
13
13
  = render 'effective/stamp_wizards/stamp_wizard', stamp_wizard: resource
14
- = render 'effective/stamp_wizards/orders', stamp_wizard: resource
15
14
 
16
- = link_to 'Return to Dashboard', root_path, class: 'btn btn-lg btn-primary'
15
+ .mb-4
16
+ = collapse('Show order...', card_class: 'my-2') do
17
+ = render 'effective/stamp_wizards/orders', stamp_wizard: resource
18
+
19
+ = link_to "Return to Dashboard", return_to_dashboard_path, class: 'btn btn-lg btn-primary btn-block'
@@ -1,11 +1,15 @@
1
+ - f.object.shipping_address ||= (f.object.owner.try(:shipping_address) || f.object.owner.try(:billing_address))
2
+ - f.object.name ||= f.object.owner.to_s
3
+
1
4
  = f.text_field :name
2
5
  = f.text_field :name_confirmation, hint: 'must match name'
3
6
 
4
- %h2 Stamp Information
5
-
6
- %p Please select a stamp and enter a shipping address.
7
+ - collection = EffectiveProducts.stamp_categories
7
8
 
8
- = f.select :category, Effective::Stamp::CATEGORIES
9
+ - if collection.length == 1
10
+ = f.hidden_field :category, value: collection.first
11
+ - else
12
+ = f.select :category, collection
9
13
 
10
- = f.show_if :category, 'Physical' do
11
- = effective_address_fields(f, :shipping)
14
+ %h4 Shipping address
15
+ = effective_address_fields(f, :shipping)
@@ -12,6 +12,9 @@ EffectiveProducts.setup do |config|
12
12
  # config.ring_wizards_class_name = 'Effective::RingWizard'
13
13
  # config.stamp_wizards_class_name = 'Effective::StampWizard'
14
14
 
15
+ # The available stamp categories
16
+ config.stamp_categories = ['Physical', 'Digital-only', 'Stamp', 'Stamp and Certificate']
17
+
15
18
  # Use effective roles. Not sure what this does yet.
16
19
  config.use_effective_roles = true
17
20
 
@@ -0,0 +1,12 @@
1
+ en:
2
+ effective_products:
3
+ name: 'Stamps and Rings'
4
+
5
+ activerecord:
6
+ models:
7
+ # Application namespace
8
+ app/stamp_wizard: 'Stamp Replacement Request'
9
+
10
+ # Effective namespace
11
+ effective/stamp: 'Professional Stamp'
12
+ effective/ring: 'Professional Ring'
data/config/routes.rb CHANGED
@@ -20,10 +20,12 @@ EffectiveProducts::Engine.routes.draw do
20
20
  resources :ring_wizards, except: [:new, :create, :show]
21
21
 
22
22
  resources :rings, only: [:index, :show] do
23
+ post :mark_as_submitted, on: :member
23
24
  post :mark_as_issued, on: :member
24
25
  end
25
26
 
26
27
  resources :stamps do
28
+ post :mark_as_submitted, on: :member
27
29
  post :mark_as_issued, on: :member
28
30
  end
29
31
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveProducts
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.2.0'.freeze
3
3
  end
@@ -9,6 +9,7 @@ module EffectiveProducts
9
9
  [
10
10
  :rings_table_name, :ring_wizards_table_name, :ring_wizard_class_name,
11
11
  :stamps_table_name, :stamp_wizards_table_name, :stamp_wizard_class_name,
12
+ :stamp_categories,
12
13
  :layout, :use_effective_roles
13
14
  ]
14
15
  end
@@ -23,4 +24,8 @@ module EffectiveProducts
23
24
  stamp_wizard_class_name&.constantize || Effective::StampWizard
24
25
  end
25
26
 
27
+ def self.stamp_categories
28
+ Array(config[:stamp_categories])
29
+ end
30
+
26
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_products
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
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: 2023-01-26 00:00:00.000000000 Z
11
+ date: 2023-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -258,7 +258,7 @@ files:
258
258
  - app/views/effective/stamp_wizards/_layout.html.haml
259
259
  - app/views/effective/stamp_wizards/_orders.html.haml
260
260
  - app/views/effective/stamp_wizards/_stamp.html.haml
261
- - app/views/effective/stamp_wizards/_stamp_fields.html.haml
261
+ - app/views/effective/stamp_wizards/_stamp_requirements.html.haml
262
262
  - app/views/effective/stamp_wizards/_stamp_wizard.html.haml
263
263
  - app/views/effective/stamp_wizards/_summary.html.haml
264
264
  - app/views/effective/stamp_wizards/billing.html.haml
@@ -269,6 +269,7 @@ files:
269
269
  - app/views/effective/stamp_wizards/summary.html.haml
270
270
  - app/views/effective/stamps/_fields.html.haml
271
271
  - config/effective_products.rb
272
+ - config/locales/effective_products.en.yml
272
273
  - config/routes.rb
273
274
  - db/migrate/01_create_effective_products.rb.erb
274
275
  - db/seeds.rb
@@ -1,45 +0,0 @@
1
- %h2 Contact Information
2
-
3
- - owner = f.object.owner
4
-
5
- %p
6
- = owner.to_s
7
-
8
- - if owner.try(:email).present?
9
- %br
10
- = mail_to(owner.email)
11
-
12
- - if owner.try(:phone).present?
13
- %br
14
- = owner.phone
15
-
16
- - if owner.try(:membership).try(:number).present?
17
- %br
18
- Member Number #{owner.membership.number}
19
-
20
- %h2 Display Name
21
- %p Please enter and confirm your name as it should appear on the Professional Stamp.
22
-
23
- = f.text_field :name
24
- = f.text_field :name_confirmation, hint: 'must match name'
25
-
26
- %h2 Stamp Information
27
-
28
- %table.table
29
- %thead
30
- %th Stamp
31
- %th.order_price Cost
32
- %tbody
33
- %tr
34
- %td Physical
35
- %td.order_price $50.00 + GST
36
- %tr
37
- %td Digital-only
38
- %td.order_price $25.00 + GST
39
-
40
- %p Please select a stamp:
41
-
42
- = f.select :category, Effective::Stamp::CATEGORIES
43
-
44
- = f.show_if :category, 'Physical' do
45
- = effective_address_fields(f, :shipping)