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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 146d98c901aee1e581e5f34ab7e92d67e7e1f96baf2d3c6be875c99cf58de1a1
4
- data.tar.gz: 93654dfa9d54f6a4b5be26a31a3462fcab075408c82e8f882a07a0b1081bf0a0
3
+ metadata.gz: 7653da73f90a91355b58b9da44d32ad5a9c9cfb4cda6c996f08bb052e143714f
4
+ data.tar.gz: 9f845411770991a68ebd447e7a3007240175489071eb4d21053044414a23e9cd
5
5
  SHA512:
6
- metadata.gz: 6d2eb4b943572972ab938d8b2223c162ad87c99dfaa36f48f88d8412e9a4fcbeaca82f928523d72a4d20fd49f37ba1cd6c00453b512d1c49e9d9d6a65af394f8
7
- data.tar.gz: c09166658be072cb49804dbc12fe7357caeefcfd1f9d1381089789ed767df9af9e5f1377187a726ea6b7743263a946b24c7882c1ef57a9d80cc599cf6547e506
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
- if defined?(EffectiveRoles) && EffectiveEvents.use_effective_roles
117
- scope = scope.for_role(user&.roles)
118
- end
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 for #{registration.event}", effective_events.event_event_registration_build_path(registration.event, registration, registration.next_step), 'data-turbolinks' => false, class: 'btn btn-primary')
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
@@ -1,3 +1,3 @@
1
1
  module EffectiveEvents
2
- VERSION = '0.24.0'.freeze
2
+ VERSION = '2.25.0'.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.24.0
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-06 00:00:00.000000000 Z
11
+ date: 2024-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails