effective_products 0.0.2 → 0.0.6
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/stamps_controller.rb +9 -0
- data/app/controllers/effective/ring_wizards_controller.rb +10 -0
- data/app/controllers/effective/stamp_wizards_controller.rb +10 -0
- data/app/datatables/admin/effective_rings_datatable.rb +4 -5
- data/app/datatables/admin/effective_stamps_datatable.rb +43 -0
- data/app/datatables/{effective_ring_payments_datatable.rb → effective_ring_wizards_datatable.rb} +5 -5
- data/app/datatables/effective_stamp_wizards_datatable.rb +36 -0
- data/app/helpers/effective_products_helper.rb +0 -1
- data/app/models/concerns/{effective_products_ring_payment.rb → effective_products_ring_wizard.rb} +27 -36
- data/app/models/concerns/effective_products_stamp_wizard.rb +139 -0
- data/app/models/effective/ring.rb +2 -24
- data/app/models/effective/ring_wizard.rb +7 -0
- data/app/models/effective/stamp.rb +69 -0
- data/app/models/effective/stamp_wizard.rb +7 -0
- data/app/views/admin/rings/_ring.html.haml +23 -15
- data/app/views/admin/stamps/_stamp.html.haml +53 -0
- data/app/views/effective/{ring_payments → ring_wizards}/_content.html.haml +0 -0
- data/app/views/effective/ring_wizards/_dashboard.html.haml +27 -0
- data/app/views/effective/{ring_payments → ring_wizards}/_layout.html.haml +0 -0
- data/app/views/effective/ring_wizards/_orders.html.haml +4 -0
- data/app/views/effective/ring_wizards/_ring.html.haml +40 -0
- data/app/views/effective/{rings/_fields.html.haml → ring_wizards/_ring_fields.html.haml} +25 -7
- data/app/views/effective/ring_wizards/_ring_wizard.html.haml +3 -0
- data/app/views/effective/ring_wizards/_summary.html.haml +31 -0
- data/app/views/effective/ring_wizards/billing.html.haml +15 -0
- data/app/views/effective/ring_wizards/checkout.html.haml +6 -0
- data/app/views/effective/{ring_payments → ring_wizards}/ring.html.haml +4 -4
- data/app/views/effective/{ring_payments → ring_wizards}/start.html.haml +1 -1
- data/app/views/effective/ring_wizards/submitted.html.haml +16 -0
- data/app/views/effective/ring_wizards/summary.html.haml +8 -0
- data/app/views/effective/stamp_wizards/_content.html.haml +10 -0
- data/app/views/effective/stamp_wizards/_dashboard.html.haml +27 -0
- data/app/views/effective/stamp_wizards/_layout.html.haml +3 -0
- data/app/views/effective/stamp_wizards/_orders.html.haml +4 -0
- data/app/views/effective/stamp_wizards/_stamp.html.haml +45 -0
- data/app/views/effective/stamp_wizards/_stamp_fields.html.haml +45 -0
- data/app/views/effective/stamp_wizards/_stamp_wizard.html.haml +3 -0
- data/app/views/effective/stamp_wizards/_summary.html.haml +31 -0
- data/app/views/effective/{ring_payments → stamp_wizards}/billing.html.haml +1 -1
- data/app/views/effective/{ring_payments → stamp_wizards}/checkout.html.haml +1 -1
- data/app/views/effective/stamp_wizards/stamp.html.haml +18 -0
- data/app/views/effective/stamp_wizards/start.html.haml +16 -0
- data/app/views/effective/{ring_payments → stamp_wizards}/submitted.html.haml +4 -3
- data/app/views/effective/{ring_payments → stamp_wizards}/summary.html.haml +2 -2
- data/config/effective_products.rb +4 -4
- data/config/routes.rb +11 -3
- data/db/migrate/01_create_effective_products.rb.erb +98 -1
- data/lib/effective_products/engine.rb +2 -1
- data/lib/effective_products/version.rb +1 -1
- data/lib/effective_products.rb +6 -6
- metadata +42 -21
- data/app/controllers/effective/ring_payments_controller.rb +0 -31
- data/app/models/effective/ring_payment.rb +0 -7
- data/app/views/effective/ring_payments/_dashboard.html.haml +0 -27
- data/app/views/effective/ring_payments/_orders.html.haml +0 -4
- data/app/views/effective/ring_payments/_ring.html.haml +0 -29
- data/app/views/effective/ring_payments/_ring_fields.html.haml +0 -4
- data/app/views/effective/ring_payments/_ring_payment.html.haml +0 -8
- data/app/views/effective/ring_payments/_summary.html.haml +0 -31
data/lib/effective_products.rb
CHANGED
@@ -7,20 +7,20 @@ module EffectiveProducts
|
|
7
7
|
|
8
8
|
def self.config_keys
|
9
9
|
[
|
10
|
-
:rings_table_name, :
|
11
|
-
:stamps_table_name, :
|
10
|
+
:rings_table_name, :ring_wizards_table_name, :ring_wizard_class_name,
|
11
|
+
:stamps_table_name, :stamp_wizards_table_name, :stamp_wizard_class_name,
|
12
12
|
:layout, :use_effective_roles
|
13
13
|
]
|
14
14
|
end
|
15
15
|
|
16
16
|
include EffectiveGem
|
17
17
|
|
18
|
-
def self.
|
19
|
-
|
18
|
+
def self.RingWizard
|
19
|
+
ring_wizard_class_name&.constantize || Effective::RingWizard
|
20
20
|
end
|
21
21
|
|
22
|
-
def self.
|
23
|
-
|
22
|
+
def self.StampWizard
|
23
|
+
stamp_wizard_class_name&.constantize || Effective::StampWizard
|
24
24
|
end
|
25
25
|
|
26
26
|
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.0.
|
4
|
+
version: 0.0.6
|
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: 2022-01-
|
11
|
+
date: 2022-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -222,29 +222,50 @@ files:
|
|
222
222
|
- app/assets/stylesheets/effective_products.scss
|
223
223
|
- app/assets/stylesheets/effective_products/base.scss
|
224
224
|
- app/controllers/admin/rings_controller.rb
|
225
|
-
- app/controllers/
|
225
|
+
- app/controllers/admin/stamps_controller.rb
|
226
|
+
- app/controllers/effective/ring_wizards_controller.rb
|
227
|
+
- app/controllers/effective/stamp_wizards_controller.rb
|
226
228
|
- app/datatables/admin/effective_rings_datatable.rb
|
227
|
-
- app/datatables/
|
229
|
+
- app/datatables/admin/effective_stamps_datatable.rb
|
230
|
+
- app/datatables/effective_ring_wizards_datatable.rb
|
231
|
+
- app/datatables/effective_stamp_wizards_datatable.rb
|
228
232
|
- app/helpers/effective_products_helper.rb
|
229
|
-
- app/models/concerns/
|
233
|
+
- app/models/concerns/effective_products_ring_wizard.rb
|
234
|
+
- app/models/concerns/effective_products_stamp_wizard.rb
|
230
235
|
- app/models/effective/ring.rb
|
231
|
-
- app/models/effective/
|
236
|
+
- app/models/effective/ring_wizard.rb
|
237
|
+
- app/models/effective/stamp.rb
|
238
|
+
- app/models/effective/stamp_wizard.rb
|
232
239
|
- app/views/admin/rings/_ring.html.haml
|
233
|
-
- app/views/
|
234
|
-
- app/views/effective/
|
235
|
-
- app/views/effective/
|
236
|
-
- app/views/effective/
|
237
|
-
- app/views/effective/
|
238
|
-
- app/views/effective/
|
239
|
-
- app/views/effective/
|
240
|
-
- app/views/effective/
|
241
|
-
- app/views/effective/
|
242
|
-
- app/views/effective/
|
243
|
-
- app/views/effective/
|
244
|
-
- app/views/effective/
|
245
|
-
- app/views/effective/
|
246
|
-
- app/views/effective/
|
247
|
-
- app/views/effective/
|
240
|
+
- app/views/admin/stamps/_stamp.html.haml
|
241
|
+
- app/views/effective/ring_wizards/_content.html.haml
|
242
|
+
- app/views/effective/ring_wizards/_dashboard.html.haml
|
243
|
+
- app/views/effective/ring_wizards/_layout.html.haml
|
244
|
+
- app/views/effective/ring_wizards/_orders.html.haml
|
245
|
+
- app/views/effective/ring_wizards/_ring.html.haml
|
246
|
+
- app/views/effective/ring_wizards/_ring_fields.html.haml
|
247
|
+
- app/views/effective/ring_wizards/_ring_wizard.html.haml
|
248
|
+
- app/views/effective/ring_wizards/_summary.html.haml
|
249
|
+
- app/views/effective/ring_wizards/billing.html.haml
|
250
|
+
- app/views/effective/ring_wizards/checkout.html.haml
|
251
|
+
- app/views/effective/ring_wizards/ring.html.haml
|
252
|
+
- app/views/effective/ring_wizards/start.html.haml
|
253
|
+
- app/views/effective/ring_wizards/submitted.html.haml
|
254
|
+
- app/views/effective/ring_wizards/summary.html.haml
|
255
|
+
- app/views/effective/stamp_wizards/_content.html.haml
|
256
|
+
- app/views/effective/stamp_wizards/_dashboard.html.haml
|
257
|
+
- app/views/effective/stamp_wizards/_layout.html.haml
|
258
|
+
- app/views/effective/stamp_wizards/_orders.html.haml
|
259
|
+
- app/views/effective/stamp_wizards/_stamp.html.haml
|
260
|
+
- app/views/effective/stamp_wizards/_stamp_fields.html.haml
|
261
|
+
- app/views/effective/stamp_wizards/_stamp_wizard.html.haml
|
262
|
+
- app/views/effective/stamp_wizards/_summary.html.haml
|
263
|
+
- app/views/effective/stamp_wizards/billing.html.haml
|
264
|
+
- app/views/effective/stamp_wizards/checkout.html.haml
|
265
|
+
- app/views/effective/stamp_wizards/stamp.html.haml
|
266
|
+
- app/views/effective/stamp_wizards/start.html.haml
|
267
|
+
- app/views/effective/stamp_wizards/submitted.html.haml
|
268
|
+
- app/views/effective/stamp_wizards/summary.html.haml
|
248
269
|
- config/effective_products.rb
|
249
270
|
- config/routes.rb
|
250
271
|
- db/migrate/01_create_effective_products.rb.erb
|
@@ -1,31 +0,0 @@
|
|
1
|
-
module Effective
|
2
|
-
class RingPaymentsController < ApplicationController
|
3
|
-
before_action(:authenticate_user!) if defined?(Devise)
|
4
|
-
|
5
|
-
include Effective::WizardController
|
6
|
-
|
7
|
-
resource_scope -> { EffectiveProducts.RingPayment.deep.where(owner: current_user) }
|
8
|
-
|
9
|
-
# Allow only 1 in-progress application at a time
|
10
|
-
before_action(only: [:new, :show], unless: -> { resource&.done? }) do
|
11
|
-
existing = resource_scope.in_progress.where.not(id: resource).first
|
12
|
-
|
13
|
-
if existing.present?
|
14
|
-
flash[:success] = "You have been redirected to your existing in progress payment"
|
15
|
-
redirect_to effective_products.ring_payment_build_path(existing, existing.next_step)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
after_save do
|
20
|
-
flash.now[:success] = ''
|
21
|
-
end
|
22
|
-
|
23
|
-
private
|
24
|
-
|
25
|
-
def permitted_params
|
26
|
-
model = (params.key?(:effective_ring_payment) ? :effective_ring_payment : :ring_payment)
|
27
|
-
params.require(model).permit!.except(:status, :status_steps, :wizard_steps, :submitted_at)
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
31
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
-# In progress payments
|
2
|
-
- existing = EffectiveProducts.RingPayment.in_progress.for(current_user).first
|
3
|
-
- datatable = EffectiveResources.best('EffectiveRingPaymentsDatatable').new(self, namespace: :effective)
|
4
|
-
|
5
|
-
- if existing.present?
|
6
|
-
%h2 In Progress Ring Payments
|
7
|
-
|
8
|
-
%p Your payment for Professional Ring is incomplete
|
9
|
-
|
10
|
-
%p
|
11
|
-
Please
|
12
|
-
= link_to("Continue payment for #{existing}", effective_products.ring_payment_build_path(existing, existing.next_step), 'data-turbolinks' => false, class: 'btn btn-primary')
|
13
|
-
or you can
|
14
|
-
= link_to('Abandon registration', effective_products.ring_payment_path(existing), 'data-confirm': "Really delete #{existing}?", 'data-method': :delete, class: 'btn btn-danger')
|
15
|
-
to start over.
|
16
|
-
|
17
|
-
%hr
|
18
|
-
|
19
|
-
%h2 Ring Payments
|
20
|
-
|
21
|
-
- if datatable.present?
|
22
|
-
= render_simple_datatable(datatable)
|
23
|
-
- else
|
24
|
-
%p You have no past ring payments. When you do, we'll show them here.
|
25
|
-
|
26
|
-
- if existing.blank?
|
27
|
-
%p= link_to 'Order a Professional Ring', effective_products.new_ring_payment_path, class: 'btn btn-primary'
|
@@ -1,29 +0,0 @@
|
|
1
|
-
= card('Ring') do
|
2
|
-
- ring = ring_payment.ring
|
3
|
-
|
4
|
-
%table.table.table-sm
|
5
|
-
%tbody
|
6
|
-
%tr
|
7
|
-
%th Contact Info
|
8
|
-
%td
|
9
|
-
#{ring.first_name} #{ring.last_name}
|
10
|
-
%br
|
11
|
-
= mail_to(ring.email)
|
12
|
-
%br
|
13
|
-
= ring.phone
|
14
|
-
|
15
|
-
%tr
|
16
|
-
%th Address
|
17
|
-
%td= ring.shipping_address.to_html
|
18
|
-
|
19
|
-
%tr
|
20
|
-
%th Member Number
|
21
|
-
%td= ring_payment.owner.membership&.number || 'None'
|
22
|
-
|
23
|
-
%tr
|
24
|
-
%th Metal
|
25
|
-
%td= ring.metal
|
26
|
-
|
27
|
-
%tr
|
28
|
-
%th Size
|
29
|
-
%td Size #{ring.size}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
.effective-ring-payment
|
2
|
-
- blacklist = ring_payment.class.required_wizard_steps + [:summary]
|
3
|
-
- steps = ring_payment.required_steps - blacklist
|
4
|
-
|
5
|
-
= render "effective/ring_payments/summary", ring_payment: ring_payment
|
6
|
-
|
7
|
-
- steps.select { |step| ring_payment.has_completed_step?(step) }.each do |partial|
|
8
|
-
= render "effective/ring_payments/#{partial}", ring_payment: ring_payment, step: partial
|
@@ -1,31 +0,0 @@
|
|
1
|
-
= card('Ring Payment') do
|
2
|
-
- ring = ring_payment.ring
|
3
|
-
|
4
|
-
%table.table.table-sm
|
5
|
-
%tbody
|
6
|
-
- if request.path.start_with?('/admin')
|
7
|
-
%tr
|
8
|
-
%th Ordered by
|
9
|
-
%td
|
10
|
-
- url = (polymorphic_admin_path(ring_payment.owner) rescue "/admin/users/#{ring_payment.owner.to_param}/edit")
|
11
|
-
= link_to(ring_payment.owner, url)
|
12
|
-
- else
|
13
|
-
%tr
|
14
|
-
%th Ordered by
|
15
|
-
%td= ring_payment.owner
|
16
|
-
|
17
|
-
- if ring_payment.orders.present?
|
18
|
-
%tr
|
19
|
-
%th Order
|
20
|
-
%td
|
21
|
-
- ring_payment.orders.each do |order|
|
22
|
-
= link_to(order, effective_orders.order_path(order))
|
23
|
-
|
24
|
-
- if ring_payment.was_submitted?
|
25
|
-
%tr
|
26
|
-
%th Submitted
|
27
|
-
%td= ring_payment.submitted_at.strftime('%F')
|
28
|
-
|
29
|
-
%tr
|
30
|
-
%th Issued
|
31
|
-
%td= ring.issued_at&.strftime('%F') || 'Not Issued'
|