effective_events 0.2.0 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/controllers/effective/event_registrations_controller.rb +0 -33
  4. data/app/controllers/effective/events_controller.rb +0 -15
  5. data/app/datatables/admin/effective_event_registrants_datatable.rb +2 -2
  6. data/app/datatables/admin/effective_event_registrations_datatable.rb +2 -2
  7. data/app/datatables/admin/effective_event_tickets_datatable.rb +0 -6
  8. data/app/datatables/admin/effective_events_datatable.rb +12 -9
  9. data/app/datatables/effective_event_registrants_datatable.rb +2 -2
  10. data/app/datatables/effective_events_datatable.rb +1 -5
  11. data/app/helpers/effective_events_helper.rb +0 -4
  12. data/app/models/concerns/effective_events_event_registration.rb +1 -9
  13. data/app/views/effective/event_registrants/_fields.html.haml +1 -1
  14. data/app/views/effective/event_registrations/_addons.html.haml +1 -1
  15. data/app/views/effective/event_registrations/_event_registration.html.haml +1 -6
  16. data/app/views/effective/event_registrations/{_tickets.haml → _tickets.html.haml} +1 -1
  17. data/app/views/effective/event_registrations/submitted.html.haml +1 -0
  18. data/app/views/effective/event_registrations/{tickets.haml → tickets.html.haml} +0 -0
  19. data/app/views/effective/events/_event.html.haml +37 -17
  20. data/app/views/effective/events/index.html.haml +5 -8
  21. data/app/views/effective/events/show.html.haml +9 -13
  22. data/lib/effective_events/version.rb +1 -1
  23. metadata +4 -6
  24. data/app/views/effective/events/_layout.html.haml +0 -1
  25. data/app/views/effective/events/_spacer.html.haml +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd744d00aed47ee8fe88bbfa4f9224f6dea924726a9d7f42be397e88315e5a0f
4
- data.tar.gz: b24c00d8bc3a54e3ccad2f43db728ede8a53b5aaff618646386c3ad179c827ed
3
+ metadata.gz: abf5e9e89cd746cd636f6153093f165bda6bc8c92657248478264355487e68c0
4
+ data.tar.gz: d12f3cf6889c9e26f0c4cd1aa188ff47f7f709c6e42c17df1b39586e8996194c
5
5
  SHA512:
6
- metadata.gz: bee221260b8e2aad273c9b79250707bf4c053dc64a937c3eff477eb345e8bc3a10afb4b9504d45f2d2be778a842a62ffc7dc4a9ac76138915575eff8c295524c
7
- data.tar.gz: 305c28be0450a00d070e15d32d0af3dc2de4c72bdbad1e345948c00851ccb882566b84b9a256d9c62786573902cced56a63a658204fd671614d4e59ebc3a58f2
6
+ metadata.gz: 295fed0aaac7ff09e8049eff6dca55fec779e234f56f85fcad32ce60ae7a3c82d942044e3b792366dd01d453ce683980f0e1c6a28c8d70ea62b93e45ddf88681
7
+ data.tar.gz: 66b52f3bfaaba6765795cca10dab5202a119f4b4048bf0d185d763591f9e6278b8a5f695db878001508c5ae72801ef8291a0c87f7b47d69550f5c67e50e80df0
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Effective Events
2
2
 
3
- Events, event registrants, event tickets and event products.
3
+ Events, event registrants, event tickets, and event products.
4
4
 
5
5
  ## Getting Started
6
6
 
@@ -9,38 +9,5 @@ module Effective
9
9
  EffectiveEvents.EventRegistration.deep.where(owner: current_user, event: event)
10
10
  }
11
11
 
12
- # Allow only 1 in-progress event registration at a time
13
- before_action(only: [:new, :show], unless: -> { resource&.done? }) do
14
- existing = resource_scope.in_progress.where.not(id: resource).first
15
-
16
- if existing.present?
17
- flash[:success] = "You have been redirected to your existing in progress event registration"
18
- redirect_to effective_events.event_event_registration_build_path(existing.event, existing, existing.next_step)
19
- end
20
- end
21
-
22
- after_save do
23
- flash.now[:success] = ''
24
- end
25
-
26
- # The default redirect doesn't respect nested resources here
27
- def new
28
- self.resource ||= (find_wizard_resource || resource_scope.new)
29
- EffectiveResources.authorize!(self, :new, resource)
30
-
31
- redirect_to effective_events.event_event_registration_build_path(
32
- resource.event,
33
- (resource.to_param || :new),
34
- (resource.first_uncompleted_step || resource_wizard_steps.first)
35
- )
36
- end
37
-
38
- private
39
-
40
- def permitted_params
41
- model = (params.key?(:effective_event_registration) ? :effective_event_registration : :event_registration)
42
- params.require(model).permit!.except(:status, :status_steps, :wizard_steps, :submitted_at)
43
- end
44
-
45
12
  end
