effective_events 0.5.6 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/datatables/admin/effective_event_addons_datatable.rb +4 -0
- data/app/datatables/effective_event_addons_datatable.rb +9 -2
- data/app/datatables/effective_event_registrants_datatable.rb +6 -5
- data/app/datatables/effective_event_registrations_datatable.rb +8 -1
- data/app/models/concerns/effective_events_event_registration.rb +22 -4
- data/app/models/effective/event_addon.rb +24 -1
- data/app/views/effective/event_addons/_fields.html.haml +8 -1
- data/app/views/effective/event_registrants/_fields.html.haml +1 -1
- data/app/views/effective/event_registrations/addons.html.haml +1 -1
- data/app/views/effective/event_registrations/submitted.html.haml +2 -1
- data/config/effective_events.rb +1 -1
- data/db/migrate/01_create_effective_events.rb.erb +4 -0
- data/lib/effective_events/version.rb +1 -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: f65483dcf8a4afeea90171c934a922a5425dc9a11bff4e2494f52ed50be52c3c
|
4
|
+
data.tar.gz: 0542dd1e060b1026adcb8e1358b0a069eebce29e48daadd7fb22d6c5fdb12355
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f959bc908fb33c74d0a59802c9829533bd1363ceb2d34b3db456c011bef45654fbb0c485a2ff7c5e6cbac494fd1340a8ba45402e5a4eaaabb8840e510c98c041
|
7
|
+
data.tar.gz: 04350d65ef635616230e72cd86ef6ebd835d5943164133948c8ad5f8b8492bc713fbaf934c0b331b3292b74c782c0c21486bb09061028cd0e040ac844ea1107f
|
@@ -3,7 +3,11 @@
|
|
3
3
|
class EffectiveEventAddonsDatatable < Effective::Datatable
|
4
4
|
datatable do
|
5
5
|
|
6
|
-
col :
|
6
|
+
col :name do |er|
|
7
|
+
"#{er.first_name} #{er.last_name}<br><small>#{mail_to(er.email)}</small>"
|
8
|
+
end
|
9
|
+
|
10
|
+
col :event_product, search: :string, label: 'Add-on' do |er|
|
7
11
|
[
|
8
12
|
er.event_product.to_s,
|
9
13
|
(content_tag(:span, 'Archived', class: 'badge badge-warning') if er.event_product&.archived?)
|
@@ -12,9 +16,12 @@ class EffectiveEventAddonsDatatable < Effective::Datatable
|
|
12
16
|
|
13
17
|
col :price, as: :price
|
14
18
|
|
19
|
+
col :first_name, visible: false
|
20
|
+
col :last_name, visible: false
|
21
|
+
col :email, visible: false
|
22
|
+
|
15
23
|
col :archived, visible: false
|
16
24
|
|
17
|
-
# col :notes
|
18
25
|
# no actions_col
|
19
26
|
end
|
20
27
|
|
@@ -3,6 +3,10 @@
|
|
3
3
|
class EffectiveEventRegistrantsDatatable < Effective::Datatable
|
4
4
|
datatable do
|
5
5
|
|
6
|
+
col :name do |er|
|
7
|
+
"#{er.first_name} #{er.last_name}<br><small>#{mail_to(er.email)}</small>"
|
8
|
+
end
|
9
|
+
|
6
10
|
col :event_ticket, search: :string, label: 'Ticket' do |er|
|
7
11
|
[
|
8
12
|
er.event_ticket.to_s,
|
@@ -10,19 +14,16 @@ class EffectiveEventRegistrantsDatatable < Effective::Datatable
|
|
10
14
|
].compact.join('<br>').html_safe
|
11
15
|
end
|
12
16
|
|
13
|
-
col :name do |er|
|
14
|
-
"#{er.first_name} #{er.last_name}<br><small>#{mail_to(er.email)}</small>"
|
15
|
-
end
|
16
|
-
|
17
17
|
col :first_name, visible: false
|
18
18
|
col :last_name, visible: false
|
19
19
|
col :email, visible: false
|
20
20
|
col :company, visible: false
|
21
21
|
col :number, visible: false, label: 'Designations'
|
22
22
|
|
23
|
-
col :price, as: :price
|
24
23
|
col :notes
|
25
24
|
|
25
|
+
col :price, as: :price
|
26
|
+
|
26
27
|
col :archived, visible: false
|
27
28
|
|
28
29
|
# no actions_col
|
@@ -11,7 +11,7 @@ class EffectiveEventRegistrationsDatatable < Effective::Datatable
|
|
11
11
|
end
|
12
12
|
|
13
13
|
col :event, search: :string do |er|
|
14
|
-
er.event.to_s
|
14
|
+
link_to(er.event.to_s, effective_events.event_path(er.event))
|
15
15
|
end
|
16
16
|
|
17
17
|
col :owner, visible: false, search: :string
|
@@ -26,6 +26,13 @@ class EffectiveEventRegistrationsDatatable < Effective::Datatable
|
|
26
26
|
dropdown_link_to('Delete', effective_events.event_event_registration_path(er.event, er), 'data-confirm': "Really delete #{er}?", 'data-method': :delete)
|
27
27
|
else
|
28
28
|
dropdown_link_to('Show', effective_events.event_event_registration_path(er.event, er))
|
29
|
+
|
30
|
+
# Register Again
|
31
|
+
if er.event.registerable?
|
32
|
+
url = er.event.external_registration_url.presence || effective_events.new_event_event_registration_path(er.event)
|
33
|
+
dropdown_link_to('Register Again', url)
|
34
|
+
end
|
35
|
+
|
29
36
|
end
|
30
37
|
end
|
31
38
|
end
|
@@ -142,25 +142,43 @@ module EffectiveEventsEventRegistration
|
|
142
142
|
end
|
143
143
|
|
144
144
|
# Find or build. But it's not gonna work with more than 1. This is for testing only really.
|
145
|
-
def event_addon(event_product:)
|
146
|
-
addon = event_addons.find { |
|
147
|
-
addon || event_addons.build(event_product: event_product, owner: owner)
|
145
|
+
def event_addon(event_product:, first_name:, last_name:, email:)
|
146
|
+
addon = event_addons.find { |er| er.event_product == event_product && er.first_name == first_name && er.last_name == last_name && er.email == email }
|
147
|
+
addon || event_addons.build(event: event, event_product: event_product, owner: owner, first_name: first_name, last_name: last_name, email: email)
|
148
148
|
end
|
149
149
|
|
150
150
|
# This builds the default event registrants used by the wizard form
|
151
151
|
def build_event_registrants
|
152
152
|
if event_registrants.blank?
|
153
153
|
raise('expected owner and event to be present') unless owner && event
|
154
|
+
|
154
155
|
event_registrants.build(
|
155
156
|
first_name: owner.try(:first_name),
|
156
157
|
last_name: owner.try(:last_name),
|
157
|
-
email: owner.try(:email)
|
158
|
+
email: owner.try(:email),
|
159
|
+
company: owner.try(:company),
|
160
|
+
number: owner.try(:membership).try(:number) || owner.try(:number)
|
158
161
|
)
|
159
162
|
end
|
160
163
|
|
161
164
|
event_registrants
|
162
165
|
end
|
163
166
|
|
167
|
+
# This builds the default event addons used by the wizard form
|
168
|
+
def build_event_addons
|
169
|
+
if event_addons.blank?
|
170
|
+
raise('expected owner and event to be present') unless owner && event
|
171
|
+
|
172
|
+
event_addons.build(
|
173
|
+
first_name: owner.try(:first_name),
|
174
|
+
last_name: owner.try(:last_name),
|
175
|
+
email: owner.try(:email)
|
176
|
+
)
|
177
|
+
end
|
178
|
+
|
179
|
+
event_addons
|
180
|
+
end
|
181
|
+
|
164
182
|
private
|
165
183
|
|
166
184
|
def present_event_registrants
|
@@ -22,6 +22,10 @@ module Effective
|
|
22
22
|
belongs_to :event_registration, polymorphic: true, optional: true
|
23
23
|
|
24
24
|
effective_resource do
|
25
|
+
first_name :string
|
26
|
+
last_name :string
|
27
|
+
email :string
|
28
|
+
|
25
29
|
notes :text
|
26
30
|
|
27
31
|
archived :boolean
|
@@ -46,8 +50,27 @@ module Effective
|
|
46
50
|
self.price ||= event_product.price
|
47
51
|
end
|
48
52
|
|
53
|
+
with_options(if: -> { new_record? }) do
|
54
|
+
validates :first_name, presence: true
|
55
|
+
validates :last_name, presence: true
|
56
|
+
validates :email, presence: true, email: true
|
57
|
+
end
|
58
|
+
|
49
59
|
def to_s
|
50
|
-
persisted? ?
|
60
|
+
persisted? ? title : 'addon'
|
61
|
+
end
|
62
|
+
|
63
|
+
def title
|
64
|
+
return event_product.to_s unless first_name.present? && last_name.present?
|
65
|
+
"#{event_product} - #{last_first_name}"
|
66
|
+
end
|
67
|
+
|
68
|
+
def name
|
69
|
+
"#{first_name} #{last_name}"
|
70
|
+
end
|
71
|
+
|
72
|
+
def last_first_name
|
73
|
+
"#{last_name}, #{first_name}"
|
51
74
|
end
|
52
75
|
|
53
76
|
def tax_exempt
|
@@ -3,6 +3,13 @@
|
|
3
3
|
- if f.object.purchased?
|
4
4
|
= f.static_field :event_product, label: 'Purchased event add-ons'
|
5
5
|
- else
|
6
|
-
= f.select :event_product_id, effective_events_event_products_collection(event), label:
|
6
|
+
= f.select :event_product_id, effective_events_event_products_collection(event), label: 'Add-on'
|
7
|
+
|
8
|
+
.row
|
9
|
+
.col-lg= f.text_field :first_name, required: true
|
10
|
+
.col-lg= f.text_field :last_name, required: true
|
11
|
+
|
12
|
+
.row
|
13
|
+
.col-lg= f.email_field :email, required: true
|
7
14
|
|
8
15
|
-# = f.text_area :notes, label: 'Notes'
|
@@ -11,7 +11,7 @@
|
|
11
11
|
.row
|
12
12
|
.col-lg= f.text_field :first_name
|
13
13
|
.col-lg= f.text_field :last_name
|
14
|
-
.col-lg= f.text_field :number, label: 'Professional Designations', hint: '
|
14
|
+
.col-lg= f.text_field :number, label: 'Professional Designations', hint: 'member or registrant number'
|
15
15
|
|
16
16
|
.row
|
17
17
|
.col-lg= f.email_field :email
|
@@ -13,7 +13,7 @@
|
|
13
13
|
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
14
14
|
= f.hidden_field :id
|
15
15
|
|
16
|
-
= f.has_many :event_addons do |fp|
|
16
|
+
= f.has_many :event_addons, f.object.build_event_addons do |fp|
|
17
17
|
= render('effective/event_addons/fields', f: fp, event: f.object.event)
|
18
18
|
|
19
19
|
= f.save 'Save and Continue'
|
@@ -7,7 +7,8 @@
|
|
7
7
|
.alert.alert-warning.mb-4
|
8
8
|
Successfully paid on #{resource.submit_order.purchased_at.strftime('%F')}.
|
9
9
|
|
10
|
-
|
10
|
+
.mb-4
|
11
|
+
= link_to "Return to Dashboard", return_to_dashboard_path, class: 'btn btn-lg btn-primary btn-block'
|
11
12
|
|
12
13
|
= render 'effective/event_registrations/summary', event_registration: resource
|
13
14
|
= render 'effective/event_registrations/event_registration', event_registration: resource
|
data/config/effective_events.rb
CHANGED
@@ -11,7 +11,7 @@ EffectiveEvents.setup do |config|
|
|
11
11
|
# config.layout = { application: 'application', admin: 'admin' }
|
12
12
|
|
13
13
|
# Event Settings
|
14
|
-
# config.
|
14
|
+
# config.event_registration_class_name = 'Effective::EventRegistration'
|
15
15
|
|
16
16
|
# Pagination length on the Events#index page
|
17
17
|
config.per_page = 10
|
@@ -102,6 +102,10 @@ class CreateEffectiveEvents < ActiveRecord::Migration[6.0]
|
|
102
102
|
t.integer :event_registration_id
|
103
103
|
t.string :event_registration_type
|
104
104
|
|
105
|
+
t.string :first_name
|
106
|
+
t.string :last_name
|
107
|
+
t.string :email
|
108
|
+
|
105
109
|
t.text :notes
|
106
110
|
|
107
111
|
t.integer :purchased_order_id
|
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.6.1
|
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:
|
11
|
+
date: 2023-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|