effective_events 2.33.3 → 2.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/concerns/effective_events_event_registration.rb +27 -4
  3. data/app/models/effective/event_addon.rb +1 -1
  4. data/app/models/effective/event_registrant.rb +1 -1
  5. data/app/views/effective/event_registrations/_addons.html.haml +1 -7
  6. data/app/views/effective/event_registrations/_code_of_conduct.html.haml +3 -0
  7. data/app/views/effective/event_registrations/_code_of_conduct_fields.html.haml +6 -0
  8. data/app/views/effective/event_registrations/_event_registration.html.haml +2 -1
  9. data/app/views/effective/event_registrations/_tickets.html.haml +1 -7
  10. data/app/views/effective/event_registrations/billing.html.haml +3 -3
  11. data/app/views/effective/event_registrations/checkout.html.haml +1 -1
  12. data/app/views/effective/event_registrations/code_of_conduct.html.haml +11 -0
  13. data/app/views/effective/event_registrations/details.html.haml +2 -3
  14. data/app/views/effective/event_registrations/start.html.haml +23 -26
  15. data/app/views/effective/event_registrations/summary.html.haml +2 -1
  16. data/app/views/effective/event_registrations/tickets.html.haml +5 -5
  17. data/app/views/effective/events/show.html.haml +7 -0
  18. data/config/effective_events.rb +6 -0
  19. data/lib/effective_events/version.rb +1 -1
  20. data/lib/effective_events.rb +17 -0
  21. metadata +7 -4
  22. /data/app/views/effective/event_registrations/{_fields_event_registrants.html.haml → _details_fields.html.haml} +0 -0
  23. /data/app/views/effective/event_registrations/{_fields_event_ticket_selections.html.haml → _tickets_fields.html.haml} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28f9bea4ad9ae836687a2976d8375defb38dadd9024380d02daae3edfc5d2826
4
- data.tar.gz: cab0b307582df198e1de51213a473102b5699e433091297e888995278c994978
3
+ metadata.gz: 752b1ea45717c8cc9c6cef3c312ca7392186497fb0024c55c71ac63a8e0ac402
4
+ data.tar.gz: e0dd03ae68b811e37b2ca5ee2237342ac4c1058bbf70a1136846fa81370dadaf
5
5
  SHA512:
6
- metadata.gz: 78059802ffd220f3bb1cacf8e3d7e2160513b213f0d95c740669a206f5bbcab341c9a8d981f9f270dfc11c1c5aacb35ff3260936aa2e99ff0a57755356cb304e
7
- data.tar.gz: 6080c2d6d2338ca6c94571dbb84901d04524022136f39b9e2431c88fd1025d0da192970f6bad8ca6552083d2d3d568c1085f779341b66c661d6cca2c60be7037
6
+ metadata.gz: 012ac6517e8998ddf0ede909ac774b7d18fcbede6170f5e4961a8db118252b0cd392cf0a0cb608ff7736c1d25a4bc4cf523fae38b12da271b4deae79734a1a2d
7
+ data.tar.gz: d0a9ef6bb70fa6ef410cce8fccfd12d1bcf3be40d4d4eea8cc5e0803de03198b565287ad748d8f9195b257a2af056a37ba4d79e85b55b596b7868b1cd365e19b
@@ -36,6 +36,7 @@ module EffectiveEventsEventRegistration
36
36
  tickets: 'Tickets',
37
37
  details: 'Ticket Details',
38
38
  addons: 'Add-ons',
39
+ code_of_conduct: 'Code of Conduct',
39
40
  summary: 'Review',
40
41
  billing: 'Billing Address',
41
42
  checkout: 'Checkout',
@@ -61,7 +62,7 @@ module EffectiveEventsEventRegistration
61
62
  accepts_nested_attributes_for :event_registrants, reject_if: :all_blank, allow_destroy: true
62
63
 
63
64
  has_many :event_addons, -> { order(:event_product_id, :id) }, class_name: 'Effective::EventAddon', inverse_of: :event_registration, dependent: :destroy
64
- accepts_nested_attributes_for :event_addons, reject_if: :all_blank, allow_destroy: true
65
+ accepts_nested_attributes_for :event_addons, reject_if: -> (atts) { atts[:event_product_id].blank? }, allow_destroy: true
65
66
 
66
67
  has_many :orders, -> { order(:id) }, as: :parent, class_name: 'Effective::Order', dependent: :nullify
67
68
  accepts_nested_attributes_for :orders
@@ -73,6 +74,9 @@ module EffectiveEventsEventRegistration
73
74
  accepts_nested_attributes_for :fees, reject_if: :all_blank, allow_destroy: true
74
75
  end
75
76
 