46
13
  end
@@ -7,21 +7,6 @@ module Effective
7
7
  Effective::Event.events(user: current_user, unpublished: unpublished)
8
8
  }
9
9
 
10
- def index
11
- @events ||= resource_scope.published
12
-
13
- @events = @events.paginate(page: params[:page])
14
-
15
- # if params[:search].present?
16
- # search = params[:search].permit(EffectiveEvents.permitted_params).delete_if { |k, v| v.blank? }
17
- # @events = @events.where(search) if search.present?
18
- # end
19
-
20
- EffectiveResources.authorize!(self, :index, Effective::Event)
21
-
22
- @page_title ||= ['Events', (" - Page #{params[:page]}" if params[:page])].compact.join
23
- end
24
-
25
10
  def show
26
11
  @event = resource_scope.find(params[:id])
27
12
 
@@ -16,13 +16,13 @@ module Admin
16
16
  col :event_ticket, search: :string
17
17
  end
18
18
 
19
- col :purchased_order
19
+ col :purchased_order, visible: false
20
20
 
21
21
  col :first_name
22
22
  col :last_name
23
23
  col :email
24
24
  col :company
25
- col :number
25
+ col :number, label: 'Designations'
26
26
  col :notes, label: 'Restrictions and notes'
27
27
 
28
28
  actions_col
@@ -12,8 +12,8 @@ class Admin::EffectiveEventRegistrationsDatatable < Effective::Datatable
12
12
  col :event, search: :string
13
13
  col :owner
14
14
 
15
- col :event_registrants, search: :string
16
- col :event_addons, search: :string
15
+ col :event_registrants, search: :string, visible: false
16
+ col :event_addons, search: :string, visible: false
17
17
  col :orders, label: 'Order'
18
18
 
19
19
  actions_col
@@ -25,12 +25,6 @@ module Admin
25
25
  col :capacity, visible: false
26
26
  col :capacity_available, visible: false
27
27
 
28
- col :purchased_event_registrants, label: 'Registrants' do |ticket|
29
- ticket.purchased_event_registrants.sort_by(&:last_name).map do |registrant|
30
- content_tag(:div, registrant.last_first_name, class: 'col-resource_item')
31
- end.join.html_safe
32
- end
33
-
34
28
  actions_col
35
29
  end
36
30
 
@@ -13,19 +13,21 @@ module Admin
13
13
  col :created_at, visible: false
14
14
  col :id, visible: false
15
15
 
16
- col :title
17
- col :slug, visible: false
16
+ col :title do |event|
17
+ link_to event.title, effective_events.edit_admin_event_path(event)
18
+ end
18
19
 
20
+ col :slug, visible: false
19
21
  col :draft
20
- col :start_at, label: 'Event Start Date'
21
- col :end_at, label: 'Event End Date', visible: false
22
+ col :start_at, label: 'Start', visible: false
23
+ col :end_at, label: 'End', visible: false
22
24
  col :excerpt, visible: false
23
25
 
24
26
  col :registration_start_at, label: 'Registration opens', visible: false
25
27
  col :registration_end_at, label: 'Registration closes', visible: false
26
28
  col :early_bird_end_at, label: 'Early bird ends', visible: false
27
29
 
28
- col :early_bird do |event|
30
+ col :early_bird, visible: false do |event|
29
31
  if event.early_bird?
30
32
  content_tag(:span, event.early_bird_status, class: 'badge badge-success')
31
33
  else
@@ -33,10 +35,11 @@ module Admin
33
35
  end
34
36
  end
35
37
 
36
- col :event_tickets, search: :string
37
- col :event_products, search: :string
38
- col :event_registrants, search: :string
39
- col :event_addons, search: :string
38
+ # These show too much information to be useful to admins, rely on the edit screen
39
+ # col :event_tickets, search: :string
40
+ # col :event_products, search: :string
41
+ # col :event_registrants, search: :string
42
+ # col :event_addons, search: :string
40
43
 
41
44
  col :roles, visible: false
42
45
  col :authenticate_user, visible: false
@@ -1,4 +1,4 @@
1
- # Used on the Event Registrations registrants step
1
+ # Used on the Event Registrations tickets step
2
2
 
3
3
  class EffectiveEventRegistrantsDatatable < Effective::Datatable
4
4
  datatable do
@@ -13,7 +13,7 @@ class EffectiveEventRegistrantsDatatable < Effective::Datatable
13
13
  col :last_name, visible: false
14
14
  col :email, visible: false
15
15
  col :company, visible: false
16
- col :number, visible: false
16
+ col :number, visible: false, label: 'Designations'
17
17
 
