effective_events 0.17.0 → 0.18.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6adf869c67bd082b19c66a82b5e3ac530a80b97c19e0047f13bdca69f7f1a98e
4
- data.tar.gz: a1d8cd3df41996b18c2afcf4f2370a69e9d2b353e3bf3ca356808f3802ade723
3
+ metadata.gz: e59fad0b6c38bbbdd06763e8f6d2d4d19cc025b82434db4a27b3c6fd0f88b75e
4
+ data.tar.gz: 02151c1c1ad10e49b6c38b8e9e603246732b1c686f19399bf08c9f7110e0190e
5
5
  SHA512:
6
- metadata.gz: b5cb43f659f86669874ea2edca7aa0159aad83c25a85065d2c69ee10d4aaf8392ea8aa1ebc3a171ab95b40f93e8ec3dd2e59aeb9161c8957a94aab60d5247e26
7
- data.tar.gz: aba17ab942159ea4b5b0cf9c62511f876dbd54b56a864ce584115c07ce2bcd01c02310ceebadafb3548a983b9eeebddd1ccd55dfccde669c231152a35c67c9a8
6
+ metadata.gz: b07d432950696e4e44280f8af2341ee965b515893774c1f29b6d5ce2efc41afc68b573603486adb7033f2a4bfbfc96e93a28098afd0cb6008a663881aa1e220e
7
+ data.tar.gz: e0c6e234e64f873e8083345dba273e3a5bbff7667f03dd3b403bca56dd4bc108522a0e35f23ac2201e068fc5f319332f3878ab7636e018c270e9c91dfac4b044
@@ -8,7 +8,12 @@ module Effective
8
8
  }
9
9
 
10
10
  def index
11
- @page_title ||= 'Events'
11
+ if event_category.present?
12
+ @page_title = event_category
13
+ @event_category = event_category
14
+ else
15
+ @page_title ||= view_context.events_name_label
16
+ end
12
17
  EffectiveResources.authorize!(self, :index, Effective::Event)
13
18
 
14
19
  # Sometimes we just display a Datatable for the events
@@ -34,9 +39,8 @@ module Effective
34
39
  if EffectiveResources.authorized?(self, :admin, :effective_events)
35
40
  flash.now[:warning] = [
36
41
  'Hi Admin!',
37
- ('You are viewing a hidden event.' if @event.draft?),
38
- 'Click here to',
39
- ("<a href='#{effective_events.edit_admin_event_path(@event)}' class='alert-link'>edit event settings</a>.")
42
+ ('You are viewing a hidden event. ' if @event.draft?),
43
+ ("<a href='#{effective_events.edit_admin_event_path(@event)}' class='alert-link'>Edit this event</a>.")
40
44
  ].compact.join(' ')
41
45
  end
42
46
 
@@ -22,8 +22,8 @@ module Admin
22
22
 
23
23
  col :draft?, as: :boolean, visible: false
24
24
  col :published?, as: :boolean
25
- col :published_start_at
26
- col :published_end_at
25
+ col :published_start_at, as: "Published start"
26
+ col :published_end_at, as: "Published end"
27
27
 
28
28
  col :start_at, label: 'Start', visible: false
29
29
  col :end_at, label: 'End', visible: false
@@ -47,8 +47,7 @@ module Admin
47
47
  # col :event_registrants, search: :string
48
48
  # col :event_addons, search: :string
49
49
 
50
- col :allow_blank_registrants
51
-
50
+ col :allow_blank_registrants, visible: false
52
51
  col :roles, visible: false
53
52
  col :authenticate_user, visible: false
54
53
 
@@ -6,7 +6,8 @@ class EffectiveEventRegistrantsDatatable < Effective::Datatable
6
6
 
7
7
  col :name do |er|
8
8
  if er.first_name.present?
9
- "#{er.first_name} #{er.last_name}<br><small>#{mail_to(er.email)}</small>"
9
+ email = (er.user.present? ? masked_email(er.user) : er.email)
10
+ "#{er.first_name} #{er.last_name}<br><small>#{email}</small>"
10
11
  elsif er.owner.present?
