effective_events 0.6.1 → 0.6.3

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: f65483dcf8a4afeea90171c934a922a5425dc9a11bff4e2494f52ed50be52c3c
4
- data.tar.gz: 0542dd1e060b1026adcb8e1358b0a069eebce29e48daadd7fb22d6c5fdb12355
3
+ metadata.gz: 5c5eec870decb050184747000f45203451f303d62d7ec429d9a0132122c67b49
4
+ data.tar.gz: 2cd76e06a859a34d214b556c686048be4a1cfa920d9b1a29ba3c1805786c1feb
5
5
  SHA512:
6
- metadata.gz: f959bc908fb33c74d0a59802c9829533bd1363ceb2d34b3db456c011bef45654fbb0c485a2ff7c5e6cbac494fd1340a8ba45402e5a4eaaabb8840e510c98c041
7
- data.tar.gz: 04350d65ef635616230e72cd86ef6ebd835d5943164133948c8ad5f8b8492bc713fbaf934c0b331b3292b74c782c0c21486bb09061028cd0e040ac844ea1107f
6
+ metadata.gz: 93454dbea3a2d7ad966fa2c2fb9007cdebef1cb8a9b237168a4f3cb3da1b086bced0e344ecb455a8fd4e4c083f5a7bc55c70b745012688ae8dc8926a1e4eea49
7
+ data.tar.gz: fca14c2e65806f9e7d38623ba97473a9ecb0ca7db918dfe987a28838fe1eb8df06dc11fb60d1dd1533ff8347baa89fbd52ef9f303b417bba2bf5b23fd3ccb169
data/README.md CHANGED
@@ -99,6 +99,9 @@ if user.admin?
99
99
  end
