effective_events 0.6.5 → 0.6.7

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: f24e45c933e3321aedd576be10a7df7d8ce1ec1f4599e9ae8509a9997d1645c2
4
- data.tar.gz: 62c674e85d85fea359bb32425a2f2eb515e17153a2d435dc57c4fc2359a1a5e1
3
+ metadata.gz: e2a902e5d3728d5cea14da58094f0e6cc8a64c72491fb45c62637895811c7e9d
4
+ data.tar.gz: d2da9b7ec73953f311dff46d07c7077af1b382891a93bd2392f87b9cbd9849fc
5
5
  SHA512:
6
- metadata.gz: 82304ee7f0098f50722860d3dd7c96c7805184adad091db68adcac850bb4b34d7ee3fa5d44a68a1c3c2013e03132a2a138097c19ff718b69ea34c5f6ceee4eec
7
- data.tar.gz: 13a8e694faea6f2b093ef6c30a30cc199dabc3890a16f3e6f6500ae8cc7100c786820fc202433f738233f673f9adee34ebec610cc2ce39504894840e34c238b3
6
+ metadata.gz: 22c5152ac0c15105cb822bc8b9c8eec214f54268e89b3a8e9c3b688c479ea9be64d73a85d69c09034fe6b0508cf3dec95ac535f98c808b836d315fb82f338bcd
7
+ data.tar.gz: 31402819144cbc718c3873fe829842460726dc175bd81bee9b18810149841507eed10bb87c5f6cc7a5e10b1133b47f5609fa979279998d9d5ec714057e7952af
@@ -23,6 +23,7 @@ module Effective
23
23
 
24
24
  def show
25
25
  @event = resource_scope.find(params[:id])
26
+ @upcoming_events = resource_scope.upcoming.where.not(id: @event.id)
26
27
 
27
28
  if @event.respond_to?(:roles_permit?)
28
29
  raise Effective::AccessDenied.new('Access Denied', :show, @event) unless @event.roles_permit?(current_user)
@@ -5,20 +5,7 @@ module Effective
5
5
  if defined?(PgSearch)
6
6
  include PgSearch::Model
7
7
 
8
- multisearchable against: [
9
- :title,
10
- :slug,
11
- ],
12
- associated_against: {
13
- rich_texts: [:body],
14
- },
15
- using: {
16
- trigram: {},
17
- tsearch: {
18
- highlight: true,
19
- }
20
- }
21
-
8
+ multisearchable against: [:body]
22
9
  end
23
10
 
24
11
  has_many :event_tickets, -> { EventTicket.sorted }, inverse_of: :event, dependent: :destroy
@@ -16,7 +16,7 @@ module Effective
16
16
 
17
17
  # Base collection to search.
18
18
  def collection
19
- Event.events(user: current_user, unpublished: unpublished)
19
+ Event.events(user: current_user, unpublished: unpublished).upcoming
20
20
  end
21
21
 
22
22
  def per_page
@@ -1,57 +1,82 @@
1
1
  = render 'layout' do
2
2
  .effective-event
3
- - if @event.sold_out?
4
- .alert.alert-warning.mb-3 This event is sold out.
5
-
6
- - if @event.closed?
7
- .alert.alert-warning.mb-3 This event is no longer available.
8
-
9
- - if @event.registerable?
10
- .resource-buttons
11
- - url = @event.external_registration_url.presence || effective_events.new_event_event_registration_path(@event)
12
- = link_to 'Register', url, class: 'btn btn-primary'
13
-
14
- - if @event.file.attached?
15
- = image_tag(@event.file)
16
-
17
- %ul.list-unstyled
18
- -# Not shown
19
- %li
20
- %strong Published:
21
- = @event.published_at.strftime("%b %d, %Y %I:%M%P")
22
-
23
- %li
24
- %strong Event Date:
25
- = effective_events_event_schedule(@event)
26
-
27
- - if @event.registration_start_at.present?
28
- %li
29
- %strong Registration Opens:
30
- = @event.registration_start_at.strftime("%b %d, %Y %I:%M%P")
31
-
32
- - if @event.early_bird_end_at.present?
33
- %li
34
- %strong Early Bird Rate Ends:
35
- = @event.early_bird_end_at.strftime("%b %d, %Y %I:%M%P")
36
-
37
- - if @event.registration_end_at.present?
38
- %li
39
- %strong Registration Closes:
40
- = @event.registration_end_at.strftime("%b %d, %Y %I:%M%P")
41
-
42
- - if @event.event_tickets.present?
43
- %li
44
- %strong Tickets
45
- %ul
46
- - @event.event_tickets.each do |ticket|
47
- %li= "#{ticket} (#{price_to_currency(ticket.price)})"
48
-
49
- - if @event.event_products.present?
50
- %li
51
- %strong Add-ons
52
- %ul
53
- - @event.event_products.each do |product|
54
- %li= "#{product} (#{price_to_currency(product.price)})"
55
-
56
- - if @event.body.present?
57
- = @event.body.to_s
3
+ .row
4
+ .col
5
+ %h1.mb-4= @page_title
6
+
7
+ .row
8
+ .col-md-3
9
+ - if @event.registerable?
10
+ .register.mb-4
11
+ - 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)
24
+
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? #|| @event.event_products.present?
44
+ %ul.list-unstyled
45
+ - if @event.event_tickets.present?
46
+ %li
47
+ %label Tickets
48
+ %br
49
+ %ul
50
+ - @event.event_tickets.each do |ticket|
51
+ %li= "#{ticket} (#{price_to_currency(ticket.price)})"
52
+
53
+ -# - if @event.event_products.present?
54
+ -# %li
55
+ -# %label Add-ons
56
+ -# %br
57
+ -# %ul
58
+ -# - @event.event_products.each do |product|
59
+ -# %li= "#{product} (#{price_to_currency(product.price)})"
60
+
61
+ %hr
62
+
63
+ %label.mb-2 Upcoming Events
64
+ %ul.list-unstyled
65
+ %li.mb-3
66
+ - @upcoming_events.each do |event|
67
+ %h5= link_to event.title, effective_events.event_path(event), class: 'text-decoration-none'
68
+
69
+ .col-md-8
70
+ - if @event.sold_out?
71
+ .alert.alert-warning.mb-3 This event is sold out.
72
+
73
+ - if @event.closed?
74
+ .alert.alert-warning.mb-3 This event is no longer available.
75
+
76
+ - if @event.file.attached?
77
+ .d-flex.justify-content-center.mb-3
78
+ = image_tag(@event.file)
79
+
80
+ - if @event.body.present?
81
+ .content.my-5
82
+ = @event.body.to_s
@@ -1,3 +1,3 @@
1
1
  module EffectiveEvents
2
- VERSION = '0.6.5'.freeze
2
+ VERSION = '0.6.7'.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.6.5
4
+ version: 0.6.7
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-06-20 00:00:00.000000000 Z
11
+ date: 2023-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails