effective_events 0.15.1 → 0.17.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.
- checksums.yaml +4 -4
- data/app/datatables/admin/effective_event_tickets_datatable.rb +5 -4
- data/app/datatables/admin/effective_events_datatable.rb +7 -2
- data/app/mailers/effective/events_mailer.rb +1 -1
- data/app/models/effective/event.rb +8 -20
- data/app/models/effective/event_notification.rb +2 -0
- data/app/models/effective/event_registrant.rb +40 -15
- data/app/models/effective/event_ticket.rb +0 -1
- data/app/views/admin/event_addons/_form.html.haml +10 -5
- data/app/views/admin/event_registrants/_form.html.haml +10 -6
- data/app/views/admin/event_tickets/_form.html.haml +3 -4
- data/app/views/admin/events/_form_event.html.haml +10 -4
- data/app/views/effective/event_registrants/_fields.html.haml +0 -4
- data/app/views/effective/event_registrants/_fields_member_only.html.haml +10 -3
- data/app/views/effective/event_registrants/_fields_member_or_non_member.html.haml +10 -3
- data/app/views/effective/event_registrants/_fields_regular.html.haml +3 -3
- data/app/views/effective/event_registrations/_event_tickets.html.haml +1 -1
- data/app/views/effective/event_registrations/checkout.html.haml +2 -3
- data/app/views/effective/event_registrations/submitted.html.haml +2 -2
- data/config/effective_events.rb +4 -0
- data/config/routes.rb +2 -0
- data/db/migrate/101_create_effective_events.rb +3 -3
- data/db/seeds.rb +1 -1
- data/lib/effective_events/version.rb +1 -1
- data/lib/effective_events.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6adf869c67bd082b19c66a82b5e3ac530a80b97c19e0047f13bdca69f7f1a98e
|
4
|
+
data.tar.gz: a1d8cd3df41996b18c2afcf4f2370a69e9d2b353e3bf3ca356808f3802ade723
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5cb43f659f86669874ea2edca7aa0159aad83c25a85065d2c69ee10d4aaf8392ea8aa1ebc3a171ab95b40f93e8ec3dd2e59aeb9161c8957a94aab60d5247e26
|
7
|
+
data.tar.gz: aba17ab942159ea4b5b0cf9c62511f876dbd54b56a864ce584115c07ce2bcd01c02310ceebadafb3548a983b9eeebddd1ccd55dfccde669c231152a35c67c9a8
|
@@ -18,10 +18,14 @@ module Admin
|
|
18
18
|
col :title
|
19
19
|
col :category, visible: false
|
20
20
|
|
21
|
-
col :early_bird_price, as: :price, visible: event
|
21
|
+
col :early_bird_price, as: :price, visible: event&.early_bird_end_at.present?
|
22
22
|
col :regular_price, as: :price
|
23
23
|
col :member_price, as: :price
|
24
24
|
|
25
|
+
col :waitlist
|
26
|
+
col :capacity_available, visible: false
|
27
|
+
col :capacity, label: 'Capacity Total', visible: false
|
28
|
+
|
25
29
|
col :capacity_to_s, label: 'Capacity' do |ticket|
|
26
30
|
if ticket.capacity.present? && ticket.waitlist?
|
27
31
|
"#{ticket.capacity_available} remaining / #{ticket.capacity} total. #{ticket.waitlisted_event_registrants_count} waitlisted."
|
@@ -44,9 +48,6 @@ module Admin
|
|
44
48
|
event.event_registrants.purchased.unarchived.count
|
45
49
|
end
|
46
50
|
|
47
|
-
col :capacity_available, visible: false
|
48
|
-
col :capacity, label: 'Capacity Total', visible: false
|
49
|
-
col :waitlist, visible: false
|
50
51
|
|
51
52
|
col :question1, visible: false
|
52
53
|
col :question2, visible: false
|
@@ -4,7 +4,7 @@ module Admin
|
|
4
4
|
scope :all
|
5
5
|
scope :registerable
|
6
6
|
scope :published
|
7
|
-
scope :
|
7
|
+
scope :draft
|
8
8
|
scope :upcoming
|
9
9
|
scope :past
|
10
10
|
end
|
@@ -19,7 +19,12 @@ module Admin
|
|
19
19
|
end
|
20
20
|
|
21
21
|
col :slug, visible: false
|
22
|
-
|
22
|
+
|
23
|
+
col :draft?, as: :boolean, visible: false
|
24
|
+
col :published?, as: :boolean
|
25
|
+
col :published_start_at
|
26
|
+
col :published_end_at
|
27
|
+
|
23
28
|
col :start_at, label: 'Start', visible: false
|
24
29
|
col :end_at, label: 'End', visible: false
|
25
30
|
col :excerpt, visible: false
|
@@ -8,7 +8,7 @@ module Effective
|
|
8
8
|
raise('expected an Effective::EventRegistrant') unless resource.kind_of?(Effective::EventRegistrant)
|
9
9
|
|
10
10
|
@assigns = assigns_for(resource)
|
11
|
-
mail(to: resource.
|
11
|
+
mail(to: resource.member_email, **headers_for(resource, opts))
|
12
12
|
end
|
13
13
|
|
14
14
|
protected
|
@@ -41,10 +41,11 @@ module Effective
|
|
41
41
|
|
42
42
|
has_one_attached :file
|
43
43
|
|
44
|
+
acts_as_role_restricted if respond_to?(:acts_as_role_restricted)
|
45
|
+
acts_as_published
|
44
46
|
acts_as_slugged
|
45
|
-
log_changes if respond_to?(:log_changes)
|
46
47
|
acts_as_tagged if respond_to?(:acts_as_tagged)
|
47
|
-
|
48
|
+
log_changes if respond_to?(:log_changes)
|
48
49
|
|
49
50
|
effective_resource do
|
50
51
|
title :string
|
@@ -52,8 +53,9 @@ module Effective
|
|
52
53
|
category :string
|
53
54
|
slug :string
|
54
55
|
|
55
|
-
|
56
|
-
|
56
|
+
published_start_at :datetime
|
57
|
+
published_end_at :datetime
|
58
|
+
legacy_draft :boolean # No longer used. To be removed.
|
57
59
|
|
58
60
|
start_at :datetime
|
59
61
|
end_at :datetime
|
@@ -87,9 +89,6 @@ module Effective
|
|
87
89
|
base
|
88
90
|
}
|
89
91
|
|
90
|
-
scope :published, -> { where(draft: false).where(arel_table[:published_at].lt(Time.zone.now)) }
|
91
|
-
scope :unpublished, -> { where(draft: true).or(where(arel_table[:published_at].gteq(Time.zone.now))) }
|
92
|
-
|
93
92
|
scope :upcoming, -> { where(arel_table[:end_at].gt(Time.zone.now)) }
|
94
93
|
scope :past, -> { where(arel_table[:end_at].lteq(Time.zone.now)) }
|
95
94
|
|
@@ -136,7 +135,6 @@ module Effective
|
|
136
135
|
scope :delayed_payment_date_upcoming, -> { delayed.where(arel_table[:delayed_payment_date].gt(Time.zone.today)) }
|
137
136
|
|
138
137
|
validates :title, presence: true, length: { maximum: 255 }
|
139
|
-
validates :published_at, presence: true, unless: -> { draft? }
|
140
138
|
validates :start_at, presence: true
|
141
139
|
validates :end_at, presence: true
|
142
140
|
validates :external_registration_url, url: true
|
@@ -168,10 +166,6 @@ module Effective
|
|
168
166
|
errors.add(:delayed_payment, 'no delayed payment processor available') unless EffectiveOrders.try(:delayed?)
|
169
167
|
end
|
170
168
|
|
171
|
-
validate(if: -> { delayed_payment_date && registration_end_at }) do
|
172
|
-
errors.add(:delayed_payment_date, 'must be after registration end date') unless registration_end_at < delayed_payment_date
|
173
|
-
end
|
174
|
-
|
175
169
|
validate(if: -> { file.attached? }) do
|
176
170
|
errors.add(:file, 'must be an image') unless file.image?
|
177
171
|
end
|
@@ -196,13 +190,6 @@ module Effective
|
|
196
190
|
event_tickets.any? { |et| et.waitlist? }
|
197
191
|
end
|
198
192
|
|
199
|
-
def published?
|
200
|
-
return false if draft?
|
201
|
-
return false if published_at.blank?
|
202
|
-
|
203
|
-
published_at < Time.zone.now
|
204
|
-
end
|
205
|
-
|
206
193
|
def registerable?
|
207
194
|
return false unless published?
|
208
195
|
return false if closed?
|
@@ -247,10 +234,11 @@ module Effective
|
|
247
234
|
Event.new(attributes.except('id', 'updated_at', 'created_at')).tap do |event|
|
248
235
|
event.title = event.title + ' (Copy)'
|
249
236
|
event.slug = event.slug + '-copy'
|
250
|
-
event.draft = true
|
251
237
|
|
252
238
|
event.rich_text_body = rich_text_body
|
253
239
|
event.rich_text_excerpt = rich_text_excerpt
|
240
|
+
|
241
|
+
event.assign_attributes(published_start_at: nil, published_end_at: nil)
|
254
242
|
end
|
255
243
|
end
|
256
244
|
|
@@ -150,6 +150,8 @@ module Effective
|
|
150
150
|
update_column(:started_at, Time.zone.now)
|
151
151
|
|
152
152
|
event_registrants.each do |event_registrant|
|
153
|
+
next if event_registrant.member_email.blank?
|
154
|
+
|
153
155
|
begin
|
154
156
|
EffectiveEvents.send_email(email_template, event_registrant, email_notification_params)
|
155
157
|
rescue => e
|
@@ -32,7 +32,6 @@ module Effective
|
|
32
32
|
company :string
|
33
33
|
|
34
34
|
blank_registrant :boolean
|
35
|
-
member_registrant :boolean
|
36
35
|
|
37
36
|
waitlisted :boolean
|
38
37
|
promoted :boolean # An admin marked this registrant as promoted from the waitlist
|
@@ -59,8 +58,6 @@ module Effective
|
|
59
58
|
|
60
59
|
scope :sorted, -> { order(:last_name) }
|
61
60
|
scope :deep, -> { includes(:event, :event_ticket, :owner) }
|
62
|
-
|
63
|
-
#scope :registered, -> { purchased_or_deferred.unarchived }
|
64
61
|
scope :registered, -> { where.not(registered_at: nil) }
|
65
62
|
|
66
63
|
before_validation(if: -> { event_registration.present? }) do
|
@@ -69,7 +66,7 @@ module Effective
|
|
69
66
|
end
|
70
67
|
|
71
68
|
before_validation(if: -> { blank_registrant? }) do
|
72
|
-
assign_attributes(user: nil, first_name: nil, last_name: nil, email: nil)
|
69
|
+
assign_attributes(user: nil, first_name: nil, last_name: nil, email: nil, company: nil)
|
73
70
|
end
|
74
71
|
|
75
72
|
before_validation(if: -> { user.present? }) do
|
@@ -89,22 +86,24 @@ module Effective
|
|
89
86
|
validates :email, email: true
|
90
87
|
|
91
88
|
# Member Only Ticket
|
92
|
-
with_options(if: -> { event_ticket&.member_only?
|
89
|
+
with_options(if: -> { event_ticket&.member_only? && present_registrant? }) do
|
93
90
|
validates :user_id, presence: { message: 'Please select a member' }
|
94
91
|
end
|
95
92
|
|
96
93
|
# Regular Ticket
|
97
|
-
with_options(if: -> { event_ticket&.regular?
|
98
|
-
validates :first_name, presence: true
|
99
|
-
validates :last_name, presence: true
|
100
|
-
validates :email, presence: true
|
94
|
+
with_options(if: -> { event_ticket&.regular? && present_registrant? }) do
|
95
|
+
validates :first_name, presence: true, unless: -> { EffectiveEvents.event_registrant_required_fields.exclude?(:first_name) }
|
96
|
+
validates :last_name, presence: true, unless: -> { EffectiveEvents.event_registrant_required_fields.exclude?(:last_name) }
|
97
|
+
validates :email, presence: true, unless: -> { EffectiveEvents.event_registrant_required_fields.exclude?(:email) }
|
98
|
+
validates :company, presence: true, unless: -> { EffectiveEvents.event_registrant_required_fields.exclude?(:company) }
|
101
99
|
end
|
102
100
|
|
103
|
-
with_options(if: -> { event_ticket&.member_or_non_member? &&
|
104
|
-
validates :user_id, presence: { message: 'Please select a member' }, unless: -> { first_name.present? || last_name.present?
|
105
|
-
validates :first_name, presence: true, unless: -> { user.present? }
|
106
|
-
validates :last_name, presence: true, unless: -> { user.present? }
|
107
|
-
validates :email, presence: true, unless: -> { user.present? }
|
101
|
+
with_options(if: -> { event_ticket&.member_or_non_member? && present_registrant? }) do
|
102
|
+
validates :user_id, presence: { message: 'Please select a member' }, unless: -> { first_name.present? || last_name.present? }
|
103
|
+
validates :first_name, presence: true, unless: -> { user.present? || EffectiveEvents.event_registrant_required_fields.exclude?(:first_name) }
|
104
|
+
validates :last_name, presence: true, unless: -> { user.present? || EffectiveEvents.event_registrant_required_fields.exclude?(:last_name) }
|
105
|
+
validates :email, presence: true, unless: -> { user.present? || EffectiveEvents.event_registrant_required_fields.exclude?(:email) }
|
106
|
+
validates :company, presence: true, unless: -> { user.present? || EffectiveEvents.event_registrant_required_fields.exclude?(:company) }
|
108
107
|
end
|
109
108
|
|
110
109
|
after_defer do
|
@@ -138,7 +137,15 @@ module Effective
|
|
138
137
|
end
|
139
138
|
|
140
139
|
def member_present?
|
141
|
-
user&.is?(:member)
|
140
|
+
user&.is?(:member)
|
141
|
+
end
|
142
|
+
|
143
|
+
def member_email
|
144
|
+
email.presence || user&.email
|
145
|
+
end
|
146
|
+
|
147
|
+
def present_registrant?
|
148
|
+
!blank_registrant?
|
142
149
|
end
|
143
150
|
|
144
151
|
def tax_exempt
|
@@ -164,6 +171,24 @@ module Effective
|
|
164
171
|
registered!
|
165
172
|
end
|
166
173
|
|
174
|
+
def waitlist!
|
175
|
+
raise('expected a waitlist? event_ticket') unless event_ticket.waitlist?
|
176
|
+
|
177
|
+
update!(waitlisted: true)
|
178
|
+
orders.reject(&:purchased?).each { |order| order.update_purchasable_attributes! }
|
179
|
+
|
180
|
+
true
|
181
|
+
end
|
182
|
+
|
183
|
+
def unwaitlist!
|
184
|
+
raise('expected a waitlist? event_ticket') unless event_ticket.waitlist?
|
185
|
+
|
186
|
+
update!(waitlisted: false)
|
187
|
+
orders.reject(&:purchased?).each { |order| order.update_purchasable_attributes! }
|
188
|
+
|
189
|
+
true
|
190
|
+
end
|
191
|
+
|
167
192
|
def promote!
|
168
193
|
raise('expected a waitlist? event_ticket') unless event_ticket.waitlist?
|
169
194
|
|
@@ -68,7 +68,6 @@ module Effective
|
|
68
68
|
validates :early_bird_price, numericality: { greater_than_or_equal_to: 0, allow_blank: true }
|
69
69
|
|
70
70
|
validates :capacity, numericality: { greater_than_or_equal_to: 0, allow_blank: true }
|
71
|
-
validates :capacity, numericality: { greater_than_or_equal_to: 1, message: 'must have a non-zero capacity when using waitlist' }, if: -> { waitlist? }
|
72
71
|
|
73
72
|
def to_s
|
74
73
|
title.presence || 'New Event Ticket'
|
@@ -1,4 +1,10 @@
|
|
1
1
|
= effective_form_with(model: [:admin, event_addon], engine: true) do |f|
|
2
|
+
- if inline_datatable?
|
3
|
+
= f.hidden_field :event_id
|
4
|
+
- else
|
5
|
+
= f.select :event_id, Effective::Event.sorted.all,
|
6
|
+
'data-load-ajax-url': effective_events.new_admin_event_addon_path,
|
7
|
+
'data-load-ajax-div': '#effective-events-event-addon-ajax'
|
2
8
|
= f.hidden_field :event_id
|
3
9
|
|
4
10
|
- if f.object.new_record?
|
@@ -11,11 +17,10 @@
|
|
11
17
|
- else
|
12
18
|
= f.static_field :owner
|
13
19
|
|
14
|
-
|
20
|
+
#effective-events-event-addon-ajax
|
21
|
+
- if f.object.event.present?
|
22
|
+
= render 'admin/event_addons/fields', f: f, event: event_addon.event
|
15
23
|
|
16
24
|
= f.check_box :archived, label: "Archive this addon. It will be displayed as archived on the owner's event registration"
|
17
25
|
|
18
|
-
|
19
|
-
= f.submit 'Save and Mark Registered'
|
20
|
-
- else
|
21
|
-
= f.submit 'Save'
|
26
|
+
= f.submit 'Save'
|
@@ -1,5 +1,10 @@
|
|
1
1
|
= effective_form_with(model: [:admin, event_registrant], engine: true) do |f|
|
2
|
-
|
2
|
+
- if inline_datatable?
|
3
|
+
= f.hidden_field :event_id
|
4
|
+
- else
|
5
|
+
= f.select :event_id, Effective::Event.sorted.all,
|
6
|
+
'data-load-ajax-url': effective_events.new_admin_event_registrant_path,
|
7
|
+
'data-load-ajax-div': '#effective-events-event-registrant-ajax'
|
3
8
|
|
4
9
|
- if f.object.new_record?
|
5
10
|
-# User
|
@@ -13,11 +18,10 @@
|
|
13
18
|
|
14
19
|
= f.datetime_field :registered_at, required: true
|
15
20
|
|
16
|
-
|
21
|
+
#effective-events-event-registrant-ajax
|
22
|
+
- if f.object.event.present?
|
23
|
+
= render 'effective/event_registrants/fields', f: f, event: event_registrant.event, namespace: :admin
|
17
24
|
|
18
25
|
= f.check_box :archived, label: "Archive this registrant. It will be displayed as archived on the owner's event registration"
|
19
26
|
|
20
|
-
|
21
|
-
= f.submit 'Save and Mark Registered'
|
22
|
-
- else
|
23
|
-
= f.submit 'Save'
|
27
|
+
= f.submit 'Save'
|
@@ -11,18 +11,17 @@
|
|
11
11
|
= f.show_if(:category, 'Regular') do
|
12
12
|
.alert.alert-info.mb-4
|
13
13
|
%strong Regular Ticket:
|
14
|
-
Anyone will be able to purchase this ticket. They will be asked for a first
|
14
|
+
Anyone will be able to purchase this ticket. They will be asked for a first and last name. Will not display the dropdown list of all members. Only the regular price applies.
|
15
15
|
|
16
16
|
= f.show_if(:category, 'Member Only') do
|
17
17
|
.alert.alert-info.mb-4
|
18
18
|
%strong Member Only Ticket:
|
19
|
-
Only members will be able to purchase this ticket. They must select a member from the dropdown list of
|
19
|
+
Only members will be able to purchase this ticket. They must select a member from the dropdown list of all members. Only the member price applies.
|
20
20
|
|
21
21
|
= f.show_if(:category, 'Member or Non-Member') do
|
22
22
|
.alert.alert-info.mb-4
|
23
23
|
%strong Member or Non-Member Ticket:
|
24
|
-
Anyone will be able to purchase this ticket. They can select a member from the dropdown list of
|
25
|
-
Or, they can enter a first name, last name and email to receive the regular pricing.
|
24
|
+
Anyone will be able to purchase this ticket. They can select a member from the dropdown list of all members to receive the member pricing or they can enter a first name and last name to receive the regular pricing.
|
26
25
|
|
27
26
|
.col
|
28
27
|
= f.number_field :capacity, hint: "The number of registrations will be limited to capacity.<br>Leave blank for unlimited capacity."
|
@@ -1,6 +1,16 @@
|
|
1
1
|
= effective_form_with(model: [:admin, event], engine: true) do |f|
|
2
2
|
= f.text_field :title, label: "Title"
|
3
3
|
|
4
|
+
-# acts_as_published
|
5
|
+
= f.hide_if(:save_as_draft, true) do
|
6
|
+
.row
|
7
|
+
.col-md-6
|
8
|
+
= f.datetime_field :published_start_at, hint: 'The event will be available starting on this date and time. Leave blank to use the current date and time.'
|
9
|
+
.col-md-6
|
10
|
+
= f.datetime_field :published_end_at, hint: 'The event will no longer be available after this date and time. Leave blank for no end date.', date_linked: false
|
11
|
+
|
12
|
+
= f.check_box :save_as_draft, label: "Save as a draft. It will not appear on the website and can only be accessed by admin users."
|
13
|
+
|
4
14
|
- if f.object.persisted? || f.object.errors.include?(:slug)
|
5
15
|
- current_url = (effective_events.event_url(f.object) rescue nil)
|
6
16
|
= f.text_field :slug, hint: "The slug controls this event's internet address. Be careful, changing the slug will break links that other websites may have to the old address.<br>#{('This event is currently reachable via ' + link_to(current_url.gsub(f.object.slug, '<strong>' + f.object.slug + '</strong>').html_safe, current_url)) if current_url }".html_safe
|
@@ -14,10 +24,6 @@
|
|
14
24
|
- if event.class.respond_to?(:acts_as_tagged?)
|
15
25
|
= render 'effective/tags/fields', f: f
|
16
26
|
|
17
|
-
= f.check_box :draft, hint: 'Save this event as a draft. It will not be accessible on the website.'
|
18
|
-
.row
|
19
|
-
.col-md-6= f.datetime_field :published_at, label: 'Publish date', hint: 'When should this be displayed on the website.'
|
20
|
-
|
21
27
|
.row
|
22
28
|
.col-md-6= f.datetime_field :start_at, label: "Event Start"
|
23
29
|
.col-md-6= f.datetime_field :end_at, label: "Event End"
|
@@ -17,10 +17,6 @@
|
|
17
17
|
- else
|
18
18
|
= f.hidden_field :blank_registrant, value: false
|
19
19
|
|
20
|
-
- if ticket.member_or_non_member?
|
21
|
-
= f.show_if(:blank_registrant, true, nested: true) do
|
22
|
-
= f.check_box :member_registrant, label: 'Yes, this ticket will be for a member'
|
23
|
-
|
24
20
|
= f.show_if(:blank_registrant, false, nested: true) do
|
25
21
|
%hr
|
26
22
|
|
@@ -1,3 +1,10 @@
|
|
1
|
-
- # Choose member
|
2
|
-
= f.
|
3
|
-
=
|
1
|
+
- # Choose ANY member
|
2
|
+
- klass = (f.object.user || current_user).class
|
3
|
+
- ajax_url = (@select2_users_ajax_path || effective_memberships.member_users_membership_select2_ajax_index_path) unless Rails.env.test?
|
4
|
+
|
5
|
+
= f.hidden_field :user_type, value: klass.name
|
6
|
+
= f.select :user_id, klass.all, ajax_url: ajax_url, label: 'Member', required: true, hint: effective_events_event_registrant_user_hint()
|
7
|
+
|
8
|
+
- # Choose RELATED ORGANIZATION member
|
9
|
+
-# = f.hidden_field :user_type, value: current_user.class.name
|
10
|
+
-# = f.select :user_id, effective_events_event_registrant_user_collection(f.object), required: true, hint: effective_events_event_registrant_user_hint()
|
@@ -1,6 +1,13 @@
|
|
1
|
-
- # Choose member
|
2
|
-
= f.
|
3
|
-
=
|
1
|
+
- # Choose ANY member
|
2
|
+
- klass = (f.object.user || current_user).class
|
3
|
+
- ajax_url = (@select2_users_ajax_path || effective_memberships.member_users_membership_select2_ajax_index_path) unless Rails.env.test?
|
4
|
+
|
5
|
+
= f.hidden_field :user_type, value: klass.name
|
6
|
+
= f.select :user_id, klass.all, ajax_url: ajax_url, label: 'Member', hint: effective_events_event_registrant_user_hint()
|
7
|
+
|
8
|
+
- # Choose RELATED ORGANIZATION member
|
9
|
+
-# = f.hidden_field :user_type, value: current_user.class.name
|
10
|
+
-# = f.select :user_id, effective_events_event_registrant_user_collection(f.object), hint: effective_events_event_registrant_user_hint()
|
4
11
|
|
5
12
|
= f.show_if(:user_id, '', nested: true) do
|
6
13
|
%p.text-center - or -
|
@@ -1,8 +1,8 @@
|
|
1
1
|
- # Choose non-member
|
2
2
|
.row
|
3
|
-
.col-md= f.text_field :first_name
|
4
|
-
.col-md= f.text_field :last_name
|
3
|
+
.col-md= f.text_field :first_name
|
4
|
+
.col-md= f.text_field :last_name
|
5
5
|
|
6
6
|
.row
|
7
|
-
.col-md= f.email_field :email
|
7
|
+
.col-md= f.email_field :email
|
8
8
|
.col-md= f.text_field :company
|
@@ -3,17 +3,16 @@
|
|
3
3
|
|
4
4
|
- if resource.submit_order.deferred?
|
5
5
|
= card do
|
6
|
-
= render_checkout_step2(resource.submit_order, purchased_url: wizard_path(:complete), deferred_url: wizard_path(:submitted), declined_url: wizard_path(:checkout)
|
6
|
+
= render_checkout_step2(resource.submit_order, purchased_url: wizard_path(:complete), deferred_url: wizard_path(:submitted), declined_url: wizard_path(:checkout))
|
7
7
|
- elsif resource.event.registerable? == false
|
8
8
|
.alert.alert-danger Your selected event is no longer available for registration.
|
9
9
|
- elsif resource.unavailable_event_tickets.present?
|
10
10
|
.alert.alert-danger Your selected number of event tickets are no longer available.
|
11
11
|
- elsif resource.unavailable_event_products.present?
|
12
12
|
.alert.alert-danger Your selected number of event add-ons are no longer available.
|
13
|
-
|
14
13
|
- else
|
15
14
|
= card do
|
16
|
-
= render_checkout_step2(resource.submit_order, purchased_url: wizard_path(:complete), deferred_url: wizard_path(:submitted), declined_url: wizard_path(:checkout)
|
15
|
+
= render_checkout_step2(resource.submit_order, purchased_url: wizard_path(:complete), deferred_url: wizard_path(:submitted), declined_url: wizard_path(:checkout))
|
17
16
|
|
18
17
|
- if resource.submit_order.delayed? && resource.submit_order.deferred?
|
19
18
|
= link_to 'Save and Continue', wizard_path(:submitted), class: 'btn btn-primary'
|
@@ -4,8 +4,8 @@
|
|
4
4
|
- raise('expected a submitted event_registration') unless resource.submitted?
|
5
5
|
- raise('expected a deffered event_registration submit_order') unless resource.submit_order&.deferred?
|
6
6
|
|
7
|
-
- if resource.event.delayed?
|
8
|
-
|
7
|
+
-# - if resource.event.delayed?
|
8
|
+
-# - raise('expected event delayed_payment_date to match order delayed_payment_date') unless resource.event.delayed_payment_date == resource.submit_order.delayed_payment_date
|
9
9
|
|
10
10
|
.mb-4
|
11
11
|
= link_to "Return to Dashboard", return_to_dashboard_path, class: 'btn btn-lg btn-primary btn-block'
|
data/config/effective_events.rb
CHANGED
@@ -18,6 +18,10 @@ EffectiveEvents.setup do |config|
|
|
18
18
|
# Hint text for event images attachments
|
19
19
|
config.events_hint_text = 'Hint text that includes required image dimensions'
|
20
20
|
|
21
|
+
# Validations for Event Registrants
|
22
|
+
# config.event_registrant_required_fields = [:first_name, :last_name, :email, :company]
|
23
|
+
config.event_registrant_required_fields = [:first_name, :last_name, :email]
|
24
|
+
|
21
25
|
# Mailer Settings
|
22
26
|
# Please see config/initializers/effective_resources.rb for default effective_* gem mailer settings
|
23
27
|
#
|
data/config/routes.rb
CHANGED
@@ -44,6 +44,8 @@ EffectiveEvents::Engine.routes.draw do
|
|
44
44
|
resources :event_registrants, except: [:show] do
|
45
45
|
post :promote, on: :member
|
46
46
|
post :unpromote, on: :member
|
47
|
+
post :waitlist, on: :member
|
48
|
+
post :unwaitlist, on: :member
|
47
49
|
|
48
50
|
post :archive, on: :member
|
49
51
|
post :unarchive, on: :member
|
@@ -6,8 +6,9 @@ class CreateEffectiveEvents < ActiveRecord::Migration[6.0]
|
|
6
6
|
t.string :category
|
7
7
|
t.string :slug
|
8
8
|
|
9
|
-
t.
|
10
|
-
t.datetime :
|
9
|
+
t.datetime :published_start_at
|
10
|
+
t.datetime :published_end_at
|
11
|
+
t.boolean :legacy_draft, default: false
|
11
12
|
|
12
13
|
t.datetime :start_at
|
13
14
|
t.datetime :end_at
|
@@ -83,7 +84,6 @@ class CreateEffectiveEvents < ActiveRecord::Migration[6.0]
|
|
83
84
|
t.text :notes
|
84
85
|
|
85
86
|
t.boolean :blank_registrant, default: false
|
86
|
-
t.boolean :member_registrant, default: false
|
87
87
|
|
88
88
|
t.boolean :waitlisted, default: false
|
89
89
|
t.boolean :promoted, default: false
|
data/db/seeds.rb
CHANGED
@@ -13,7 +13,7 @@ event = Effective::Event.create!(
|
|
13
13
|
rich_text_excerpt: '<p>This is a great event</p>',
|
14
14
|
rich_text_body: '<p>This is a really great event!</p>',
|
15
15
|
|
16
|
-
|
16
|
+
published_start_at: Time.zone.now,
|
17
17
|
start_at: (now + 1.week),
|
18
18
|
end_at: (now + 1.week + 1.hour),
|
19
19
|
|
data/lib/effective_events.rb
CHANGED
@@ -9,7 +9,7 @@ module EffectiveEvents
|
|
9
9
|
:events_table_name, :event_registrants_table_name, :event_tickets_table_name,
|
10
10
|
:event_registrations_table_name, :event_products_table_name, :event_addons_table_name, :event_notifications_table_name,
|
11
11
|
:mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_admin, :mailer_subject,
|
12
|
-
:layout, :per_page, :use_effective_roles, :categories, :events_hint_text,
|
12
|
+
:layout, :per_page, :use_effective_roles, :categories, :events_hint_text, :event_registrant_required_fields,
|
13
13
|
:event_registration_class_name
|
14
14
|
]
|
15
15
|
end
|
@@ -28,4 +28,8 @@ module EffectiveEvents
|
|
28
28
|
Array(config[:categories]) - [nil, false, '']
|
29
29
|
end
|
30
30
|
|
31
|
+
def event_registrant_required_fields
|
32
|
+
(Array(config[:event_registrant_required_fields]) - [nil, false, '']).map(&:to_sym)
|
33
|
+
end
|
34
|
+
|
31
35
|
end
|
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: 0.
|
4
|
+
version: 0.17.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: 2024-
|
11
|
+
date: 2024-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|