effective_events 0.24.0 → 2.25.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: 146d98c901aee1e581e5f34ab7e92d67e7e1f96baf2d3c6be875c99cf58de1a1
4
- data.tar.gz: 93654dfa9d54f6a4b5be26a31a3462fcab075408c82e8f882a07a0b1081bf0a0
3
+ metadata.gz: e49dbeed14ddc0a39bfb16c58d43d8a27221be836ccf68b71d1750509d3cc192
4
+ data.tar.gz: df551529a5da562d702fdcdef007d5c3f8bd15f80de0bf1642a7db8cb1bb5daa
5
5
  SHA512:
6
- metadata.gz: 6d2eb4b943572972ab938d8b2223c162ad87c99dfaa36f48f88d8412e9a4fcbeaca82f928523d72a4d20fd49f37ba1cd6c00453b512d1c49e9d9d6a65af394f8
7
- data.tar.gz: c09166658be072cb49804dbc12fe7357caeefcfd1f9d1381089789ed767df9af9e5f1377187a726ea6b7743263a946b24c7882c1ef57a9d80cc599cf6547e506
6
+ metadata.gz: b70217d0fd2310908a1c562995360703784b7802ddb55de57ea3112d77e9e5d945ea23086311f2154e76f00f7280eaa078354bc2bd1fc6dec0b58641ec79714c
7
+ data.tar.gz: 1c8cdecacf234f76524d580ff360f365a95da3ac872e6d9070e68c85d1c39f355a90a735f43bebe2eb89c32784cd17d73c5603bde2123774850434db85b70127
@@ -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")}"
@@ -342,6 +342,14 @@ module EffectiveEventsEventRegistration
342
342
  save!
343
343
  end
344
344
 
345
+ def details!
346
+ after_commit do
347
+ update_submit_fees_and_order! if submit_order.present?
348
+ end
349
+
350
+ save!
351
+ end
352
+
345
353
  def addons!
346
354
  after_commit do
347
355
  update_submit_fees_and_order! if submit_order.present?
@@ -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.
@@ -2,7 +2,7 @@
2
2
  = render 'effective/event_registrations/content', resource: resource
3
3
 
4
4
  - raise('expected a submitted event_registration') unless resource.submitted?
5
- - raise('expected a deffered event_registration submit_order') unless resource.submit_order&.deferred?
5
+ - raise('expected a deffered event_registration submit_order') unless resource.submit_order&.was_deferred?
6
6
 
7
7
  -# - if resource.event.delayed?
8
8
  -# - raise('expected event delayed_payment_date to match order delayed_payment_date') unless resource.event.delayed_payment_date == resource.submit_order.delayed_payment_date
@@ -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.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.24.0
4
+ version: 2.25.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-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