18
18
  col :price, as: :price
19
19
  col :notes
@@ -13,11 +13,7 @@ class EffectiveEventsDatatable < Effective::Datatable
13
13
  col :start_at, label: 'Date', as: :date
14
14
 
15
15
  col :title, label: 'Title' do |event|
16
- if event.registerable?
17
- link_to(event.to_s, effective_events.new_event_event_registration_path(event))
18
- else
19
- event.to_s
20
- end
16
+ link_to(event.to_s, effective_events.event_path(event))
21
17
  end
22
18
 
23
19
  col :registration_start_at, visible: false
@@ -30,8 +30,4 @@ module EffectiveEventsHelper
30
30
  end
31
31
  end
32
32
 
33
- def edit_effective_event_registrations_wizard?
34
- params[:controller] == 'effective/event_registrations' && defined?(resource) && resource.draft?
35
- end
36
-
37
33
  end
@@ -15,14 +15,6 @@ module EffectiveEventsEventRegistration
15
15
 
16
16
  module ClassMethods
17
17
  def effective_events_event_registration?; true; end
18
-
19
- def all_wizard_steps
20
- const_get(:WIZARD_STEPS).keys
21
- end
22
-
23
- def required_wizard_steps
24
- [:start, :summary, :billing, :checkout, :submitted]
25
- end
26
18
  end
27
19
 
28
20
  included do
@@ -90,7 +82,7 @@ module EffectiveEventsEventRegistration
90
82
  validates :owner, presence: true
91
83
  validates :event, presence: true
92
84
 
93
- # Registrants Step
85
+ # Tickets Step
94
86
  validate(if: -> { current_step == :tickets }) do
95
87
  self.errors.add(:event_registrants, "can't be blank") unless present_event_registrants.present?
96
88
  end
@@ -8,7 +8,7 @@
8
8
  .row
9
9
  .col-lg= f.text_field :first_name
10
10
  .col-lg= f.text_field :last_name
11
- .col-lg= f.text_field :number, label: 'Member Number'
11
+ .col-lg= f.text_field :number, label: 'Professional Designations', hint: 'Include member or registrant number, if applicable.'
12
12
 
13
13
  .row
14
14
  .col-lg= f.email_field :email
@@ -3,7 +3,7 @@
3
3
  .col-sm
4
4
  %h5.card-title= event_registration.wizard_step_title(:addons)
5
5
  .col-sm-auto.text-right
6
- = link_to('Edit', wizard_path(:addons)) if edit_effective_event_registrations_wizard?
6
+ = link_to('Edit', wizard_path(:addons)) if edit_effective_wizard?
7
7
 
8
8
  - datatable = EffectiveEventAddonsDatatable.new(event_registration: event_registration)
9
9
  .mb-4= render_simple_datatable(datatable)
@@ -1,8 +1,3 @@
1
1
  .effective-event-registration
2
- - blacklist = EffectiveEvents.EventRegistration.required_wizard_steps
3
- - steps = event_registration.required_steps - blacklist
4
-
5
- = render "effective/event_registrations/summary", event_registration: event_registration
6
-
7
- - steps.select { |step| event_registration.has_completed_step?(step) }.each do |partial|
2
+ - event_registration.render_steps.each do |partial|
8
3
  = render "effective/event_registrations/#{partial}", event_registration: event_registration, step: partial
@@ -3,7 +3,7 @@
3
3
  .col-sm
4
4
  %h5.card-title= event_registration.wizard_step_title(:tickets)
5
5
  .col-sm-auto.text-right
6
- = link_to('Edit', wizard_path(:tickets)) if edit_effective_event_registrations_wizard?
6
+ = link_to('Edit', wizard_path(:tickets)) if edit_effective_wizard?
7
7
 
8
8
  - datatable = EffectiveEventRegistrantsDatatable.new(event_registration: event_registration)
9
9
  .mb-4= render_simple_datatable(datatable)
@@ -9,6 +9,7 @@
9
9
 
10
10
  = link_to "Return to Dashboard", root_path, class: 'btn btn-lg btn-primary mb-4'
11
11
 
12
+ = render 'effective/event_registrations/summary', event_registration: resource
12
13
  = render 'effective/event_registrations/event_registration', event_registration: resource
13
14
  = render 'effective/event_registrations/orders', event_registration: resource
14
15
 
@@ -1,21 +1,41 @@
1
- .effective-event
2
- %table.table.effective-event-table
3
- %tbody
4
- %tr
5
- %td Starts
6
- %td= event.start_at
1
+ .card
2
+ .card-body
3
+ %table.table.effective-events-table
4
+ %tbody
5
+ %tr
6
+ %th Dates
7
+ %td
8
+ Starts: #{event.start_at&.strftime('%F %R')}
9
+ %br
10
+ Ends: #{event.end_at&.strftime('%F %R')}
7
11
 
