effective_events 0.20.6 → 0.21.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/admin/event_addons/_form.html.haml +1 -1
- data/app/views/admin/event_registrants/_form.html.haml +1 -1
- data/app/views/effective/event_registrants/_fields.html.haml +1 -1
- data/app/views/effective/events/show.html.haml +5 -5
- data/config/routes.rb +0 -5
- data/lib/effective_events/version.rb +1 -1
- metadata +2 -3
- data/app/controllers/effective/event_registrants_select2_ajax_controller.rb +0 -61
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 128c897d8cc40cfd3f84fefb6b8eac69471d226ef6041620a47085a3262fad70
|
4
|
+
data.tar.gz: f872992f624a56532b1efbb74c3be72b226cc14a1920e8342e24a1ffd41f0775
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a8202dbb17598290d7dd4b83c45f189f0d67ea754fd719a290ede35838a0450bae7afd48f446480ed25b8625a93668a51cef4f9b12f19672827ec42c4c1d63e
|
7
|
+
data.tar.gz: c14279553171ea9a133572f1077382b2ddb5ea10ed5366531969c1edbd16310f519174d270ae8ebab4317cd52bb207293aab9895be98c586b777c00bdd38613e
|
@@ -10,7 +10,7 @@
|
|
10
10
|
- if f.object.new_record?
|
11
11
|
-# User
|
12
12
|
- klass = (f.object.owner || current_user).class
|
13
|
-
- ajax_url = (
|
13
|
+
- ajax_url = (effective_resources.users_effective_ajax_index_path unless Rails.env.test?)
|
14
14
|
|
15
15
|
= f.hidden_field :owner_type, value: klass.name
|
16
16
|
= f.select :owner_id, klass.all, ajax_url: ajax_url, label: 'User'
|
@@ -9,7 +9,7 @@
|
|
9
9
|
- if f.object.new_record?
|
10
10
|
-# User
|
11
11
|
- klass = (f.object.owner || current_user).class
|
12
|
-
- ajax_url = (effective_resources.
|
12
|
+
- ajax_url = (effective_resources.users_effective_ajax_index_path unless Rails.env.test?)
|
13
13
|
|
14
14
|
= f.hidden_field :owner_type, value: klass.name
|
15
15
|
= f.select :owner_id, klass.all, ajax_url: ajax_url, label: 'Registration User'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.event-registrant-user-fields
|
2
2
|
- user_klass = (f.object.user || current_user).class
|
3
|
-
- ajax_url = (
|
3
|
+
- ajax_url = (effective_resources.users_effective_ajax_index_path unless Rails.env.test?)
|
4
4
|
- disabled = (f.object.user.present? && f.object.user.persisted? && f.object.user.errors.blank?)
|
5
5
|
- event_ticket = f.object.event_ticket
|
6
6
|
|
@@ -40,11 +40,11 @@
|
|
40
40
|
%br
|
41
41
|
= @event.early_bird_end_at.strftime("%A, %B %d, %Y · %l:%M%P")
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
-#- if @event.registration_end_at.present?
|
44
|
+
-# %li.mb-3
|
45
|
+
-# %label Registration Closes
|
46
|
+
-# %br
|
47
|
+
-# = @event.registration_end_at.strftime("%A, %B %d, %Y · %l:%M%P")
|
48
48
|
|
49
49
|
-# .col-md-auto
|
50
50
|
-# - if @event.event_tickets.present?
|
data/config/routes.rb
CHANGED
@@ -24,11 +24,6 @@ EffectiveEvents::Engine.routes.draw do
|
|
24
24
|
put :update_blank_registrants, on: :member
|
25
25
|
end
|
26
26
|
end
|
27
|
-
|
28
|
-
resources :event_registrants_select2_ajax, only: [] do
|
29
|
-
get :users, on: :collection
|
30
|
-
get :organizations, on: :collection
|
31
|
-
end
|
32
27
|
end
|
33
28
|
|
34
29
|
namespace :admin do
|
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.21.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: 2024-
|
11
|
+
date: 2024-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -229,7 +229,6 @@ files:
|
|
229
229
|
- app/controllers/admin/event_registrations_controller.rb
|
230
230
|
- app/controllers/admin/event_tickets_controller.rb
|
231
231
|
- app/controllers/admin/events_controller.rb
|
232
|
-
- app/controllers/effective/event_registrants_select2_ajax_controller.rb
|
233
232
|
- app/controllers/effective/event_registrations_controller.rb
|
234
233
|
- app/controllers/effective/events_controller.rb
|
235
234
|
- app/datatables/admin/effective_event_addons_datatable.rb
|
@@ -1,61 +0,0 @@
|
|
1
|
-
module Effective
|
2
|
-
class EventRegistrantsSelect2AjaxController < ApplicationController
|
3
|
-
before_action(:authenticate_user!) if defined?(Devise)
|
4
|
-
|
5
|
-
include Effective::Select2AjaxController
|
6
|
-
|
7
|
-
def users
|
8
|
-
authorize! :users, Effective::EventRegistrant
|
9
|
-
|
10
|
-
with_organizations = current_user.class.try(:effective_memberships_organization_user?)
|
11
|
-
|
12
|
-
collection = current_user.class.all
|
13
|
-
collection = collection.includes(:organizations) if with_organizations
|
14
|
-
|
15
|
-
respond_with_select2_ajax(collection, skip_authorize: true) do |user|
|
16
|
-
data = { first_name: user.first_name, last_name: user.last_name, email: user.email }
|
17
|
-
|
18
|
-
if with_organizations
|
19
|
-
data[:company] = user.organizations.first.try(:to_s)
|
20
|
-
data[:organization_id] = user.organizations.first.try(:id)
|
21
|
-
data[:organization_type] = user.organizations.first.try(:class).try(:name)
|
22
|
-
end
|
23
|
-
|
24
|
-
{
|
25
|
-
id: user.to_param,
|
26
|
-
text: to_select2(user, with_organizations),
|
27
|
-
data: data
|
28
|
-
}
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def organizations
|
33
|
-
raise('expected EffectiveEvents.organization_enabled?') unless EffectiveEvents.organization_enabled?
|
34
|
-
|
35
|
-
klass = EffectiveMemberships.Organization
|
36
|
-
raise('an EffectiveMemberships.Organization is required') unless klass.try(:effective_memberships_organization?)
|
37
|
-
|
38
|
-
collection = klass.all
|
39
|
-
|
40
|
-
# Authorize
|
41
|
-
EffectiveResources.authorize!(self, :member_organizations, collection.klass)
|
42
|
-
|
43
|
-
respond_with_select2_ajax(collection, skip_authorize: true) do |organization|
|
44
|
-
{ id: organization.to_param, text: organization.to_s }
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
private
|
49
|
-
|
50
|
-
def to_select2(resource, with_organizations)
|
51
|
-
organizations = Array(resource.try(:organizations)).join(', ') if with_organizations
|
52
|
-
|
53
|
-
[
|
54
|
-
"<span>#{resource}</span>",
|
55
|
-
"<small><#{resource.try(:public_email).presence || resource.email}></small>",
|
56
|
-
("<small>#{organizations}</small>" if organizations.present?)
|
57
|
-
].compact.join(' ')
|
58
|
-
end
|
59
|
-
|
60
|
-
end
|
61
|
-
end
|