11
12
  er.owner.to_s + ' - GUEST'
12
13
  else
@@ -1,9 +1,25 @@
1
1
  module EffectiveEventsHelper
2
+
3
+ # Events
4
+ def events_name_label
5
+ et('effective_events.name')
6
+ end
7
+
8
+ # Event
9
+ def event_label
10
+ et(Effective::Event)
11
+ end
12
+
13
+ # Events
14
+ def events_label
15
+ ets(Effective::Event)
16
+ end
17
+
2
18
  def effective_events_event_schedule(event)
3
19
  if event.start_at.beginning_of_day == event.end_at.beginning_of_day
4
- "#{event.start_at.strftime("%b %d, %Y %I:%M%P")} - #{event.end_at.strftime("%I:%M%P")}"
20
+ "#{event.start_at.strftime("%A, %B %d, %Y · %l:%M%P")} - #{event.end_at.strftime("%l:%M%P")}"
5
21
  else
6
- "#{event.start_at.strftime("%b %d, %Y")} - #{event.end_at.strftime("%b %d, %Y")}"
22
+ "#{event.start_at.strftime("%A, %B %d, %Y")} - #{event.end_at.strftime("%A, %B %d, %Y")}"
7
23
  end
8
24
  end
9
25
 
@@ -175,7 +175,7 @@ module Effective
175
175
  end
176
176
 
177
177
  def to_s
178
- title.presence || 'New Event'
178
+ title.presence || model_name.human
179
179
  end
180
180
 
181
181
  def body
@@ -68,7 +68,7 @@ module Effective
68
68
  # Apply Sorting
69
69
  events = case order.to_s
70
70
  when 'Sort by Published Date'
71
- events.reorder(published_at: :asc)
71
+ events.reorder(published_start_at: :asc)
72
72
  when 'Sort by Event Date'
73
73
  events.reorder(start_at: :asc)
74
74
  else
@@ -24,6 +24,7 @@ module Effective
24
24
  title :string
25
25
 
26
26
  capacity :integer
27
+ display_capacity :boolean
27
28
  waitlist :boolean
28
29
 
29
30
  category :string
@@ -24,12 +24,13 @@
24
24
  Anyone will be able to purchase this ticket. They can select a member from the dropdown list of all members to receive the member pricing or they can enter a first name and last name to receive the regular pricing.
25
25
 
26
26
  .col
27
- = f.number_field :capacity, hint: "The number of registrations will be limited to capacity.<br>Leave blank for unlimited capacity."
27
+ = f.number_field :capacity, hint: "The number of registrations will be limited to capacity. Leave blank for unlimited capacity."
28
+ = f.check_box :display_capacity, label: "Yes, display the remaining ticket capacity to users during registration", hint: "Leave blank to hide the capacity."
28
29
 
29
30
  - if f.object.event&.delayed?
30
31
  = f.check_box :waitlist,
31
32
  label: "Yes, add to waitlist once capacity is reached",
32
- hint: "requires a delayed payment event. Once capacity is reached, new registrations will be added to the waitlist. Payment information is collected but not charged for waitlisted registrants."
33
+ hint: "requires a delayed payment event. Once capacity is reached, new registrations will be added to the waitlist. Payment information is collected but not charged for waitlisted registrants. To waitlist everyone and promote later, set the capacity to zero."
33
34
  .row
34
35
  .col-md-6
35
36
  - if f.object.event&.early_bird_end_at.present?
@@ -1,5 +1,5 @@
1
1
  = effective_form_with(model: [:admin, event], engine: true) do |f|
2
- = f.file_field :file, label: 'Image attachment', hint: EffectiveEvents.events_hint_text
2
+ = f.file_field :file, label: 'Image preview', hint: EffectiveEvents.events_hint_text
3
3
 
4
4
  - if defined?(EffectiveArticleEditor)
5
5
  = f.article_editor :rich_text_excerpt, label: 'Excerpt', hint: 'Will be used for the events excerpt on index pages.'
