effective_events 3.7.0 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/effective/events_controller.rb +5 -2
- data/app/helpers/effective_events_helper.rb +5 -1
- data/app/models/effective/event.rb +4 -2
- data/app/views/admin/events/_form_event.html.haml +4 -0
- data/db/migrate/101_create_effective_events.rb +1 -0
- data/lib/effective_events/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 691de43519f18e7e0eb3a3e1455dbd889011acc687656d1a62ee7a714e736ae9
|
|
4
|
+
data.tar.gz: ff075cc0d7476dca2955b05e714256019e67d17dbf79a052f7577f3feb0fbac8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 777341e1bbbacdb48f3fc0a00f118a28141760ee2cc45670a347ee475e25a3845fb0b993bccb3e5fc1886dcc1ca9e6c26f9d69dc9a73a1077c854122081ff312
|
|
7
|
+
data.tar.gz: 7b4d11151cc30e233e39668ab162d34f2e560205e0a863f2631e6dc9c5fe82c80c9fb924b98ee97f3a7d0b5e9510bbe55ae8e12e1ac50e7e88d6a884b4ebc861
|
|
@@ -4,7 +4,9 @@ module Effective
|
|
|
4
4
|
|
|
5
5
|
resource_scope -> {
|
|
6
6
|
unpublished = EffectiveResources.authorized?(self, :admin, :effective_events)
|
|
7
|
-
Effective::Event.
|
|
7
|
+
scope = Effective::Event.deep
|
|
8
|
+
scope = scope.published unless unpublished
|
|
9
|
+
scope
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
def index
|
|
@@ -49,7 +51,8 @@ module Effective
|
|
|
49
51
|
if EffectiveResources.authorized?(self, :admin, :effective_events)
|
|
50
52
|
flash.now[:warning] = [
|
|
51
53
|
'Hi Admin!',
|
|
52
|
-
('
|
|
54
|
+
('This event is not published.' if @event.draft?),
|
|
55
|
+
('This event is hidden from the events page and sitemap.' if @event.hidden?),
|
|
53
56
|
("<a href='#{effective_events.edit_admin_event_path(@event)}' class='alert-link'>Edit this event</a>.")
|
|
54
57
|
].compact.join(' ')
|
|
55
58
|
end
|
|
@@ -24,13 +24,17 @@ module EffectiveEventsHelper
|
|
|
24
24
|
def admin_event_status_badge(event)
|
|
25
25
|
return nil unless EffectiveResources.authorized?(self, :admin, :effective_events)
|
|
26
26
|
|
|
27
|
-
if event.try(:archived?)
|
|
27
|
+
status = if event.try(:archived?)
|
|
28
28
|
content_tag(:span, 'ARCHIVED', class: 'badge badge-secondary')
|
|
29
29
|
elsif event.draft?
|
|
30
30
|
content_tag(:span, 'NOT PUBLISHED', class: 'badge badge-danger')
|
|
31
31
|
elsif event.published? == false
|
|
32
32
|
content_tag(:span, "TO BE PUBLISHED AT #{event.published_start_at&.strftime('%F %H:%M') || 'LATER'}", class: 'badge badge-danger')
|
|
33
33
|
end
|
|
34
|
+
|
|
35
|
+
hidden = content_tag(:span, 'HIDDEN', class: 'badge badge-warning') if event.hidden?
|
|
36
|
+
|
|
37
|
+
safe_join([status, hidden].compact, ' ')
|
|
34
38
|
end
|
|
35
39
|
|
|
36
40
|
def effective_events_event_schedule(event)
|
|
@@ -59,6 +59,7 @@ module Effective
|
|
|
59
59
|
published_start_at :datetime
|
|
60
60
|
published_end_at :datetime
|
|
61
61
|
legacy_draft :boolean # No longer used. To be removed.
|
|
62
|
+
hidden :boolean # Hidden from Events#index and the sitemap.
|
|
62
63
|
|
|
63
64
|
start_at :datetime
|
|
64
65
|
end_at :datetime
|
|
@@ -86,7 +87,8 @@ module Effective
|
|
|
86
87
|
|
|
87
88
|
scope :sorted, -> { order(start_at: :desc) }
|
|
88
89
|
|
|
89
|
-
scope :
|
|
90
|
+
scope :not_hidden, -> { where(hidden: false) }
|
|
91
|
+
scope :for_sitemap, -> { published.not_hidden }
|
|
90
92
|
|
|
91
93
|
scope :deep, -> {
|
|
92
94
|
base = includes(:event_registrants, :rich_texts, event_tickets: :event_registrants)
|
|
@@ -126,7 +128,7 @@ module Effective
|
|
|
126
128
|
end
|
|
127
129
|
|
|
128
130
|
unless unpublished
|
|
129
|
-
scope = scope.published
|
|
131
|
+
scope = scope.published.not_hidden
|
|
130
132
|
end
|
|
131
133
|
|
|
132
134
|
scope
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
= f.text_field :title, label: "Title"
|
|
3
3
|
|
|
4
4
|
= acts_as_published_fields(f)
|
|
5
|
+
.row
|
|
6
|
+
.col
|
|
7
|
+
= f.check_box :hidden, label: 'Hide from the events page', hint: 'The event will remain accessible by its direct link and available for registration, but will not appear on the events page or in the sitemap.'
|
|
8
|
+
|
|
5
9
|
= acts_as_slugged_fields(f, url: (effective_events.event_url(f.object) rescue nil))
|
|
6
10
|
|
|
7
11
|
.row
|