effective_events 0.6.2 → 0.6.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '03792a86651968a66d776678245154a7e1315bd4927a5f6803cf822831b11b54'
4
- data.tar.gz: fff7d1415683e67b7982fd82bfdfa0f258e10451ea1645f00ce2b7a86fd86abd
3
+ metadata.gz: 35aaa94c6a057b65a26c73faa1a5b37babb0f85d69a9737b4eb1d62789011847
4
+ data.tar.gz: c446a129b0aa52abd78c877cc84023259690e39466d45f887f322adc7b7ab237
5
5
  SHA512:
6
- metadata.gz: a760d7c086e811c0bd6f64f36e2bcddefd725c86c533f922448f8242f0c60edade3dbe7c3f96b07b034200d19f99efd3cd161b1de460eed9e24ba26965f569ba
7
- data.tar.gz: 7157dfd23817e90be3102d6ce494b027f392b94568557dccf85b99c0622150e33311db116d256f3a9996e7fff8fea4d2fb6d9c08bd5eb9438ee00b889de9b18e
6
+ metadata.gz: c238a2e8a33362cbd2ff6afcfac069674b4c0a28b6cf81cef07ce3b1d57ef1867de18a2026af24d00eef3c6957196c47b9211910143fafc08c37621ebc7359c0
7
+ data.tar.gz: 6a9677f0ecf59a10ac7ac562d8d9651180310395aceecd0e7f8268a72bbec5deda07857c441a80aae6bd05fc7173b7d68ecfb081cfe459f4f607a1a2a36f45f7
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';
@@ -2,6 +2,25 @@
2
2
 
3
3
  module Effective
4
4
  class Event < ActiveRecord::Base
5
+ if defined?(PgSearch)
6
+ include PgSearch::Model
7
+
8
+ multisearchable against: [
9
+ :title,
10
+ :slug,
11
+ ],
12
+ associated_against: {
13
+ rich_texts: [:body],
14
+ },
15
+ using: {
16
+ trigram: {},
17
+ tsearch: {
18
+ highlight: true,
19
+ }
20
+ }
21
+
22
+ end
23
+
5
24
  has_many :event_tickets, -> { EventTicket.sorted }, inverse_of: :event, dependent: :destroy
6
25
  accepts_nested_attributes_for :event_tickets, allow_destroy: true
7
26
 
@@ -32,6 +51,7 @@ module Effective
32
51
 
33
52
  acts_as_slugged
34
53
  log_changes if respond_to?(:log_changes)
54
+ acts_as_tagged if respond_to?(:acts_as_tagged)
35
55
  acts_as_role_restricted if respond_to?(:acts_as_role_restricted)
36
56
 
37
57
  self.table_name = EffectiveEvents.events_table_name.to_s
@@ -214,5 +234,9 @@ module Effective
214
234
  duplicate.tap { |event| event.save! }
215
235
  end
216
236
 
237
+ def start_time
238
+ start_at
239
+ end
240
+
217
241
  end
218
242
  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.2'.freeze
2
+ VERSION = '0.6.4'.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.2
4
+ version: 0.6.4
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-03-09 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