77
+ # Code of Conduct Step
78
+ attr_accessor :declare_code_of_conduct
79
+
76
80
  effective_resource do
77
81
  # Acts as Statused
78
82
  status :string, permitted: false
@@ -161,6 +165,11 @@ module EffectiveEventsEventRegistration
161
165
  end
162
166
  end
163
167
 
168
+ # Code of Conduct Step
169
+ with_options(if: -> { current_step == :code_of_conduct }) do
170
+ validates :declare_code_of_conduct, acceptance: true
171
+ end
172
+
164
173
  # If we're submitted. Try to move to completed.
165
174
  before_save(if: -> { submitted? }) { try_completed! }
166
175
 
@@ -193,9 +202,18 @@ module EffectiveEventsEventRegistration
193
202
  def required_steps
194
203
  return self.class.test_required_steps if Rails.env.test? && self.class.test_required_steps.present?
195
204
 
196
- with_addons = event.event_products.any? { |event_product| event_product.archived? == false }
197
-
198
- with_addons ? wizard_step_keys : (wizard_step_keys - [:addons])
205
+ [
206
+ :start,
207
+ :tickets,
208
+ :details,
209
+ (:addons if event.event_products.any? { |event_product| !event_product.archived? }),
210
+ (:code_of_conduct if EffectiveEvents.code_of_conduct_enabled?),
211
+ :summary,
212
+ :billing,
213
+ :checkout,
214
+ :submitted,
215
+ :complete
216
+ ].compact
199
217
  end
200
218
 
201
219
  def delayed_payment_attributes
@@ -507,6 +525,11 @@ module EffectiveEventsEventRegistration
507
525
  false
508
526
  end
509
527
 
528
+ def wizard_step_title(step)
529
+ return EffectiveEvents.code_of_conduct_page_title if step == :code_of_conduct
530
+ default_wizard_step_title(step)
531
+ end
532
+
510
533
  private
511
534
 
512
535
  def update_deferred_event_registration!
@@ -81,7 +81,7 @@ module Effective
81
81
  end
82
82
 
83
83
  def tax_exempt
84
- event_product.tax_exempt
84
+ event_product&.tax_exempt
85
85
  end
86
86
 
87
87
  def qb_item_name
@@ -446,7 +446,7 @@ module Effective
446
446
  order = (Array(event_registration_submit_order) + Array(orders)).find { |order| order.in_progress? && !order.purchased_or_deferred? && !order.refund? }
447
447
  return false if order.blank?
448
448
 
449
- order.send_payment_request_to_buyer!
449
+ order.send_payment_request!
450
450
  end
451
451
 
452
452
  def send_order_emails!
@@ -1,9 +1,3 @@
1
- = card do
2
- .row
3
- .col-sm
4
- %h5.card-title= event_registration.wizard_step_title(:addons)
5
- .col-sm-auto.text-right
6
- = link_to('Edit', wizard_path(:addons)) if edit_effective_wizard?
7
-
1
+ = wizard_card(event_registration) do
8
2
  - datatable = EffectiveEventAddonsDatatable.new(event_registration: event_registration)
9
3
  .mb-4= render_simple_datatable(datatable)
@@ -0,0 +1,3 @@
1
+ = wizard_card(event_registration) do
2
+ = effective_table_with(event_registration) do |f|
3
+ = render("effective/event_registrations/code_of_conduct_fields", f: f)
@@ -0,0 +1,6 @@
1
+ - f.object.declare_code_of_conduct = f.object.has_completed_step?(:code_of_conduct)
2
+
3
+ - page = EffectiveEvents.code_of_conduct_effective_page!
4
+
5
+ = f.check_box :declare_code_of_conduct, required: true,
6
+ label: "I agree to abide by the #{link_to(page.title, effective_pages.page_path(page), target: '_blank')}."
@@ -1,3 +1,4 @@
1
1
  .effective-event-registration
2
2
  - event_registration.render_steps.each do |partial|
3
- = render "effective/event_registrations/#{partial}", event_registration: event_registration, step: partial
3
+ - event_registration.render_step = partial
4
+ = render "effective/event_registrations/#{partial}", event_registration: event_registration
@@ -1,9 +1,3 @@
1
- = card do
2
- .row
3
- .col-sm
4
- %h5.card-title= event_registration.wizard_step_title(:tickets)
5
- .col-sm-auto.text-right
6
- = link_to('Edit', wizard_path(:tickets)) if edit_effective_wizard?
7
-
1
+ = wizard_card(event_registration) do
8
2
  - datatable = EffectiveEventRegistrantsDatatable.new(event_registration: event_registration)
9
3
  .mb-4= render_simple_datatable(datatable)
@@ -10,7 +10,7 @@
10
10
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
11
11
  = f.hidden_field :id
12
12
 