@@ -5,9 +5,9 @@
5
5
  = f.hide_if(:save_as_draft, true) do
6
6
  .row
7
7
  .col-md-6
8
- = f.datetime_field :published_start_at, hint: 'The event will be available starting on this date and time. Leave blank to use the current date and time.'
8
+ = f.datetime_field :published_start_at, hint: 'The event will be available starting on this date and time. Leave blank to publish immediately.'
9
9
  .col-md-6
10
- = f.datetime_field :published_end_at, hint: 'The event will no longer be available after this date and time. Leave blank for no end date.', date_linked: false
10
+ = f.datetime_field :published_end_at, label: 'Published start', hint: 'The event will not appear on the website after this date and time. Leave blank for no end date.', date_linked: false
11
11
 
12
12
  = f.check_box :save_as_draft, label: "Save as a draft. It will not appear on the website and can only be accessed by admin users."
13
13
 
@@ -19,14 +19,14 @@
19
19
  .col
20
20
  - categories = EffectiveEvents.categories
21
21
  - if categories.present?
22
- = f.select :category, categories, hint: 'optional category'
22
+ = f.select :category, categories
23
23
  .col
24
24
  - if event.class.respond_to?(:acts_as_tagged?)
25
25
  = render 'effective/tags/fields', f: f
26
26
 
27
27
  .row
28
- .col-md-6= f.datetime_field :start_at, label: "Event Start"
29
- .col-md-6= f.datetime_field :end_at, label: "Event End"
28
+ .col-md-6= f.datetime_field :start_at, label: "Event start"
29
+ .col-md-6= f.datetime_field :end_at, label: "Event end"
30
30
 
31
31
  %hr
32
32
 
@@ -34,10 +34,10 @@
34
34
  .col-md-6
35
35
  %h2 Registration
36
36
  %p The online registration and purchase for this event will be available between:
37
- = f.datetime_field :registration_start_at, label: "Registration Start"
38
- = f.datetime_field :registration_end_at, label: "Registration End"
39
- = f.datetime_field :early_bird_end_at, label: "Early Bird End",
40
- hint: 'Event tickets can be purchased for early bird pricing before this date. Afterwards regular pricing applies.'
37
+ = f.datetime_field :registration_start_at, label: "Registration start"
38
+ = f.datetime_field :registration_end_at, label: "Registration end"
39
+ = f.datetime_field :early_bird_end_at, label: "Early bird end",
40
+ hint: 'Event tickets are purchased at early bird pricing before this date. After this date, regular pricing applies.'
41
41
 
42
42
  = f.check_box :allow_blank_registrants, label: "Yes, allow blank ticket registrations", hint: "Allow event tickets to be purchased without adding a name. The purchaser may return to add names later."
43
43
 
@@ -7,7 +7,7 @@
7
7
 
8
8
  %p This event has the following tickets available for purchase:
9
9
 
10
- %table.table
10
+ %table.table.table-sm.table-striped
11
11
  %thead
12
12
  %tr
13
13
  %th Ticket
@@ -20,7 +20,7 @@
20
20
  %tr
21
21
  %td
22
22
  = ticket.to_s
23
- - if ticket.capacity.present?
23
+ - if ticket.capacity.present? && ticket.display_capacity?
24
24
  %br
25
25
  %small
26
26
  #{ticket.capacity_available} remaining
@@ -1,3 +1,3 @@
1
1
  .row
2
2
  .col-lg-3.mb-3= render_wizard_sidebar(resource)
3
- .col-lg-9= yield
3
+ .col-lg-9.mb-3= yield
@@ -16,4 +16,5 @@
16
16
  .alert.alert-info If the price of your registration changes, your order will be automatically updated.
17
17
 
18
18
  %hr
