effective_events 0.24.0 → 2.25.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/effective/events_controller.rb +0 -4
- data/app/helpers/effective_events_helper.rb +18 -0
- data/app/models/effective/event.rb +4 -7
- data/app/views/effective/event_registrations/_dashboard.html.haml +1 -1
- data/app/views/effective/events/_event.html.haml +3 -0
- data/lib/effective_events/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7653da73f90a91355b58b9da44d32ad5a9c9cfb4cda6c996f08bb052e143714f
|
4
|
+
data.tar.gz: 9f845411770991a68ebd447e7a3007240175489071eb4d21053044414a23e9cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67d2066762e9fde6cfbec7c4d3ba73140eb1d284e730a45a49a24a6a397b58763a146e4dee5da75069f7405703a97ce2847dba2774c2aed99e056bde5db4687c
|
7
|
+
data.tar.gz: 3bf8b960cead89efb84a40cf3e27c319987eb5e36d49c71a8f32c46411e40280aa0b139e9c52e37da401ac91575b45ce4e61dc40ea7d2b8215a21ac23077262a
|
@@ -36,10 +36,6 @@ module Effective
|
|
36
36
|
@event = resource_scope.find(params[:id])
|
37
37
|
@upcoming_events = resource_scope.upcoming.where.not(id: @event.id)
|
38
38
|
|
39
|
-
if @event.respond_to?(:roles_permit?)
|
40
|
-
raise Effective::AccessDenied.new('Access Denied', :show, @event) unless @event.roles_permit?(current_user)
|
41
|
-
end
|
42
|
-
|
43
39
|
EffectiveResources.authorize!(self, :show, @event)
|
44
40
|
|
45
41
|
if EffectiveResources.authorized?(self, :admin, :effective_events)
|
@@ -15,6 +15,24 @@ module EffectiveEventsHelper
|
|
15
15
|
ets(Effective::Event)
|
16
16
|
end
|
17
17
|
|
18
|
+
def event_status_badge(event)
|
19
|
+
event.roles.map do |role|
|
20
|
+
content_tag(:span, "#{role.to_s.upcase} ONLY", class: 'badge badge-secondary')
|
21
|
+
end.join(' ').html_safe
|
22
|
+
end
|
23
|
+
|
24
|
+
def admin_event_status_badge(event)
|
25
|
+
return nil unless EffectiveResources.authorized?(self, :admin, :effective_events)
|
26
|
+
|
27
|
+
if event.try(:archived?)
|
28
|
+
content_tag(:span, 'ARCHIVED', class: 'badge badge-secondary')
|
29
|
+
elsif event.draft?
|
30
|
+
content_tag(:span, 'NOT PUBLISHED', class: 'badge badge-danger')
|
31
|
+
elsif event.published? == false
|
32
|
+
content_tag(:span, "TO BE PUBLISHED AT #{event.published_start_at&.strftime('%F %H:%M') || 'LATER'}", class: 'badge badge-danger')
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
18
36
|
def effective_events_event_schedule(event)
|
19
37
|
if event.start_at.beginning_of_day == event.end_at.beginning_of_day
|
20
38
|
"#{event.start_at.strftime("%A, %B %d, %Y · %l:%M%P")} - #{event.end_at.strftime("%l:%M%P")}"
|
@@ -113,13 +113,10 @@ module Effective
|
|
113
113
|
scope :events, -> (user: nil, category: nil, unpublished: false) {
|
114
114
|
scope = all.deep
|
115
115
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
if user.blank?
|
121
|
-
scope = scope.where(authenticate_user: false)
|
122
|
-
end
|
116
|
+
# We include member only events for all users
|
117
|
+
# if defined?(EffectiveRoles) && EffectiveEvents.use_effective_roles
|
118
|
+
# scope = scope.for_role(user&.roles)
|
119
|
+
# end
|
123
120
|
|
124
121
|
if category.present?
|
125
122
|
scope = scope.where(category: category)
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
%p
|
16
16
|
Please
|
17
|
-
= link_to("Continue registration
|
17
|
+
= link_to("Continue registration", effective_events.event_event_registration_build_path(registration.event, registration, registration.next_step), 'data-turbolinks' => false, class: 'btn btn-primary')
|
18
18
|
or you can
|
19
19
|
= link_to('Abandon registration', effective_events.event_event_registration_path(registration.event, registration), 'data-confirm': "Really delete registration for #{registration.event}?", 'data-method': :delete, class: 'btn btn-danger')
|
20
20
|
to register for another event.
|
@@ -12,6 +12,9 @@
|
|
12
12
|
- if event.category.present? && EffectiveEvents.categories.length > 1
|
13
13
|
= link_to(event.category, effective_events.events_path + '/' + event.category.parameterize, class: "badge badge-primary badge-event mb-2 effective-events-#{event.category.parameterize}")
|
14
14
|
|
15
|
+
= event_status_badge(event)
|
16
|
+
= admin_event_status_badge(event)
|
17
|
+
|
15
18
|
%h2.effective-events-title= link_to event.title, effective_events.event_path(event)
|
16
19
|
.effective-events-meta= effective_events_event_schedule(event)
|
17
20
|
.effective-events-excerpt= event.excerpt.to_s
|
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:
|
4
|
+
version: 2.25.0
|
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-12-
|
11
|
+
date: 2024-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|