effective_events 0.18.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: 192d39046e600f74608d6f9b5bf1cc90f14be13eabb74ceed9365579919e2a95
4
- data.tar.gz: af3326868396402818278f3144a3ea061c417c1b65e7cc178be801726bb16d59
3
+ metadata.gz: e59fad0b6c38bbbdd06763e8f6d2d4d19cc025b82434db4a27b3c6fd0f88b75e
4
+ data.tar.gz: 02151c1c1ad10e49b6c38b8e9e603246732b1c686f19399bf08c9f7110e0190e
5
5
  SHA512:
6
- metadata.gz: 3160971a296127da50d08aae0a1b35939d18f83aa65b479043b8f832b79812975c5b46759f9caab63f3b19b72d3ae0b3b372293011b45ee59dc4c0bd60753339
7
- data.tar.gz: b899987a70b37e98033d2c1ad634bfe65b00610b0326cdf353edeadc1c4fe6ecb8a2db7bbb26e53f383c1f339acb163a4e850fbac9941362c6d8abd2ee28dfeb
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
 
@@ -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
@@ -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.'
@@ -7,7 +7,7 @@
7
7
  .col-md-6
8
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
@@ -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
@@ -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,7 +1,6 @@
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:
@@ -1,3 +1,3 @@
1
1
  module EffectiveEvents
2
- VERSION = '0.18.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.18.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-16 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}")