effective_events 2.30.2 → 2.31.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_products_datatable.rb +2 -0
- data/app/datatables/admin/effective_event_registrants_datatable.rb +3 -1
- data/app/datatables/admin/effective_event_tickets_datatable.rb +8 -7
- data/app/datatables/admin/effective_events_datatable.rb +7 -0
- data/app/models/effective/event.rb +3 -0
- data/app/models/effective/event_addon.rb +2 -2
- data/app/models/effective/event_product.rb +1 -0
- data/app/models/effective/event_registrant.rb +4 -1
- data/app/models/effective/event_ticket.rb +22 -13
- 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: 8a36dc11b007f823f99ed956625b93e5e2431bc7c5aa7710edc2eb4ff812a858
|
4
|
+
data.tar.gz: 2d34832f0266bd9418cebc6588772103d2b25ae9f0aca411e1e77d3194791850
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a70510c44b6b475036dcc055de368a37bf90e1f107990d13383f1b33e443b0c0002cc443fd69a7d0e8d5a4e7b8748d44b431306047bcd31822cf12b63d3b8b9
|
7
|
+
data.tar.gz: d81d01a9babdfdb79f84eaead78770a05955c36d9cea477437515f0c66c8323cfb67a27d6e076c57894dbb36a1aff05e06b0e815088a4486a241af9ce4efea5b
|
@@ -16,7 +16,6 @@ module Admin
|
|
16
16
|
col :updated_at, visible: false
|
17
17
|
col :created_at, visible: false
|
18
18
|
col :id, visible: false
|
19
|
-
col :archived, visible: false
|
20
19
|
|
21
20
|
col :registered_at
|
22
21
|
|
@@ -45,9 +44,12 @@ module Admin
|
|
45
44
|
else
|
46
45
|
'-'
|
47
46
|
end
|
47
|
+
end.search do |collection, term|
|
48
|
+
EffectiveResources.truthy?(term) ? collection.waitlisted : collection.non_waitlisted
|
48
49
|
end
|
49
50
|
|
50
51
|
col :promoted, visible: false
|
52
|
+
col :archived, visible: false
|
51
53
|
|
52
54
|
col :name do |er|
|
53
55
|
if er.user.present?
|
@@ -1,14 +1,13 @@
|
|
1
1
|
module Admin
|
2
2
|
class EffectiveEventTicketsDatatable < Effective::Datatable
|
3
3
|
datatable do
|
4
|
-
|
4
|
+
order :title
|
5
5
|
|
6
6
|
col :updated_at, visible: false
|
7
7
|
col :created_at, visible: false
|
8
8
|
col :id, visible: false
|
9
9
|
col :archived
|
10
10
|
|
11
|
-
|
12
11
|
col :event
|
13
12
|
col :title
|
14
13
|
col :category, visible: false
|
@@ -49,12 +48,12 @@ module Admin
|
|
49
48
|
if ticket.capacity.present?
|
50
49
|
"
|
51
50
|
#{ticket.capacity} capacity<br />
|
52
|
-
#{ticket.
|
53
|
-
#{ticket.
|
54
|
-
#{ticket.
|
51
|
+
#{ticket.registered_non_waitlisted_count} registered<br />
|
52
|
+
#{ticket.registered_available_count} available<br />
|
53
|
+
#{ticket.registered_waitlisted_count} waitlisted
|
55
54
|
"
|
56
55
|
else
|
57
|
-
"#{ticket.
|
56
|
+
"#{ticket.registered_count} registered"
|
58
57
|
end
|
59
58
|
end
|
60
59
|
|
@@ -64,7 +63,7 @@ module Admin
|
|
64
63
|
event.event_registrants.registered.count
|
65
64
|
end
|
66
65
|
|
67
|
-
col :
|
66
|
+
col :deferred_event_registrants_count, label: 'Deferred', visible: false, as: :integer do |event|
|
68
67
|
event.event_registrants.deferred.count
|
69
68
|
end
|
70
69
|
|
@@ -72,6 +71,8 @@ module Admin
|
|
72
71
|
event.event_registrants.purchased.count
|
73
72
|
end
|
74
73
|
|
74
|
+
col :qb_item_name, label: qb_item_name_label, search: Effective::ItemName.sorted.map(&:to_s), visible: EffectiveOrders.use_item_names?
|
75
|
+
|
75
76
|
col :question1, visible: false
|
76
77
|
col :question2, visible: false
|
77
78
|
col :question3, visible: false
|
@@ -54,6 +54,13 @@ module Admin
|
|
54
54
|
col :roles, visible: false
|
55
55
|
col :authenticate_user, visible: false
|
56
56
|
|
57
|
+
col :qb_item_names,
|
58
|
+
search: { fuzzy: true, collection:Effective::ItemName.sorted.map(&:to_s) },
|
59
|
+
label: qb_item_names_label,
|
60
|
+
visible: EffectiveOrders.use_item_names? do |event|
|
61
|
+
event.qb_item_names.map { |qb_item_name| content_tag(:div, qb_item_name) } .join.html_safe
|
62
|
+
end
|
63
|
+
|
57
64
|
actions_col do |event|
|
58
65
|
dropdown_link_to('View Event', effective_events.event_path(event), target: '_blank')
|
59
66
|
end
|
@@ -36,8 +36,8 @@ module Effective
|
|
36
36
|
|
37
37
|
# Acts as Purchasable
|
38
38
|
price :integer
|
39
|
-
qb_item_name :string
|
40
39
|
tax_exempt :boolean
|
40
|
+
# The qb_item_name is deferred to event_product
|
41
41
|
|
42
42
|
timestamps
|
43
43
|
end
|
@@ -85,7 +85,7 @@ module Effective
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def qb_item_name
|
88
|
-
event_product
|
88
|
+
event_product&.qb_item_name
|
89
89
|
end
|
90
90
|
|
91
91
|
def registered?
|
@@ -41,6 +41,7 @@ module Effective
|
|
41
41
|
|
42
42
|
validates :title, presence: true, uniqueness: { scope: [:event_id] }
|
43
43
|
validates :price, presence: true
|
44
|
+
validates :qb_item_name, presence: true, if: -> { EffectiveOrders.require_item_names? }
|
44
45
|
|
45
46
|
def to_s
|
46
47
|
title.presence || 'New Event Product'
|
@@ -59,8 +59,8 @@ module Effective
|
|
59
59
|
|
60
60
|
# Acts as Purchasable
|
61
61
|
price :integer
|
62
|
-
qb_item_name :string
|
63
62
|
tax_exempt :boolean
|
63
|
+
# The qb_item_name is deferred to ticket
|
64
64
|
|
65
65
|
# Historical. Not used anymore. TO BE DELETED.
|
66
66
|
number :string
|
@@ -76,6 +76,9 @@ module Effective
|
|
76
76
|
scope :purchased_or_created_by_admin, -> { purchased.or(unarchived.where(created_by_admin: true)) }
|
77
77
|
scope :not_purchased_not_created_by_admin, -> { not_purchased.where(created_by_admin: false) }
|
78
78
|
|
79
|
+
scope :waitlisted, -> { where(waitlisted: true, promoted: false) }
|
80
|
+
scope :non_waitlisted, -> { where(waitlisted: false).or(where(waitlisted: true, promoted: true)) }
|
81
|
+
|
79
82
|
before_validation(if: -> { event_registration.present? }) do
|
80
83
|
self.event ||= event_registration.event
|
81
84
|
self.owner ||= event_registration.owner
|
@@ -48,7 +48,7 @@ module Effective
|
|
48
48
|
timestamps
|
49
49
|
end
|
50
50
|
|
51
|
-
scope :sorted, -> { order(:
|
51
|
+
scope :sorted, -> { order(:title) }
|
52
52
|
scope :deep, -> { with_rich_text_body.includes(:event, :purchased_event_registrants) }
|
53
53
|
|
54
54
|
before_validation(if: -> { event.present? }) do
|
@@ -71,10 +71,13 @@ module Effective
|
|
71
71
|
validates :capacity, numericality: { greater_than_or_equal_to: 0, allow_blank: true }
|
72
72
|
validates :capacity, presence: { message: 'must be present when using the waitlist'}, if: -> { waitlist? }
|
73
73
|
|
74
|
+
validates :qb_item_name, presence: true, if: -> { EffectiveOrders.require_item_names? }
|
75
|
+
|
74
76
|
def to_s
|
75
77
|
title.presence || 'New Event Ticket'
|
76
78
|
end
|
77
79
|
|
80
|
+
# These capacity methods are used by the front end EventRegistrations screens
|
78
81
|
def capacity_selectable(except: nil)
|
79
82
|
return nil if capacity.blank?
|
80
83
|
return nil if waitlist?
|
@@ -88,7 +91,7 @@ module Effective
|
|
88
91
|
end
|
89
92
|
|
90
93
|
def capacity_taken(except: nil)
|
91
|
-
registered_or_selected_event_registrants(except: except).reject
|
94
|
+
registered_or_selected_event_registrants(except: except).reject { |er| er.waitlisted? && !er.promoted? }.length
|
92
95
|
end
|
93
96
|
|
94
97
|
def registered_or_selected_event_registrants(except: nil)
|
@@ -99,24 +102,31 @@ module Effective
|
|
99
102
|
end
|
100
103
|
end
|
101
104
|
|
102
|
-
|
103
|
-
registered_or_selected_event_registrants.count
|
104
|
-
end
|
105
|
+
# These registered methods are for the admin registrations screens
|
105
106
|
|
106
|
-
|
107
|
+
# Total registered count, including waitlisted and non waitlisted
|
108
|
+
def registered_count
|
107
109
|
registered_event_registrants.length
|
108
110
|
end
|
109
111
|
|
110
|
-
|
111
|
-
|
112
|
+
# Registered and not waitlisted count
|
113
|
+
def registered_non_waitlisted_count
|
114
|
+
registered_event_registrants.non_waitlisted.length
|
115
|
+
end
|
116
|
+
|
117
|
+
# Registered and waitlisted count
|
118
|
+
def registered_waitlisted_count
|
119
|
+
registered_event_registrants.waitlisted.length
|
112
120
|
end
|
113
121
|
|
114
|
-
|
115
|
-
|
122
|
+
# Registered and available count
|
123
|
+
def registered_available_count
|
124
|
+
return nil if capacity.blank?
|
125
|
+
[capacity - registered_non_waitlisted_count, 0].max
|
116
126
|
end
|
117
127
|
|
118
|
-
def
|
119
|
-
|
128
|
+
def purchased_event_registrants_count
|
129
|
+
purchased_event_registrants.length
|
120
130
|
end
|
121
131
|
|
122
132
|
def questions
|
@@ -134,6 +144,5 @@ module Effective
|
|
134
144
|
def member_or_non_member?
|
135
145
|
category == 'Member or Non-Member'
|
136
146
|
end
|
137
|
-
|
138
147
|
end
|
139
148
|
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: 2.
|
4
|
+
version: 2.31.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-
|
11
|
+
date: 2025-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|