13
- = f.fields_for(:owner, f.object.owner) do |fu|
14
- = effective_address_fields(fu, :billing)
13
+ = f.fields_for(:owner, f.object.owner) do |fo|
14
+ = effective_address_fields(fo, :billing)
15
15
 
16
- = f.save 'Save and Continue'
16
+ = f.submit 'Save and Continue', left: true
@@ -20,5 +20,5 @@
20
20
  - if resource.submit_order.delayed? && resource.submit_order.deferred?
21
21
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
22
22
  = f.hidden_field :id
23
- = f.save 'Save and Continue'
23
+ = f.submit 'Save and Continue', left: true
24
24
 
@@ -0,0 +1,11 @@
1
+ = render 'layout' do
2
+ = render('effective/event_registrations/changing', resource: resource)
3
+ = render('effective/event_registrations/content', resource: resource)
4
+
5
+ = card do
6
+ = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
7
+ = f.hidden_field :id
8
+
9
+ = render('effective/event_registrations/code_of_conduct_fields', f: f)
10
+
11
+ = f.submit 'Save and Continue', left: true
@@ -5,7 +5,6 @@
5
5
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
6
6
  = f.hidden_field :id
7
7
 
8
- = render('effective/event_registrations/fields_event_registrants', form: f)
8
+ = render('effective/event_registrations/details_fields', form: f)
9
9
 
10
- %hr
11
- = f.save 'Save and Continue'
10
+ = f.submit 'Save and Continue', left: true
@@ -1,37 +1,34 @@
1
1
  = render 'layout' do
2
2
  = render('effective/event_registrations/content', resource: resource)
3
3
 
4
- - # Signed out
5
- - if resource.owner.blank?
6
- .card
7
- .card-body
8
- %p Welcome!
4
+ = card do
5
+ - # Signed out
6
+ - if resource.owner.blank?
7
+ %p Welcome!
9
8
 
10
- %p You are about to register for #{resource.event}.
9
+ %p You are about to register for #{resource.event}.
11
10
 
12
- %p
13
- Please
14
- = link_to 'sign in', '/users/sign_in'
15
- or
16
- = link_to 'sign up', '/users/sign_up'
17
- to continue.
18
-
19
- %p= link_to 'Sign In to Continue', '/users/sign_in', class: 'btn btn-primary'
11
+ %p
12
+ Please
13
+ = link_to 'sign in', '/users/sign_in'
14
+ or
15
+ = link_to 'sign up', '/users/sign_up'
16
+ to continue.
17
+
18
+ %p= link_to 'Sign In to Continue', '/users/sign_in', class: 'btn btn-primary'
20
19
 
21
- - # Signed in
22
- - if resource.owner.present?
23
- .card
24
- .card-body
25
- %p Welcome #{current_user}!
20
+ - # Signed in
21
+ - if resource.owner.present?
22
+ %p Welcome #{current_user}!
26
23
 
27
- %p You are registering for #{resource.event}.
24
+ %p You are registering for #{resource.event}.
28
25
 
29
- = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
30
- = f.hidden_field :id
26
+ = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
27
+ = f.hidden_field :id
31
28
 
32
- = f.hidden_field :event_id
29
+ = f.hidden_field :event_id
33
30
 
34
- = f.hidden_field :owner_type
35
- = f.hidden_field :owner_id
31
+ = f.hidden_field :owner_type
32
+ = f.hidden_field :owner_id
36
33
 
37
- = f.save 'Save and Continue'
34
+ = f.submit 'Save and Continue', left: true
@@ -1,9 +1,10 @@
1
1
  = render 'layout' do
2
2
  = render('effective/event_registrations/changing', resource: resource)
3
3
  = render('effective/event_registrations/content', resource: resource)
4
+
4
5
  = render('effective/event_registrations/event_registration', event_registration: resource)
5
6
 
6
7
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
7
8
  = f.hidden_field :id
8
9
 
9
- = f.save 'Save and Continue'
10
+ = f.submit 'Save and Continue', left: true
@@ -2,10 +2,10 @@
2
2
  = render('effective/event_registrations/changing', resource: resource)
3
3
  = render('effective/event_registrations/content', resource: resource)
4
4
 
5
- = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
6
- = f.hidden_field :id
5
+ = card do
6
+ = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
7
+ = f.hidden_field :id
7
8
 
8
- = card do
9
- = render('effective/event_registrations/fields_event_ticket_selections', form: f)
9
+ = render('effective/event_registrations/tickets_fields', form: f)
10
10
 
11
- = f.save 'Save and Continue'
11
+ = f.submit 'Save and Continue', left: true
@@ -58,6 +58,13 @@
58
58
  .effective-event-body.mb-5
59
59
  = @event.body.to_s
60
60
 
