simple_calendar 2.4.3 → 3.0.0
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 +4 -4
- data/.github/workflows/ci.yml +5 -4
- data/.gitignore +4 -0
- data/Appraisals +5 -5
- data/CHANGELOG.md +7 -0
- data/Gemfile +4 -1
- data/Gemfile.lock +157 -136
- data/README.md +22 -15
- data/Rakefile +29 -5
- data/app/assets/stylesheets/simple_calendar.scss +4 -0
- data/app/views/simple_calendar/_calendar.html.erb +7 -7
- data/app/views/simple_calendar/_month_calendar.html.erb +8 -8
- data/app/views/simple_calendar/_week_calendar.html.erb +14 -12
- data/bin/rails +16 -0
- data/gemfiles/rails_6_1.gemfile +3 -1
- data/gemfiles/rails_6_1.gemfile.lock +159 -131
- data/gemfiles/{rails_6.gemfile → rails_7_0.gemfile} +4 -2
- data/gemfiles/rails_7_0.gemfile.lock +222 -0
- data/gemfiles/{rails_master.gemfile → rails_main.gemfile} +3 -1
- data/gemfiles/rails_main.gemfile.lock +246 -0
- data/lib/simple_calendar/calendar.rb +26 -14
- data/lib/simple_calendar/month_calendar.rb +4 -0
- data/lib/simple_calendar/version.rb +1 -1
- data/lib/simple_calendar/view_helpers.rb +3 -3
- data/lib/simple_calendar/week_calendar.rb +5 -1
- data/lib/simple_calendar.rb +8 -1
- data/simple_calendar.gemspec +1 -3
- data/test/calendars/calendar_test.rb +154 -0
- data/test/calendars/month_calendar_test.rb +16 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/config/manifest.js +1 -0
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/stylesheets/application.css +1 -0
- data/test/dummy/app/channels/application_cable/channel.rb +4 -0
- data/test/dummy/app/channels/application_cable/connection.rb +4 -0
- data/test/dummy/app/controllers/application_controller.rb +2 -0
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/controllers/meetings_controller.rb +59 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/helpers/meetings_helper.rb +2 -0
- data/test/dummy/app/jobs/application_job.rb +7 -0
- data/test/dummy/app/mailers/application_mailer.rb +4 -0
- data/test/dummy/app/models/application_record.rb +7 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/models/meeting.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +15 -0
- data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/test/dummy/app/views/meetings/_form.html.erb +32 -0
- data/test/dummy/app/views/meetings/_meeting.html.erb +17 -0
- data/test/dummy/app/views/meetings/edit.html.erb +10 -0
- data/test/dummy/app/views/meetings/index.html.erb +24 -0
- data/test/dummy/app/views/meetings/new.html.erb +9 -0
- data/test/dummy/app/views/meetings/show.html.erb +10 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +33 -0
- data/test/dummy/config/application.rb +22 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/cable.yml +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +67 -0
- data/test/dummy/config/environments/production.rb +87 -0
- data/test/dummy/config/environments/test.rb +60 -0
- data/test/dummy/config/initializers/content_security_policy.rb +25 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +8 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/permissions_policy.rb +11 -0
- data/test/dummy/config/locales/en.yml +33 -0
- data/test/dummy/config/puma.rb +43 -0
- data/test/dummy/config/routes.rb +7 -0
- data/test/dummy/config/storage.yml +34 -0
- data/test/dummy/config.ru +6 -0
- data/test/dummy/db/migrate/20220930184313_create_meetings.rb +11 -0
- data/test/dummy/db/schema.rb +21 -0
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/test/dummy/public/apple-touch-icon.png +0 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/storage/.keep +0 -0
- data/test/dummy/tmp/.keep +0 -0
- data/test/dummy/tmp/development_secret.txt +1 -0
- data/test/dummy/tmp/pids/.keep +0 -0
- data/test/dummy/tmp/pids/server.pid +1 -0
- data/test/dummy/tmp/restart.txt +0 -0
- data/test/dummy/tmp/storage/.keep +0 -0
- data/test/fixtures/meetings.yml +36 -0
- data/test/integrations/month_calendar_test.rb +58 -0
- data/test/simple_calendar_test.rb +7 -0
- data/test/test_helper.rb +14 -0
- metadata +80 -39
- data/gemfiles/rails_6.gemfile.lock +0 -195
- data/gemfiles/rails_master.gemfile.lock +0 -207
- data/spec/calendar_spec.rb +0 -176
- data/spec/calendars/month_calendar_spec.rb +0 -25
- data/spec/simple_calendar_spec.rb +0 -9
- data/spec/spec_helper.rb +0 -96
- data/spec/support/fake_event.rb +0 -9
- data/spec/support/view_context.rb +0 -20
- data/spec/views_generators_spec.rb +0 -7
- /data/lib/simple_calendar/{railtie.rb → engine.rb} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e11781a625cdf2a8812e5b7972feecb016b82abe0c1ad57b6687e90851f04f86
|
|
4
|
+
data.tar.gz: 19f2e34143a16827b1b2a6255988ef53004477f91077e4e69bcfef31837aec31
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 140c319c81da2305230604b0101f6302e14d9952c2895ffab35a7d3c43cf7d4ab5eb4ad2111f0d2bb7246488446d9f09de71bb9b6e0bfe6ddeea11efba8b7bd0
|
|
7
|
+
data.tar.gz: 8c2f960eaea8445f1a4f45b62d7ba5fd7864010a91c6ee37f4299443aa95bc4df70c760cea79bdaff35a166d65a0cbaa2b0b0caf1be289668705b337a1dd8c30
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -12,17 +12,17 @@ jobs:
|
|
|
12
12
|
runs-on: ubuntu-latest
|
|
13
13
|
strategy:
|
|
14
14
|
matrix:
|
|
15
|
-
ruby: [
|
|
15
|
+
ruby: ['2.7', '3.0', '3.1', '3.2']
|
|
16
16
|
gemfile:
|
|
17
|
-
- rails_6
|
|
18
17
|
- rails_6_1
|
|
19
|
-
-
|
|
18
|
+
- rails_7_0
|
|
19
|
+
- rails_main
|
|
20
20
|
env:
|
|
21
21
|
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
|
|
22
22
|
BUNDLE_PATH_RELATIVE_TO_CWD: true
|
|
23
23
|
|
|
24
24
|
steps:
|
|
25
|
-
- uses: actions/checkout@
|
|
25
|
+
- uses: actions/checkout@v3
|
|
26
26
|
|
|
27
27
|
- name: Set up Ruby
|
|
28
28
|
uses: ruby/setup-ruby@v1
|
|
@@ -30,6 +30,7 @@ jobs:
|
|
|
30
30
|
ruby-version: ${{ matrix.ruby }}
|
|
31
31
|
bundler: default
|
|
32
32
|
bundler-cache: true
|
|
33
|
+
rubygems: latest
|
|
33
34
|
|
|
34
35
|
- name: StandardRb check
|
|
35
36
|
run: bundle exec standardrb
|
data/.gitignore
CHANGED
data/Appraisals
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
appraise "rails-6" do
|
|
2
|
-
gem "rails", "~> 6.0.0"
|
|
3
|
-
end
|
|
4
|
-
|
|
5
1
|
appraise "rails-6-1" do
|
|
6
2
|
gem "rails", "~> 6.1.0"
|
|
7
3
|
end
|
|
8
4
|
|
|
9
|
-
appraise "rails-
|
|
5
|
+
appraise "rails-7-0" do
|
|
6
|
+
gem "rails", "~> 7.0.0"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
appraise "rails-main" do
|
|
10
10
|
gem "rails", github: "rails/rails"
|
|
11
11
|
end
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
### 3.0.0
|
|
2
|
+
|
|
3
|
+
* Drop support for Rails 6.0 and earlier
|
|
4
|
+
* Add Today link to calendars to reset to current date
|
|
5
|
+
* Add `locals: {}` option when rendering calendars to add extra local variables
|
|
6
|
+
* Refactor to use `render_in`
|
|
7
|
+
|
|
1
8
|
### 2.4.3
|
|
2
9
|
|
|
3
10
|
* Fix deprecation warnings - @mbobin
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,197 +1,218 @@
|
|
|
1
|
+
GIT
|
|
2
|
+
remote: https://github.com/thoughtbot/appraisal.git
|
|
3
|
+
revision: b200e636903700098bef25f4f51dbc4c46e4c04c
|
|
4
|
+
specs:
|
|
5
|
+
appraisal (2.4.1)
|
|
6
|
+
bundler
|
|
7
|
+
rake
|
|
8
|
+
thor (>= 0.14.0)
|
|
9
|
+
|
|
1
10
|
PATH
|
|
2
11
|
remote: .
|
|
3
12
|
specs:
|
|
4
|
-
simple_calendar (
|
|
5
|
-
rails (>=
|
|
13
|
+
simple_calendar (3.0.0)
|
|
14
|
+
rails (>= 6.1)
|
|
6
15
|
|
|
7
16
|
GEM
|
|
8
17
|
remote: http://rubygems.org/
|
|
9
18
|
specs:
|
|
10
|
-
actioncable (
|
|
11
|
-
actionpack (=
|
|
12
|
-
activesupport (=
|
|
19
|
+
actioncable (7.0.6)
|
|
20
|
+
actionpack (= 7.0.6)
|
|
21
|
+
activesupport (= 7.0.6)
|
|
13
22
|
nio4r (~> 2.0)
|
|
14
23
|
websocket-driver (>= 0.6.1)
|
|
15
|
-
actionmailbox (
|
|
16
|
-
actionpack (=
|
|
17
|
-
activejob (=
|
|
18
|
-
activerecord (=
|
|
19
|
-
activestorage (=
|
|
20
|
-
activesupport (=
|
|
24
|
+
actionmailbox (7.0.6)
|
|
25
|
+
actionpack (= 7.0.6)
|
|
26
|
+
activejob (= 7.0.6)
|
|
27
|
+
activerecord (= 7.0.6)
|
|
28
|
+
activestorage (= 7.0.6)
|
|
29
|
+
activesupport (= 7.0.6)
|
|
21
30
|
mail (>= 2.7.1)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
net-imap
|
|
32
|
+
net-pop
|
|
33
|
+
net-smtp
|
|
34
|
+
actionmailer (7.0.6)
|
|
35
|
+
actionpack (= 7.0.6)
|
|
36
|
+
actionview (= 7.0.6)
|
|
37
|
+
activejob (= 7.0.6)
|
|
38
|
+
activesupport (= 7.0.6)
|
|
27
39
|
mail (~> 2.5, >= 2.5.4)
|
|
40
|
+
net-imap
|
|
41
|
+
net-pop
|
|
42
|
+
net-smtp
|
|
28
43
|
rails-dom-testing (~> 2.0)
|
|
29
|
-
actionpack (
|
|
30
|
-
actionview (=
|
|
31
|
-
activesupport (=
|
|
32
|
-
rack (~> 2.0, >= 2.
|
|
44
|
+
actionpack (7.0.6)
|
|
45
|
+
actionview (= 7.0.6)
|
|
46
|
+
activesupport (= 7.0.6)
|
|
47
|
+
rack (~> 2.0, >= 2.2.4)
|
|
33
48
|
rack-test (>= 0.6.3)
|
|
34
49
|
rails-dom-testing (~> 2.0)
|
|
35
50
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
|
36
|
-
actiontext (
|
|
37
|
-
actionpack (=
|
|
38
|
-
activerecord (=
|
|
39
|
-
activestorage (=
|
|
40
|
-
activesupport (=
|
|
51
|
+
actiontext (7.0.6)
|
|
52
|
+
actionpack (= 7.0.6)
|
|
53
|
+
activerecord (= 7.0.6)
|
|
54
|
+
activestorage (= 7.0.6)
|
|
55
|
+
activesupport (= 7.0.6)
|
|
56
|
+
globalid (>= 0.6.0)
|
|
41
57
|
nokogiri (>= 1.8.5)
|
|
42
|
-
actionview (
|
|
43
|
-
activesupport (=
|
|
58
|
+
actionview (7.0.6)
|
|
59
|
+
activesupport (= 7.0.6)
|
|
44
60
|
builder (~> 3.1)
|
|
45
61
|
erubi (~> 1.4)
|
|
46
62
|
rails-dom-testing (~> 2.0)
|
|
47
63
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
|
48
|
-
activejob (
|
|
49
|
-
activesupport (=
|
|
64
|
+
activejob (7.0.6)
|
|
65
|
+
activesupport (= 7.0.6)
|
|
50
66
|
globalid (>= 0.3.6)
|
|
51
|
-
activemodel (
|
|
52
|
-
activesupport (=
|
|
53
|
-
activerecord (
|
|
54
|
-
activemodel (=
|
|
55
|
-
activesupport (=
|
|
56
|
-
activestorage (
|
|
57
|
-
actionpack (=
|
|
58
|
-
activejob (=
|
|
59
|
-
activerecord (=
|
|
60
|
-
activesupport (=
|
|
61
|
-
marcel (~> 1.0
|
|
67
|
+
activemodel (7.0.6)
|
|
68
|
+
activesupport (= 7.0.6)
|
|
69
|
+
activerecord (7.0.6)
|
|
70
|
+
activemodel (= 7.0.6)
|
|
71
|
+
activesupport (= 7.0.6)
|
|
72
|
+
activestorage (7.0.6)
|
|
73
|
+
actionpack (= 7.0.6)
|
|
74
|
+
activejob (= 7.0.6)
|
|
75
|
+
activerecord (= 7.0.6)
|
|
76
|
+
activesupport (= 7.0.6)
|
|
77
|
+
marcel (~> 1.0)
|
|
62
78
|
mini_mime (>= 1.1.0)
|
|
63
|
-
activesupport (
|
|
79
|
+
activesupport (7.0.6)
|
|
64
80
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
65
81
|
i18n (>= 1.6, < 2)
|
|
66
82
|
minitest (>= 5.1)
|
|
67
83
|
tzinfo (~> 2.0)
|
|
68
|
-
zeitwerk (~> 2.3)
|
|
69
|
-
appraisal (2.4.0)
|
|
70
|
-
bundler
|
|
71
|
-
rake
|
|
72
|
-
thor (>= 0.14.0)
|
|
73
84
|
ast (2.4.2)
|
|
74
85
|
builder (3.2.4)
|
|
75
|
-
concurrent-ruby (1.
|
|
86
|
+
concurrent-ruby (1.2.2)
|
|
76
87
|
crass (1.0.6)
|
|
77
|
-
|
|
78
|
-
erubi (1.
|
|
79
|
-
globalid (
|
|
80
|
-
activesupport (>=
|
|
81
|
-
i18n (1.
|
|
88
|
+
date (3.3.3)
|
|
89
|
+
erubi (1.12.0)
|
|
90
|
+
globalid (1.1.0)
|
|
91
|
+
activesupport (>= 5.0)
|
|
92
|
+
i18n (1.14.1)
|
|
82
93
|
concurrent-ruby (~> 1.0)
|
|
83
|
-
|
|
94
|
+
json (2.6.3)
|
|
95
|
+
language_server-protocol (3.17.0.3)
|
|
96
|
+
lint_roller (1.1.0)
|
|
97
|
+
loofah (2.21.3)
|
|
84
98
|
crass (~> 1.0.2)
|
|
85
|
-
nokogiri (>= 1.
|
|
86
|
-
mail (2.
|
|
99
|
+
nokogiri (>= 1.12.0)
|
|
100
|
+
mail (2.8.1)
|
|
87
101
|
mini_mime (>= 0.1.1)
|
|
88
|
-
|
|
102
|
+
net-imap
|
|
103
|
+
net-pop
|
|
104
|
+
net-smtp
|
|
105
|
+
marcel (1.0.2)
|
|
89
106
|
method_source (1.0.0)
|
|
90
|
-
mini_mime (1.1.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
107
|
+
mini_mime (1.1.2)
|
|
108
|
+
minitest (5.18.1)
|
|
109
|
+
net-imap (0.3.6)
|
|
110
|
+
date
|
|
111
|
+
net-protocol
|
|
112
|
+
net-pop (0.1.2)
|
|
113
|
+
net-protocol
|
|
114
|
+
net-protocol (0.2.1)
|
|
115
|
+
timeout
|
|
116
|
+
net-smtp (0.3.3)
|
|
117
|
+
net-protocol
|
|
118
|
+
nio4r (2.5.9)
|
|
119
|
+
nokogiri (1.15.3-x86_64-darwin)
|
|
98
120
|
racc (~> 1.4)
|
|
99
|
-
nokogiri (1.
|
|
121
|
+
nokogiri (1.15.3-x86_64-linux)
|
|
100
122
|
racc (~> 1.4)
|
|
101
|
-
parallel (1.
|
|
102
|
-
parser (3.
|
|
123
|
+
parallel (1.23.0)
|
|
124
|
+
parser (3.2.2.3)
|
|
103
125
|
ast (~> 2.4.1)
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
126
|
+
racc
|
|
127
|
+
puma (6.3.0)
|
|
128
|
+
nio4r (~> 2.0)
|
|
129
|
+
racc (1.7.1)
|
|
130
|
+
rack (2.2.7)
|
|
131
|
+
rack-test (2.1.0)
|
|
132
|
+
rack (>= 1.3)
|
|
133
|
+
rails (7.0.6)
|
|
134
|
+
actioncable (= 7.0.6)
|
|
135
|
+
actionmailbox (= 7.0.6)
|
|
136
|
+
actionmailer (= 7.0.6)
|
|
137
|
+
actionpack (= 7.0.6)
|
|
138
|
+
actiontext (= 7.0.6)
|
|
139
|
+
actionview (= 7.0.6)
|
|
140
|
+
activejob (= 7.0.6)
|
|
141
|
+
activemodel (= 7.0.6)
|
|
142
|
+
activerecord (= 7.0.6)
|
|
143
|
+
activestorage (= 7.0.6)
|
|
144
|
+
activesupport (= 7.0.6)
|
|
120
145
|
bundler (>= 1.15.0)
|
|
121
|
-
railties (=
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
146
|
+
railties (= 7.0.6)
|
|
147
|
+
rails-dom-testing (2.1.1)
|
|
148
|
+
activesupport (>= 5.0.0)
|
|
149
|
+
minitest
|
|
125
150
|
nokogiri (>= 1.6)
|
|
126
|
-
rails-html-sanitizer (1.
|
|
127
|
-
loofah (~> 2.
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
151
|
+
rails-html-sanitizer (1.6.0)
|
|
152
|
+
loofah (~> 2.21)
|
|
153
|
+
nokogiri (~> 1.14)
|
|
154
|
+
railties (7.0.6)
|
|
155
|
+
actionpack (= 7.0.6)
|
|
156
|
+
activesupport (= 7.0.6)
|
|
131
157
|
method_source
|
|
132
|
-
rake (>=
|
|
158
|
+
rake (>= 12.2)
|
|
133
159
|
thor (~> 1.0)
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
160
|
+
zeitwerk (~> 2.5)
|
|
161
|
+
rainbow (3.1.1)
|
|
162
|
+
rake (13.0.6)
|
|
163
|
+
regexp_parser (2.8.1)
|
|
137
164
|
rexml (3.2.5)
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
rspec-expectations (~> 3.10.0)
|
|
141
|
-
rspec-mocks (~> 3.10.0)
|
|
142
|
-
rspec-core (3.10.1)
|
|
143
|
-
rspec-support (~> 3.10.0)
|
|
144
|
-
rspec-expectations (3.10.1)
|
|
145
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
146
|
-
rspec-support (~> 3.10.0)
|
|
147
|
-
rspec-mocks (3.10.2)
|
|
148
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
149
|
-
rspec-support (~> 3.10.0)
|
|
150
|
-
rspec-support (3.10.2)
|
|
151
|
-
rubocop (1.14.0)
|
|
165
|
+
rubocop (1.52.1)
|
|
166
|
+
json (~> 2.3)
|
|
152
167
|
parallel (~> 1.10)
|
|
153
|
-
parser (>= 3.
|
|
168
|
+
parser (>= 3.2.2.3)
|
|
154
169
|
rainbow (>= 2.2.2, < 4.0)
|
|
155
170
|
regexp_parser (>= 1.8, < 3.0)
|
|
156
|
-
rexml
|
|
157
|
-
rubocop-ast (>= 1.
|
|
171
|
+
rexml (>= 3.2.5, < 4.0)
|
|
172
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
|
158
173
|
ruby-progressbar (~> 1.7)
|
|
159
|
-
unicode-display_width (>=
|
|
160
|
-
rubocop-ast (1.
|
|
161
|
-
parser (>= 3.
|
|
162
|
-
rubocop-performance (1.
|
|
174
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
|
175
|
+
rubocop-ast (1.29.0)
|
|
176
|
+
parser (>= 3.2.1.0)
|
|
177
|
+
rubocop-performance (1.18.0)
|
|
163
178
|
rubocop (>= 1.7.0, < 2.0)
|
|
164
179
|
rubocop-ast (>= 0.4.0)
|
|
165
|
-
ruby-progressbar (1.
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
180
|
+
ruby-progressbar (1.13.0)
|
|
181
|
+
sqlite3 (1.6.3-x86_64-darwin)
|
|
182
|
+
sqlite3 (1.6.3-x86_64-linux)
|
|
183
|
+
standard (1.30.1)
|
|
184
|
+
language_server-protocol (~> 3.17.0.2)
|
|
185
|
+
lint_roller (~> 1.0)
|
|
186
|
+
rubocop (~> 1.52.0)
|
|
187
|
+
standard-custom (~> 1.0.0)
|
|
188
|
+
standard-performance (~> 1.1.0)
|
|
189
|
+
standard-custom (1.0.2)
|
|
190
|
+
lint_roller (~> 1.0)
|
|
191
|
+
rubocop (~> 1.50)
|
|
192
|
+
standard-performance (1.1.1)
|
|
193
|
+
lint_roller (~> 1.1)
|
|
194
|
+
rubocop-performance (~> 1.18.0)
|
|
195
|
+
thor (1.2.2)
|
|
196
|
+
timeout (0.4.0)
|
|
197
|
+
tzinfo (2.0.6)
|
|
178
198
|
concurrent-ruby (~> 1.0)
|
|
179
|
-
unicode-display_width (2.
|
|
199
|
+
unicode-display_width (2.4.2)
|
|
180
200
|
websocket-driver (0.7.5)
|
|
181
201
|
websocket-extensions (>= 0.1.0)
|
|
182
202
|
websocket-extensions (0.1.5)
|
|
183
|
-
zeitwerk (2.
|
|
203
|
+
zeitwerk (2.6.8)
|
|
184
204
|
|
|
185
205
|
PLATFORMS
|
|
186
|
-
ruby
|
|
187
206
|
x86_64-darwin-20
|
|
207
|
+
x86_64-darwin-22
|
|
188
208
|
x86_64-linux
|
|
189
209
|
|
|
190
210
|
DEPENDENCIES
|
|
191
|
-
appraisal
|
|
192
|
-
|
|
211
|
+
appraisal!
|
|
212
|
+
puma
|
|
193
213
|
simple_calendar!
|
|
214
|
+
sqlite3
|
|
194
215
|
standard
|
|
195
216
|
|
|
196
217
|
BUNDLED WITH
|
|
197
|
-
2.
|
|
218
|
+
2.4.16
|
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://github.com/excid3/simple_calendar/actions) [](https://badge.fury.io/rb/simple_calendar)
|
|
6
6
|
|
|
7
|
-
Simple Calendar is designed to do one thing really really well: render a calendar.
|
|
7
|
+
Simple Calendar is designed to do one thing really really well: render a calendar.
|
|
8
8
|
|
|
9
9
|
It lets you render a calendar of any size. Maybe you want a
|
|
10
10
|
day view, a 4 day agenda, a week view, a month view, or a 6 week
|
|
@@ -120,7 +120,7 @@ In a Rails 6 app, the configuration could look like the following:
|
|
|
120
120
|
|
|
121
121
|
* Add `gem 'rails-i18n'` to your `Gemfile` and run `bundle`.
|
|
122
122
|
* Define the available and default locale e.g. in `config/application.rb`:
|
|
123
|
-
```ruby
|
|
123
|
+
```ruby
|
|
124
124
|
# config/application.rb
|
|
125
125
|
config.i18n.available_locales = [:en, :de, :fr]
|
|
126
126
|
config.i18n.default_locale = :en
|
|
@@ -134,7 +134,7 @@ de:
|
|
|
134
134
|
next: ">>"
|
|
135
135
|
week: Woche
|
|
136
136
|
```
|
|
137
|
-
|
|
137
|
+
|
|
138
138
|
See the [Rails I18n Guide](https://guides.rubyonrails.org/i18n.html) for further information.
|
|
139
139
|
|
|
140
140
|
## Rendering Events
|
|
@@ -341,12 +341,29 @@ the top! :)
|
|
|
341
341
|
### AJAX Calendars
|
|
342
342
|
|
|
343
343
|
Rendering calendars that update with AJAX is pretty simple. You'll need
|
|
344
|
-
to
|
|
345
|
-
|
|
344
|
+
to follow these steps.
|
|
345
|
+
|
|
346
|
+
- Run `rails g simple_calendar:views` to generate the views.
|
|
347
|
+
- Add an ID to the calendar view's outer div. `<div id="calendar" class="simple-calendar">`
|
|
348
|
+
- Add `remote: true` option to the next & preview links like [this](https://github.com/excid3/simple_calendar-ajax-example/blob/ac8a1dc933d5933608421f8b53a5f5cf756b942f/app/views/simple_calendar/_month_calendar.html.erb#L3).
|
|
349
|
+
- Create `js.erb` file to respond to JS requests, render the new calendar, and replace the calendar on the page by ID like [this](https://github.com/excid3/simple_calendar-ajax-example/blob/master/app/views/events/index.js.erb).
|
|
350
|
+
|
|
351
|
+
The response can simply replace
|
|
346
352
|
the HTML of the div with the newly rendered calendar.
|
|
347
353
|
|
|
348
354
|
Take a look at **[excid3/simple_calendar-ajax-example](https://github.com/excid3/simple_calendar-ajax-example)** to see how it is done.
|
|
349
355
|
|
|
356
|
+
If you are using [Hotwire](https://hotwired.dev/), just wrap in a Turbo Frame.
|
|
357
|
+
Like this:
|
|
358
|
+
|
|
359
|
+
```erb
|
|
360
|
+
<%= turbo_frame_tag 'calendar' do %>
|
|
361
|
+
<%= month_calendar do |date| %>
|
|
362
|
+
<%= date.day %>
|
|
363
|
+
<% end %>
|
|
364
|
+
<% end %>
|
|
365
|
+
```
|
|
366
|
+
|
|
350
367
|
|
|
351
368
|
## Custom Calendars
|
|
352
369
|
|
|
@@ -406,12 +423,6 @@ expect_any_instance_of(SimpleCalendar::Calendar).to receive(:link_to).at_least(:
|
|
|
406
423
|
|
|
407
424
|
With modifications as appropriate.
|
|
408
425
|
|
|
409
|
-
## TODO
|
|
410
|
-
|
|
411
|
-
- Rspec tests for Calendar
|
|
412
|
-
- Rspec tests for MonthCalendar
|
|
413
|
-
- Rspec tests for WeekCalendar
|
|
414
|
-
|
|
415
426
|
## Author
|
|
416
427
|
|
|
417
428
|
Chris Oliver <chris@gorails.com>
|
|
@@ -423,7 +434,3 @@ Chris Oliver <chris@gorails.com>
|
|
|
423
434
|
## License
|
|
424
435
|
|
|
425
436
|
Simple Calendar is licensed under the [MIT License](LICENSE.txt).
|
|
426
|
-
|
|
427
|
-
## Support
|
|
428
|
-
|
|
429
|
-
Need help
|
data/Rakefile
CHANGED
|
@@ -1,8 +1,32 @@
|
|
|
1
|
-
require "bundler/gem_tasks"
|
|
2
|
-
|
|
3
1
|
begin
|
|
4
|
-
require "
|
|
5
|
-
RSpec::Core::RakeTask.new(:spec)
|
|
6
|
-
task default: :spec
|
|
2
|
+
require "bundler/setup"
|
|
7
3
|
rescue LoadError
|
|
4
|
+
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
require "bundler/gem_tasks"
|
|
8
|
+
|
|
9
|
+
require "rdoc/task"
|
|
10
|
+
|
|
11
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
|
12
|
+
rdoc.rdoc_dir = "rdoc"
|
|
13
|
+
rdoc.title = "SimpleCalendar"
|
|
14
|
+
rdoc.options << "--line-numbers"
|
|
15
|
+
rdoc.rdoc_files.include("README.md")
|
|
16
|
+
rdoc.rdoc_files.include("lib/**/*.rb")
|
|
8
17
|
end
|
|
18
|
+
|
|
19
|
+
APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
|
|
20
|
+
load "rails/tasks/engine.rake"
|
|
21
|
+
|
|
22
|
+
load "rails/tasks/statistics.rake"
|
|
23
|
+
|
|
24
|
+
require "rake/testtask"
|
|
25
|
+
|
|
26
|
+
Rake::TestTask.new(:test) do |t|
|
|
27
|
+
t.libs << "test"
|
|
28
|
+
t.pattern = "test/**/*_test.rb"
|
|
29
|
+
t.verbose = false
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
task default: :test
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
<div class="simple-calendar">
|
|
2
2
|
<div class="calendar-heading">
|
|
3
|
-
<%= link_to t('simple_calendar.previous', default: 'Previous'), calendar.url_for_previous_view %>
|
|
4
3
|
<span class="calendar-title"><%= t('date.month_names')[start_date.month] %> <%= start_date.year %></span>
|
|
5
|
-
|
|
4
|
+
|
|
5
|
+
<nav>
|
|
6
|
+
<%= link_to t('simple_calendar.previous', default: 'Previous'), calendar.url_for_previous_view %>
|
|
7
|
+
<%= link_to t('simple_calendar.today', default: 'Today'), calendar.url_for_today_view %>
|
|
8
|
+
<%= link_to t('simple_calendar.next', default: 'Next'), calendar.url_for_next_view %>
|
|
9
|
+
</nav>
|
|
6
10
|
</div>
|
|
7
11
|
|
|
8
12
|
<table class="table table-striped">
|
|
@@ -19,11 +23,7 @@
|
|
|
19
23
|
<%= content_tag :tr, class: calendar.tr_classes_for(week) do %>
|
|
20
24
|
<% week.each do |day| %>
|
|
21
25
|
<%= content_tag :td, class: calendar.td_classes_for(day) do %>
|
|
22
|
-
<%
|
|
23
|
-
<% capture_haml(day, sorted_events.fetch(day, []), &passed_block) %>
|
|
24
|
-
<% else %>
|
|
25
|
-
<% passed_block.call day, sorted_events.fetch(day, []) %>
|
|
26
|
-
<% end %>
|
|
26
|
+
<% instance_exec(day, calendar.sorted_events_for(day), &passed_block) %>
|
|
27
27
|
<% end %>
|
|
28
28
|
<% end %>
|
|
29
29
|
<% end %>
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
<div class="simple-calendar">
|
|
2
2
|
<div class="calendar-heading">
|
|
3
|
-
<%=
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<time datetime="<%= start_date.strftime('%Y-%m') %>" class="calendar-title"><%= t('date.month_names')[start_date.month] %> <%= start_date.year %></time>
|
|
4
|
+
|
|
5
|
+
<nav>
|
|
6
|
+
<%= link_to t('simple_calendar.previous', default: 'Previous'), calendar.url_for_previous_view %>
|
|
7
|
+
<%= link_to t('simple_calendar.today', default: 'Today'), calendar.url_for_today_view %>
|
|
8
|
+
<%= link_to t('simple_calendar.next', default: 'Next'), calendar.url_for_next_view %>
|
|
9
|
+
</nav>
|
|
6
10
|
</div>
|
|
7
11
|
|
|
8
12
|
<table class="table table-striped">
|
|
@@ -19,11 +23,7 @@
|
|
|
19
23
|
<tr>
|
|
20
24
|
<% week.each do |day| %>
|
|
21
25
|
<%= content_tag :td, class: calendar.td_classes_for(day) do %>
|
|
22
|
-
<%
|
|
23
|
-
<% capture_haml(day, sorted_events.fetch(day, []), &passed_block) %>
|
|
24
|
-
<% else %>
|
|
25
|
-
<% passed_block.call day, sorted_events.fetch(day, []) %>
|
|
26
|
-
<% end %>
|
|
26
|
+
<% instance_exec(day, calendar.sorted_events_for(day), &passed_block) %>
|
|
27
27
|
<% end %>
|
|
28
28
|
<% end %>
|
|
29
29
|
</tr>
|