8
- %tr
9
- %td Ends
10
- %td= event.end_at
12
+ %tr
13
+ %th Registration Closes
14
+ %td= event.registration_end_at.strftime('%F %R')
11
15
 
12
- %tr
13
- %td Registration Closes
14
- %td= event.registration_end_at
16
+ %tr
17
+ %th Early Bird
18
+ %td
19
+ Status: #{event.early_bird_status}
20
+ %br
21
+ Ends: #{event.early_bird_end_at&.strftime('%F %R')}
15
22
 
16
- %tr
17
- %td Early Bird Status
18
- %td= event.early_bird_status
23
+ %tr
24
+ %th Tickets
25
+ %td
26
+ %ul.pl-3
27
+ - event.event_tickets.each do |ticket|
28
+ %li= "#{ticket} (#{price_to_currency(ticket.price)})"
19
29
 
20
- .event-content.event-excerpt
21
- = event.excerpt
30
+ - if event.event_products.present?
31
+ %tr
32
+ %th Add-ons
33
+ %td
34
+ %ul.pl-0
35
+ - event.event_products.each do |product|
36
+ %li= "#{product} (#{price_to_currency(product.price)})"
37
+
38
+ - if event.body.present?
39
+ %tr
40
+ %th Description
41
+ %td= event.body
@@ -1,8 +1,5 @@
1
- %h1= @page_title
2
-
3
- = render 'layout' do
4
- .effective-events
5
- = render partial: @events, spacer_template: 'spacer'
6
-
7
- %nav.d-flex.justify-content-center
8
- = bootstrap_paginate(@events, per_page: EffectiveEvents.per_page)
1
+ = card do
2
+ - if @datatable.present?(self)
3
+ = render_datatable(@datatable, simple: true)
4
+ - else
5
+ %p There are no events open for registration. When there are, we'll show them here.
@@ -1,16 +1,12 @@
1
- = render 'layout' do
2
- .effective-event
3
- - if @event.sold_out?
4
- .alert.alert-warning This event is sold out.
1
+ .effective-event
2
+ - if @event.sold_out?
3
+ .alert.alert-warning This event is sold out.
5
4
 
6
- - if @event.closed?
7
- .alert.alert-warning This event is no longer available.
5
+ - if @event.closed?
6
+ .alert.alert-warning This event is no longer available.
8
7
 
9
- - if @event.registerable?
10
- .resource-buttons
11
- = link_to 'Register', effective_events.new_event_event_registration_path(@event), class: 'btn btn-primary'
8
+ - if @event.registerable?
9
+ .resource-buttons
10
+ = link_to 'Register', effective_events.new_event_event_registration_path(@event), class: 'btn btn-primary'
12
11
 
13
- = render 'effective/events/event', event: @event
14
-
15
- .event-body.event-content
16
- = @event.body
12
+ = render 'effective/events/event', event: @event
@@ -1,3 +1,3 @@
1
1
  module EffectiveEvents
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.4'.freeze
3
3
  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.2.0
4
+ version: 0.2.4
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: 2022-01-24 00:00:00.000000000 Z
11
+ date: 2022-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -243,18 +243,16 @@ files:
243
243
  - app/views/effective/event_registrations/_layout.html.haml
244
244
  - app/views/effective/event_registrations/_orders.html.haml
245
245
  - app/views/effective/event_registrations/_summary.html.haml
246
- - app/views/effective/event_registrations/_tickets.haml
246
+ - app/views/effective/event_registrations/_tickets.html.haml
247
247
  - app/views/effective/event_registrations/addons.html.haml
248
248
  - app/views/effective/event_registrations/billing.html.haml
249
249
  - app/views/effective/event_registrations/checkout.html.haml
250
250
  - app/views/effective/event_registrations/start.html.haml
251
251
  - app/views/effective/event_registrations/submitted.html.haml
252
252
  - app/views/effective/event_registrations/summary.html.haml
253
- - app/views/effective/event_registrations/tickets.haml
253
+ - app/views/effective/event_registrations/tickets.html.haml
254
254
  - app/views/effective/events/_dashboard.html.haml
255
255
  - app/views/effective/events/_event.html.haml
256
- - app/views/effective/events/_layout.html.haml
257
- - app/views/effective/events/_spacer.html.haml
258
256
  - app/views/effective/events/index.html.haml
259
257
  - app/views/effective/events/show.html.haml
260
258
  - app/views/effective/events_mailer/event_registrant_purchased.liquid
@@ -1 +0,0 @@
1
- = yield
@@ -1 +0,0 @@
1
- %hr