19
- = f.save 'Save and Continue'
19
+ .mb-4
20
+ = f.save 'Save and Continue'
@@ -1,9 +1,13 @@
1
- .card.mb-4{class: "effective-events-#{event.category.to_s.parameterize}"}
2
- .card-body
3
- - if event.category.present?
4
- = link_to(event.category, effective_events.events_path + '/' + event.category.parameterize, class: "badge badge-event mb-2 effective-events-#{event.category.parameterize}")
1
+ .row.mb-5.effective-events{class: "effective-events-#{event.category.to_s.parameterize}"}
2
+ - if event.file.present?
3
+ .col-lg-4
4
+ = link_to effective_events.event_path(event) do
5
+ = image_tag url_for(event.file), class: "effective-events-image d-none d-lg-flex align-self-start", alt: event.title, width: "350", height: "220"
5
6
 
6
- %h2.mt-1= link_to event.title, effective_events.event_path(event)
7
- .effective-events-schedule= effective_events_event_schedule(event)
7
+ .col
8
+ - if event.category.present? && EffectiveEvents.categories.length > 1
9
+ = link_to(event.category, effective_events.events_path + '/' + event.category.parameterize, class: "badge badge-primary badge-event mb-2 effective-events-#{event.category.parameterize}")
10
+
11
+ %h2.effective-events-title= link_to event.title, effective_events.event_path(event)
12
+ .effective-events-meta= effective_events_event_schedule(event)
8
13
  .effective-events-excerpt= event.excerpt.to_s
9
- = link_to "View Event", effective_events.event_path(event), class: 'btn btn-primary'
@@ -2,10 +2,10 @@
2
2
  - if f.object.term.present?
3
3
  = f.search_field :term, label: 'Term'
4
4
 
5
- /= f.radios :category, EffectiveEvents.categories, buttons: true
5
+ = f.radios :category, EffectiveEvents.categories
6
6
 
7
7
  - f.object.order ||= Effective::EventSearch::ORDERS.first
8
- = f.radios :order, Effective::EventSearch::ORDERS, buttons: true
8
+ = f.radios :order, Effective::EventSearch::ORDERS
9
9
 
10
- = f.save('Search', class: 'btn btn-primary btn-search mr-3', name: nil)
10
+ = f.save('Apply Filters', class: 'btn btn-primary btn-search mr-3', name: nil)
11
11
  = link_to 'Reset filters', request.path
@@ -1,2 +1,2 @@
1
- .effective-events
1
+ .effective-events.mb-3
2
2
  = yield
@@ -0,0 +1,6 @@
1
+ .effective-event-sidebar
2
+ %ul.nav.flex-column{role: 'navigation'}
3
+ = nav_link_to('All Events', effective_events.events_path, class: "effective-event-all")
4
+
5
+ - EffectiveEvents.categories.each do |category|
6
+ = nav_link_to(category, effective_events.events_path + '/' + category.parameterize, class: "effective-event-#{category.parameterize}")
@@ -1,25 +1,19 @@
1
1
  = render 'layout' do
2
+ .row
3
+ - if EffectiveEvents.categories.length > 1
4
+ .d-none.d-lg-block.col-lg-3
5
+ -#= render('effective/events/form', event_search: @event_search)
6
+ = render('effective/events/sidebar')
2
7
 
3
- -# render_datatable(@datatable)
4
-
5
- .mb-4= render('effective/events/categories')
6
- .mb-4= render('effective/events/form', event_search: @event_search)
7
-
8
- - results = @event_search.results(page: params[:page])
9
-
10
- - if @event_search.present? && results.length == 0
11
- .alert.alert-info.mb-3 There are no results for your search. Please try again.
8
+ .col
9
+ %h1.effective-title.mb-4= @page_title
12
10
 
13
- .row
14
- .col-md-3
15
- = month_calendar(events: @events) do |date, events|
16
- - if events.any? { |event| event.start_at.to_date == date }
17
- = date.day
18
- - else
19
- &nbsp;
20
- .col-md-9
21
- -# This renders effective/events/event
22
- = render(results)
11
+ - results = @event_search.results(page: params[:page])
12
+ - if (@event_search.present? && results.length == 0) || @events.blank?
13
+ .alert.alert-warning.mb-3
14
+ There are no active #{events_label.downcase} for this category.
15
+ - else
16
+ = render(results) # This renders effective/events/event
23
17
 