61
+ - if EffectiveEvents.code_of_conduct_enabled?
62
+ - page = EffectiveEvents.code_of_conduct_effective_page!
63
+
64
+ .effective-event-code-of-conduct.mb-4
65
+ View the
66
+ = link_to(page.title, effective_pages.page_path(page), target: '_blank')
67
+
61
68
  - if @event.registerable?
62
69
  .register.mb-4
63
70
  - url = @event.external_registration_url.presence || effective_events.new_event_event_registration_path(@event)
@@ -29,6 +29,12 @@ EffectiveEvents.setup do |config|
29
29
  # Hint text for event images attachments
30
30
  config.events_hint_text = 'Optional. Shown on the events index and event pages. Dimensions are 220px tall and 350px wide.'
31
31
 
32
+ # Code of Conduct
33
+ # Enable the code of conduct checkbox on the event registration wizard
34
+ # Create an Effective::Page for the code of conduct with this slug.
35
+ config.code_of_conduct_enabled = false
36
+ config.code_of_conduct_slug = 'event-code-of-conduct'
37
+
32
38
  # Mailer Settings
33
39
  # Please see config/initializers/effective_resources.rb for default effective_* gem mailer settings
34
40
  #
@@ -1,3 +1,3 @@
1
1
  module EffectiveEvents
2
- VERSION = '2.33.3'.freeze
2
+ VERSION = '2.35.0'.freeze
3
3
  end
@@ -11,6 +11,7 @@ module EffectiveEvents
11
11
  :mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_admin, :mailer_subject,
12
12
  :layout, :per_page, :use_effective_roles, :categories, :events_hint_text,
13
13
  :organization_enabled, :create_users, :company_or_organization_required,
14
+ :code_of_conduct_enabled, :code_of_conduct_slug,
14
15
  :event_registration_class_name
15
16
  ]
16
17
  end
@@ -34,6 +35,22 @@ module EffectiveEvents
34
35
  organization_enabled == true
35
36
  end
36
37
 
38
+ def self.code_of_conduct_enabled?
39
+ code_of_conduct_enabled == true
40
+ end
41
+
42
+ def self.code_of_conduct_effective_page
43
+ return unless defined?(Effective::Page)
44
+ Effective::Page.where(slug: code_of_conduct_slug).first
45
+ end
46
+
47
+ def self.code_of_conduct_effective_page!
48
+ page = code_of_conduct_effective_page()
49
+ raise("The Effective::Page for slug \"#{code_of_conduct_slug}\" does not exist. Please create it.") if page.blank?
50
+
51
+ page
52
+ end
53
+
37
54
  # If we can create delayed payment events at all
38
55
  def self.delayed?
39
56
  !!EffectiveOrders.try(:delayed?)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_events
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.33.3
4
+ version: 2.35.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: 2025-07-15 00:00:00.000000000 Z
11
+ date: 2025-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -270,20 +270,23 @@ files:
270
270
  - app/views/effective/event_registrants/_fields.html.haml
271
271
  - app/views/effective/event_registrations/_addons.html.haml
272
272
  - app/views/effective/event_registrations/_changing.html.haml
273
+ - app/views/effective/event_registrations/_code_of_conduct.html.haml
274
+ - app/views/effective/event_registrations/_code_of_conduct_fields.html.haml
273
275
  - app/views/effective/event_registrations/_content.html.haml
274
276
  - app/views/effective/event_registrations/_dashboard.html.haml
275
277
  - app/views/effective/event_registrations/_details.html.haml
278
+ - app/views/effective/event_registrations/_details_fields.html.haml
276
279
  - app/views/effective/event_registrations/_event_registration.html.haml
277
- - app/views/effective/event_registrations/_fields_event_registrants.html.haml
278
- - app/views/effective/event_registrations/_fields_event_ticket_selections.html.haml
279
280
  - app/views/effective/event_registrations/_form_blank_registrants.html.haml
280
281
  - app/views/effective/event_registrations/_layout.html.haml
281
282
  - app/views/effective/event_registrations/_orders.html.haml
282
283
  - app/views/effective/event_registrations/_summary.html.haml
283
284
  - app/views/effective/event_registrations/_tickets.html.haml
285
+ - app/views/effective/event_registrations/_tickets_fields.html.haml
284
286
  - app/views/effective/event_registrations/addons.html.haml
285
287
  - app/views/effective/event_registrations/billing.html.haml
286
288
  - app/views/effective/event_registrations/checkout.html.haml
289
+ - app/views/effective/event_registrations/code_of_conduct.html.haml
287
290
  - app/views/effective/event_registrations/complete.html.haml
288
291
  - app/views/effective/event_registrations/details.html.haml
289
292
  - app/views/effective/event_registrations/start.html.haml