effective_events 0.6.2 → 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: '03792a86651968a66d776678245154a7e1315bd4927a5f6803cf822831b11b54'
4
- data.tar.gz: fff7d1415683e67b7982fd82bfdfa0f258e10451ea1645f00ce2b7a86fd86abd
3
+ metadata.gz: 5c5eec870decb050184747000f45203451f303d62d7ec429d9a0132122c67b49
4
+ data.tar.gz: 2cd76e06a859a34d214b556c686048be4a1cfa920d9b1a29ba3c1805786c1feb
5
5
  SHA512:
6
- metadata.gz: a760d7c086e811c0bd6f64f36e2bcddefd725c86c533f922448f8242f0c60edade3dbe7c3f96b07b034200d19f99efd3cd161b1de460eed9e24ba26965f569ba
7
- data.tar.gz: 7157dfd23817e90be3102d6ce494b027f392b94568557dccf85b99c0622150e33311db116d256f3a9996e7fff8fea4d2fb6d9c08bd5eb9438ee00b889de9b18e
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
@@ -214,5 +215,9 @@ module Effective
214
215
  duplicate.tap { |event| event.save! }
215
216
  end
216
217
 
218
+ def start_time
219
+ start_at
220
+ end
221
+
217
222
  end
218
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
+  
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: "◀"
5
+ next: "▶"
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.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.2
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-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