24
- %nav.d-flex.justify-content-center
25
- = bootstrap_paginate(results, per_page: @event_search.per_page)
18
+ %nav.d-flex.justify-content-center
19
+ = bootstrap_paginate(results, per_page: @event_search.per_page)
@@ -1,74 +1,66 @@
1
1
  = render 'layout' do
2
2
  .effective-event
3
3
  .row
4
+ - if EffectiveEvents.categories.length > 1
5
+ .col-lg-3
6
+ = render('effective/events/sidebar')
7
+
4
8
  .col
5
- %h1.mb-4= @page_title
9
+ %h1.effective-event-title.mb-4= @page_title
10
+
11
+ - if @event.sold_out?
12
+ .alert.alert-warning.mb-3 This event is sold out.
13
+
14
+ - if @event.closed?
15
+ .alert.alert-warning.mb-3 This event is no longer available.
6
16
 
7
- .row
8
- .col-md-3
9
17
  - if @event.registerable?
10
18
  .register.mb-4
11
19
  - url = @event.external_registration_url.presence || effective_events.new_event_event_registration_path(@event)
12
- = link_to 'Register', url, class: 'btn btn-primary btn-block'
13
-
14
- %ul.list-unstyled
15
- -# Not shown
16
- -# %li.mb-3
17
- -# %label Published
18
- -# %br
19
- -# = @event.published_at.strftime("%B %e at %l:%M%P")
20
- %li.mb-3
21
- %label Event Date
22
- %br
23
- = effective_events_event_schedule(@event)
20
+ = link_to 'Register', url, class: 'btn btn-lg btn-primary'
24
21
 
25
- - if @event.registration_start_at.present?
26
- %li.mb-3
27
- %label Registration Opens
28
- %br
29
- = @event.registration_start_at.strftime("%b %d, %Y %I:%M%P")
30
-
31
- - if @event.early_bird_end_at.present?
32
- %li.mb-3
33
- %label Early Bird Rate Ends
34
- %br
35
- = @event.early_bird_end_at.strftime("%b %d, %Y %I:%M%P")
36
-
37
- - if @event.registration_end_at.present?
38
- %li.mb-3
39
- %label Registration Closes
40
- %br
41
- = @event.registration_end_at.strftime("%b %d, %Y %I:%M%P")
42
-
43
- - if @event.event_tickets.present?
44
- %ul.list-unstyled
45
- - if @event.event_tickets.present?
46
- %li
47
- %label Tickets
22
+ .row
23
+ .col
24
+ %ul.list-unstyled
25
+ %li.mb-3
26
+ %label Date and Time
48
27
  %br
49
- %ul
50
- - @event.event_tickets.each do |ticket|
51
- %li= "#{ticket} (#{effective_events_ticket_price(@event, ticket)})"
28
+ = effective_events_event_schedule(@event)
52
29
 
53
- %hr
30
+ - if @event.registration_start_at.present?
31
+ %li.mb-3
32
+ %label Registration Opens
33
+ %br
34
+ = @event.registration_start_at.strftime("%A, %B %d, %Y · %l:%M%P")
54
35
 
55
- %label.mb-2 Upcoming Events
56
- %ul.list-unstyled
57
- %li.mb-3
58
- - @upcoming_events.each do |event|
59
- %h5= link_to event.title, effective_events.event_path(event), class: 'text-decoration-none'
36
+ - if @event.early_bird_end_at.present?
37
+ %li.mb-3
38
+ %label Early Bird Rate Ends
39
+ %br
40
+ = @event.early_bird_end_at.strftime("%A, %B %d, %Y · %l:%M%P")
60
41
 
61
- .col-md-8
62
- - if @event.sold_out?
63
- .alert.alert-warning.mb-3 This event is sold out.
42
+ - if @event.registration_end_at.present?
43
+ %li.mb-3
44
+ %label Registration Closes
45
+ %br
46
+ = @event.registration_end_at.strftime("%A, %B %d, %Y · %l:%M%P")
64
47
 