100
100
  ```
101
101
 
102
+ ## Calendar
103
+ `effective_events` comes with an integration with `simple_calendar` where events can be displayed in calendars. You can override its views using the command `rails g simple_calendar:views` - check out [Customizing Views](https://github.com/excid3/simple_calendar#customizing-the-calendar) for more information.
104
+
102
105
  ## License
103
106
 
104
107
  MIT License. Copyright [Code and Effect Inc.](http://www.codeandeffect.com/)
@@ -0,0 +1,25 @@
1
+ .effective__simple-calendar {
2
+ .calendar-heading {
3
+ background: $gray-200;
4
+ }
5
+
6
+ .calendar-arrow {
7
+ font-size: 10px;
8
+
9
+ a {
10
+ text-decoration: none;
11
+ }
12
+ }
13
+
14
+ .table th {
15
+ border: 0px;
16
+ }
17
+
18
+ .table td {
19
+ aspect-ratio: 1 / 1;
20
+ width: 2rem;
21
+ height: 2rem;
22
+ vertical-align: middle;
23
+ border: 1px solid $gray-200;
24
+ }
25
+ }
@@ -1 +1,2 @@
1
1
  @import 'effective_events/base';
2
+ @import 'effective_events/simple_calendar';
@@ -32,6 +32,7 @@ module Effective
32
32
 
33
33
  acts_as_slugged
34
34
  log_changes if respond_to?(:log_changes)
35
+ acts_as_tagged if respond_to?(:acts_as_tagged)
35
36
  acts_as_role_restricted if respond_to?(:acts_as_role_restricted)
36
37
 
37
38
  self.table_name = EffectiveEvents.events_table_name.to_s
@@ -117,7 +118,6 @@ module Effective
117
118
 
118
119
  validates :registration_start_at, presence: true, unless: -> { external_registration? }
119
120
  validates :registration_end_at, presence: true, unless: -> { external_registration? }
120
- validates :external_registration_url, presence: true, if: -> { external_registration? }
121
121
 
122
122
  validate(if: -> { start_at && end_at }) do
123
123
  self.errors.add(:end_at, 'must be after start date') unless start_at < end_at
@@ -167,7 +167,7 @@ module Effective
167
167
  return false if closed?
168
168
  return false if sold_out?
169
169
 
170
- external_registration? || event_tickets.present?
170
+ (external_registration? && external_registration_url.present?) || event_tickets.present?
171
171
  end
172
172
 
173
173
  def closed?
@@ -215,5 +215,9 @@ module Effective
215
215
  duplicate.tap { |event| event.save! }
216
216
  end
217
217
 
218
+ def start_time
219
+ start_at
220
+ end
221
+
218
222
  end
219
223
  end
@@ -5,6 +5,9 @@
5
5
  - if categories.present?
6
6
  = f.select :category, categories, hint: 'optional category'
7
7
 
8
+ - if event.class.respond_to?(:acts_as_tagged?)
9
+ = render 'effective/tags/fields', f: f
10
+
8
11
  = f.datetime_field :published_at, label: 'Publish date', hint: 'When should this be displayed on the website.'
9
12
  = f.check_box :draft, hint: 'Save this event as a draft. It will not be accessible on the website.'
10
13
 
@@ -1,4 +1,5 @@
1
1
  = render 'layout' do
2
+
2
3
  -# render_datatable(@datatable)
3
4
 
4
5
  .mb-4= render('effective/events/categories')
@@ -9,8 +10,16 @@
9
10
  - if @event_search.present? && results.length == 0
10
11
  .alert.alert-info There are no results for your search. Please try again.
11
12
 
12
- -# This renders effective/events/event
13
- = render(results)
13
+ .row
14
+ .col-md-3
15
+ = month_calendar(events: @events) do |date, events|
16
+ - if events.any? { |event| event.start_at.to_date == date }
17
+ = date.day
18
+ - else
19
+ &nbsp;
20
+ .col-md-9
21
+ -# This renders effective/events/event
22
+ = render(results)
14
23
 
15
24
  %nav.d-flex.justify-content-center
16
25
  = bootstrap_paginate(results, per_page: @event_search.per_page)
@@ -0,0 +1,20 @@
1
+ .effective__simple-calendar
2
+ .calendar-heading.d-flex.justify-content-between.align-items-center.mb-2.py-1
3
+ - date = params[:start_date].presence.try(:to_date) || Date.current
4
+ .calendar-arrow.p-1= link_to t('simple_calendar.previous', default: 'Previous').html_safe, effective_events.events_path(start_date: date - 1.month)
5
+ %span.calendar-title.text-uppercase.text-primary.font-weight-bold= t('date.month_names')[start_date.month]
6
+ .calendar-arrow.p-1= link_to t('simple_calendar.next', default: 'Next').html_safe, effective_events.events_path(start_date: date + 1.month)
7
+
8
+ %table.table.table-striped.table-sm
9
+ %thead
10
+ %tr.text-center.text-primary.font-weight-normal.py-2
11
+ - date_range.slice(0, 7).each do |day|
12
+ %th.px-1= t('date.abbr_day_names')[day.wday]
13
+
14
+ %tbody
15
+ - date_range.each_slice(7) do |week|
16
+ %tr
17
+ - week.each do |day|
18
+ - content = capture_haml(day, sorted_events.fetch(day, []), &passed_block)
19
+ = content_tag :td, class: content.to_i > 0 && 'text-center bg-primary font-weight-bold font-size-small text-white' do
20
+ = content
@@ -0,0 +1,15 @@
1
+ ---
2
+ en:
3
+ simple_calendar:
4
+ previous: "&#9664;"
5
+ next: "&#9654;"
6
+
7
+ date:
8
+ abbr_day_names:
9
+ - S
10
+ - M
11
+ - T
12
+ - W
13
+ - T
14
+ - F
15
+ - S
@@ -1,3 +1,3 @@
1
1
  module EffectiveEvents
2
- VERSION = '0.6.1'.freeze
2
+ VERSION = '0.6.3'.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.1
4
+ version: 0.6.3
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-02-24 00:00:00.000000000 Z
11
+ date: 2023-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -193,6 +193,7 @@ files:
193
193
  - app/assets/javascripts/effective_events/base.js
194
194
  - app/assets/stylesheets/effective_events.scss
195
195
  - app/assets/stylesheets/effective_events/base.scss
196
+ - app/assets/stylesheets/effective_events/simple_calendar.scss
196
197
  - app/controllers/admin/event_addons_controller.rb
197
198
  - app/controllers/admin/event_notifications_controller.rb
198
199
  - app/controllers/admin/event_products_controller.rb
@@ -260,7 +261,9 @@ files:
260
261
  - app/views/effective/events/index.html.haml
261
262
  - app/views/effective/events/show.html.haml
262
263
  - app/views/effective/events_mailer/event_registrant_purchased.liquid
264
+ - app/views/simple_calendar/_month_calendar.html.haml
263
265
  - config/effective_events.rb
266
+ - config/locales/en.yml
264
267
  - config/routes.rb
265
268
  - db/migrate/01_create_effective_events.rb.erb
266
269
  - db/seeds.rb
@@ -289,7 +292,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
289
292
  - !ruby/object:Gem::Version
290
293
  version: '0'
291
294
  requirements: []
292
- rubygems_version: 3.1.2
295
+ rubygems_version: 3.4.10
293
296
  signing_key:
294
297
  specification_version: 4
295
298
  summary: Event registrations, tickets and products