effective_events 0.10.0 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/effective/event_registrations_controller.rb +13 -1
- data/app/datatables/admin/effective_event_registrants_datatable.rb +1 -1
- data/app/models/concerns/effective_events_event_registration.rb +7 -1
- data/app/models/effective/event.rb +6 -3
- data/app/views/admin/events/_form.html.haml +3 -2
- data/app/views/admin/events/_form_access.html.haml +1 -1
- data/app/views/effective/event_registrations/_dashboard.html.haml +2 -1
- 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: 6e0eded3c712c018bb91f9c90eebe522030fa7d02d5d73b9de4001bda7c5dbcf
|
4
|
+
data.tar.gz: 3dc20c280ef92ebc93dad4cfe57df506e6a283bd4433a4792f07a236b3fb5ebc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43fcaa469c42cf91dcb5ac3f6c52509372a4d8983c91cac727d350f4c9a3a797f04d4cd1f4ee6793502a5eb868dbc1c660e51862b3a0ad299f1ad416a69c7220
|
7
|
+
data.tar.gz: e7fe84b88841792c065bd307a80656ab4248b60306c2cfecaeb007ba09aa3b2bc782ee13512a91640e02c5b39156bb923bcd6683e889d51b36f99b2bd349bc67
|
@@ -1,12 +1,13 @@
|
|
1
1
|
module Effective
|
2
2
|
class EventRegistrationsController < ApplicationController
|
3
|
-
|
4
3
|
if defined?(Devise)
|
5
4
|
before_action :authenticate_user!, unless: -> { action_name == 'new' || (action_name == 'show' && params[:id] == 'start') }
|
6
5
|
end
|
7
6
|
|
8
7
|
include Effective::WizardController
|
9
8
|
|
9
|
+
before_action :redirect_unless_registerable, only: [:new, :show]
|
10
|
+
|
10
11
|
resource_scope -> {
|
11
12
|
event = Effective::Event.find(params[:event_id])
|
12
13
|
EffectiveEvents.EventRegistration.deep.where(owner: current_user, event: event)
|
@@ -26,5 +27,16 @@ module Effective
|
|
26
27
|
resource.ready!
|
27
28
|
end
|
28
29
|
|
30
|
+
# If the event is no longer registerable, do not let them continue
|
31
|
+
def redirect_unless_registerable
|
32
|
+
return if resource.blank?
|
33
|
+
return if resource.event.blank?
|
34
|
+
return if resource.event.registerable?
|
35
|
+
return if resource.submitted?
|
36
|
+
|
37
|
+
flash[:danger] = "Your selected event is no longer available for registration. This event registration is no longer available."
|
38
|
+
return redirect_to('/dashboard')
|
39
|
+
end
|
40
|
+
|
29
41
|
end
|
30
42
|
end
|
@@ -37,7 +37,7 @@ module Admin
|
|
37
37
|
end
|
38
38
|
|
39
39
|
collection do
|
40
|
-
scope = Effective::EventRegistrant.deep.purchased_or_deferred
|
40
|
+
scope = Effective::EventRegistrant.deep.purchased_or_deferred
|
41
41
|
|
42
42
|
if attributes[:event_id].present?
|
43
43
|
scope = scope.where(event: event)
|
@@ -77,7 +77,13 @@ module EffectiveEventsEventRegistration
|
|
77
77
|
timestamps
|
78
78
|
end
|
79
79
|
|
80
|
-
scope :deep, -> {
|
80
|
+
scope :deep, -> {
|
81
|
+
includes(:owner)
|
82
|
+
.includes(event: [:rich_texts, event_products: :purchased_event_addons, event_tickets: :purchased_event_registrants])
|
83
|
+
.includes(event_registrants: [event_ticket: :purchased_event_registrants])
|
84
|
+
.includes(event_addons: [event_product: :purchased_event_addons])
|
85
|
+
}
|
86
|
+
|
81
87
|
scope :sorted, -> { order(:id) }
|
82
88
|
|
83
89
|
scope :in_progress, -> { where.not(status: [:submitted]) }
|
@@ -6,7 +6,6 @@ module Effective
|
|
6
6
|
|
7
7
|
if defined?(PgSearch)
|
8
8
|
include PgSearch::Model
|
9
|
-
|
10
9
|
multisearchable against: [:body]
|
11
10
|
end
|
12
11
|
|
@@ -43,7 +42,6 @@ module Effective
|
|
43
42
|
acts_as_tagged if respond_to?(:acts_as_tagged)
|
44
43
|
acts_as_role_restricted if respond_to?(:acts_as_role_restricted)
|
45
44
|
|
46
|
-
|
47
45
|
effective_resource do
|
48
46
|
title :string
|
49
47
|
|
@@ -72,7 +70,12 @@ module Effective
|
|
72
70
|
end
|
73
71
|
|
74
72
|
scope :sorted, -> { order(start_at: :desc) }
|
75
|
-
|
73
|
+
|
74
|
+
scope :deep, -> {
|
75
|
+
base = includes(:event_registrants, :event_tickets, :rich_texts)
|
76
|
+
base = base.includes(:pg_search_document) if defined?(PgSearch)
|
77
|
+
base
|
78
|
+
}
|
76
79
|
|
77
80
|
scope :published, -> { where(draft: false).where(arel_table[:published_at].lt(Time.zone.now)) }
|
78
81
|
scope :unpublished, -> { where(draft: true).where(arel_table[:published_at].gteq(Time.zone.now)) }
|
@@ -45,6 +45,7 @@
|
|
45
45
|
= tab 'Access' do
|
46
46
|
= render '/admin/events/form_access', event: event
|
47
47
|
|
48
|
-
|
48
|
+
- if event.persisted?
|
49
|
+
- if event.respond_to?(:logs_datatable)
|
49
50
|
= tab "Logs" do
|
50
|
-
= render_inline_datatable(event.
|
51
|
+
= render_inline_datatable(event.logs_datatable)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
= effective_form_with(model:
|
1
|
+
= effective_form_with(model: [:admin, event], engine: true) do |f|
|
2
2
|
= f.check_box :authenticate_user, label: 'Yes, the user must be be signed in to view this event', hint: 'Sign up is required to register for any event'
|
3
3
|
|
4
4
|
- if EffectiveEvents.use_effective_roles
|
@@ -1,5 +1,6 @@
|
|
1
1
|
-# In progress registration
|
2
|
-
- registration = EffectiveEvents.EventRegistration.in_progress.for(current_user).first
|
2
|
+
- registration = EffectiveEvents.EventRegistration.in_progress.includes(event: :event_products).for(current_user).first
|
3
|
+
|
3
4
|
- datatable = EffectiveResources.best('EffectiveEventRegistrationsDatatable').new(self, namespace: :effective)
|
4
5
|
|
5
6
|
- if registration.present?
|
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.10.
|
4
|
+
version: 0.10.2
|
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: 2023-11
|
11
|
+
date: 2023-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|