65
- - if @event.closed?
66
- .alert.alert-warning.mb-3 This event is no longer available.
48
+ -# .col-md-auto
49
+ -# - if @event.event_tickets.present?
50
+ -# %label Tickets
51
+ -# %br
52
+ -# %ul
53
+ -# - @event.event_tickets.each do |ticket|
54
+ -# %li= "#{ticket} (#{effective_events_ticket_price(@event, ticket)})"
67
55
 
68
- - if @event.file.attached?
69
- .d-flex.justify-content-center.mb-3
70
- = image_tag(@event.file)
56
+ - if @event.file.present?
57
+ .col-lg-4
58
+ = image_tag url_for(@event.file), class: "effective-events-image d-none d-lg-flex align-self-start", alt: @event.title, width: "350", height: "220"
59
+
60
+ .py-3
71
61
 
72
62
  - if @event.body.present?
73
- .content.my-5
63
+ .effective-event-body.mb-5
74
64
  = @event.body.to_s
65
+
66
+ = link_to("&larr; #{events_name_label}".html_safe, effective_events.events_path, class: "btn btn-secondary my-4")
@@ -16,7 +16,7 @@ EffectiveEvents.setup do |config|
16
16
  config.categories = ['Events']
17
17
 
18
18
  # Hint text for event images attachments
19
- config.events_hint_text = 'Hint text that includes required image dimensions'
19
+ config.events_hint_text = 'Optional. Shown on the events index and event pages. Dimensions are 220px tall and 350px wide.'
20
20
 
21
21
  # Validations for Event Registrants
22
22
  # config.event_registrant_required_fields = [:first_name, :last_name, :email, :company]
@@ -1,12 +1,11 @@
1
1
  en:
2
2
  effective_events:
3
- name: 'Effective Events'
4
- acronym: 'Events'
3
+ name: 'Events'
5
4
 
6
5
  activerecord:
7
6
  models:
8
7
  effective/event: 'Event'
9
- effective/event_registrant: 'Event Registrant'
8
+ effective/event_registrant: 'Event registrant'
10
9
 
11
10
  attributes:
12
11
  effective/event_registrant:
@@ -42,6 +42,8 @@ class CreateEffectiveEvents < ActiveRecord::Migration[6.0]
42
42
 
43
43
  t.string :title
44
44
  t.integer :capacity
45
+ t.boolean :display_capacity, default: false
46
+
45
47
  t.boolean :waitlist, default: false
46
48
  t.string :category
47
49
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveEvents
2
- VERSION = '0.17.0'.freeze
2
+ VERSION = '0.18.1'.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.17.0
4
+ version: 0.18.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-07-08 00:00:00.000000000 Z
11
+ date: 2024-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -289,11 +289,11 @@ files:
289
289
  - app/views/effective/event_registrations/submitted.html.haml
290
290
  - app/views/effective/event_registrations/summary.html.haml
291
291
  - app/views/effective/event_registrations/tickets.html.haml
292
- - app/views/effective/events/_categories.html.haml
293
292
  - app/views/effective/events/_dashboard.html.haml
294
293
  - app/views/effective/events/_event.html.haml
295
294
  - app/views/effective/events/_form.html.haml
296
295
  - app/views/effective/events/_layout.html.haml
296
+ - app/views/effective/events/_sidebar.html.haml
297
297
  - app/views/effective/events/index.html.haml
298
298
  - app/views/effective/events/show.html.haml
299
299
  - app/views/effective/events_mailer/event_registrant_purchased.liquid
@@ -1,6 +0,0 @@
1
- .effective-event-categories
2
- %ul.nav.nav-pills{role: 'navigation'}
3
- = nav_link_to('All Events', effective_events.events_path, class: "nav-pill-effective-event effective-event-all")
4
-
5
- - EffectiveEvents.categories.each do |category|
6
- = nav_link_to(category, effective_events.events_path + '/' + category.parameterize, class: "nav-pill-effective-event effective-event-#{category.parameterize}")