comfortable_media_surfer 3.0.0 → 3.1.2
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/.gitattributes +1 -0
- data/.github/dependabot.yml +7 -0
- data/.github/workflows/coveralls.yml +13 -1
- data/.github/workflows/rubyonrails.yml +15 -3
- data/.gitignore +4 -0
- data/.rubocop.yml +4 -1
- data/CHANGELOG.md +86 -0
- data/CONTRIBUTING.md +5 -2
- data/Gemfile +10 -6
- data/README.md +64 -27
- data/app/assets/builds/.keep +0 -0
- data/app/assets/config/manifest.js +1 -0
- data/app/assets/javascripts/comfy/admin/cms/application.js +21 -36
- data/app/assets/javascripts/comfy/admin/cms/base.js +6 -5
- data/app/assets/javascripts/comfy/admin/cms/codemirror.js +22 -10
- data/app/assets/javascripts/comfy/admin/cms/diff.js +7 -5
- data/app/assets/javascripts/comfy/admin/cms/file_link.js +17 -11
- data/app/assets/javascripts/comfy/admin/cms/file_upload.js +67 -41
- data/app/assets/javascripts/comfy/admin/cms/files_modal.js +20 -13
- data/app/assets/javascripts/comfy/admin/cms/sortable_list.js +28 -19
- data/app/assets/javascripts/comfy/admin/cms/timepicker.js +20 -12
- data/app/assets/javascripts/comfy/admin/cms/wysiwyg.js +39 -20
- data/app/assets/javascripts/comfy/vendor/diff/pretty_text_diff.js +30 -18
- data/app/assets/javascripts/comfy/vendor/redactor/definedlinks.js +31 -34
- data/app/assets/javascripts/comfy/vendor/redactor/filemanager.js +77 -62
- data/app/assets/javascripts/comfy/vendor/redactor/i18n/hr.js +78 -76
- data/app/assets/javascripts/comfy/vendor/redactor/i18n/nb.js +76 -74
- data/app/assets/javascripts/comfy/vendor/redactor/i18n/pl.js +77 -75
- data/app/assets/javascripts/comfy/vendor/redactor/imagemanager.js +66 -55
- data/app/assets/javascripts/comfy/vendor/redactor/table.js +346 -335
- data/app/assets/javascripts/comfy/vendor/redactor/video.js +69 -64
- data/app/assets/javascripts/comfy/vendor/redactor.js +2 -0
- data/app/assets/stylesheets/comfy/admin/cms/application.sass +2 -2
- data/app/assets/stylesheets/comfy/admin/cms/codemirror_overrides.sass +1 -1
- data/app/helpers/comfy/admin/cms_helper.rb +2 -2
- data/app/views/comfy/admin/cms/pages/toggle_branch.js.erb +14 -8
- data/comfortable_media_surfer.gemspec +8 -9
- data/config/application.rb +4 -1
- data/config/environments/development.rb +11 -10
- data/config/environments/production.rb +0 -6
- data/config/puma.rb +43 -0
- data/db/migrate/01_create_cms.rb +0 -1
- data/db/migrate/02_add_markdown_to_snippets.rb +5 -0
- data/gemfiles/7.1.gemfile +3 -2
- data/gemfiles/7.2.gemfile +3 -2
- data/gemfiles/{6.1.gemfile → 8.0.gemfile} +3 -2
- data/lib/comfortable_media_surfer/content/tags/audio.rb +1 -1
- data/lib/comfortable_media_surfer/content/tags/breadcrumbs.rb +1 -1
- data/lib/comfortable_media_surfer/content/tags/children.rb +1 -1
- data/lib/comfortable_media_surfer/content/tags/siblings.rb +1 -1
- data/lib/comfortable_media_surfer/engine.rb +3 -8
- data/lib/comfortable_media_surfer/extensions/has_revisions.rb +1 -1
- data/lib/comfortable_media_surfer/render_methods.rb +7 -7
- data/lib/comfortable_media_surfer/version.rb +1 -1
- data/lib/generators/comfy/cms/README +2 -9
- data/lib/generators/comfy/cms/cms_generator.rb +9 -7
- data/lib/generators/comfy/scaffold/scaffold_generator.rb +1 -1
- data/lib/tasks/cms_assets.rake +19 -0
- data/package-lock.json +379 -0
- data/package.json +23 -0
- data/rakelib/create_release.rake +17 -17
- metadata +24 -146
- data/app/assets/javascripts/comfy/vendor/Moxie.swf +0 -0
- data/app/assets/javascripts/comfy/vendor/Moxie.xap +0 -0
- data/app/assets/javascripts/comfy/vendor/bootstrap.bundle.min.js +0 -7
- data/app/assets/javascripts/comfy/vendor/bootstrap.bundle.min.js.map +0 -1
- data/app/assets/javascripts/comfy/vendor/codemirror/addon/edit/closetag.js +0 -169
- data/app/assets/javascripts/comfy/vendor/codemirror/mode/css/css.js +0 -832
- data/app/assets/javascripts/comfy/vendor/codemirror/mode/htmlmixed/htmlmixed.js +0 -152
- data/app/assets/javascripts/comfy/vendor/codemirror/mode/javascript/javascript.js +0 -875
- data/app/assets/javascripts/comfy/vendor/codemirror/mode/markdown/markdown.js +0 -861
- data/app/assets/javascripts/comfy/vendor/codemirror/mode/xml/xml.js +0 -394
- data/app/assets/javascripts/comfy/vendor/codemirror.js +0 -9653
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ar.js +0 -52
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/bg.js +0 -65
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/bn.js +0 -65
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ca.js +0 -83
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/cs.js +0 -70
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/cy.js +0 -92
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/da.js +0 -71
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/de.js +0 -70
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/default.js +0 -80
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/eo.js +0 -73
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/es.js +0 -69
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/et.js +0 -73
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/fa.js +0 -68
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/fi.js +0 -69
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/fr.js +0 -75
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/gr.js +0 -74
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/he.js +0 -57
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/hi.js +0 -65
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/hr.js +0 -66
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/hu.js +0 -72
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/id.js +0 -61
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/it.js +0 -70
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ja.js +0 -57
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ko.js +0 -60
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/lt.js +0 -72
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/lv.js +0 -67
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/mk.js +0 -69
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/mn.js +0 -67
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ms.js +0 -68
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/my.js +0 -69
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/nl.js +0 -75
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/no.js +0 -73
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/pa.js +0 -65
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/pl.js +0 -68
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/pt-BR.js +0 -66
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/pt.js +0 -66
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ro.js +0 -69
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ru.js +0 -66
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/si.js +0 -65
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sk.js +0 -70
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sl.js +0 -70
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sq.js +0 -65
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sr.js +0 -69
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sv.js +0 -70
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/th.js +0 -72
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/tr.js +0 -66
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/uk.js +0 -66
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/vn.js +0 -66
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/zh-CN.js +0 -61
- data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/zh-TW.js +0 -61
- data/app/assets/javascripts/comfy/vendor/moxie.min.js +0 -16
- data/app/assets/javascripts/comfy/vendor/plupload.dev.js +0 -2497
- data/app/assets/javascripts/comfy/vendor/sortable.min.js +0 -5
- data/app/assets/stylesheets/comfy/vendor/codemirror.css +0 -346
- data/app/assets/stylesheets/comfy/vendor/flatpickr.min.css +0 -13
- data/config/initializers/assets.rb +0 -14
- data/gemfiles/7.0.gemfile +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a85a3f0b343392faa4c1a694a01ed10f22a2bbc4a0226457ccc4477560ca3d4
|
4
|
+
data.tar.gz: 637c668f4813532a4c184b7513b72497c636ff3d507d0f165b586b580cf3f536
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f48fbc4b720a10e251a088d125a0e3e45e4539a7f2e5d697209f8ba21afa7f206a875e53702ed87f2819391886e344c32fc2cb3b170dd32a53e68c6a6b275cb
|
7
|
+
data.tar.gz: 78dbda62d0289007c4cf021866585057b4448a1452f06dd1b97d718b0ce597dc98b5a31fcf54962e13662bf0da012aa2106b0a5ebad0d1406e525b9ff7e8bd1c
|
data/.gitattributes
CHANGED
@@ -26,14 +26,26 @@ jobs:
|
|
26
26
|
- name: Checkout source
|
27
27
|
uses: actions/checkout@v2
|
28
28
|
|
29
|
+
- name: Install Node.js
|
30
|
+
uses: actions/setup-node@v4
|
31
|
+
with:
|
32
|
+
cache: npm
|
33
|
+
- run: npm ci
|
34
|
+
|
29
35
|
- name: Install Ruby ${{ matrix.ruby-version }}
|
30
36
|
uses: ruby/setup-ruby@v1
|
31
37
|
with:
|
32
38
|
ruby-version: ${{ matrix.ruby-version }}
|
39
|
+
bundler-cache: true
|
40
|
+
|
41
|
+
- name: Update surfer gem
|
42
|
+
run: bundle update comfortable_media_surfer
|
43
|
+
|
44
|
+
- name: Compile assets
|
45
|
+
run: bin/bundle exec rails comfy:compile_assets
|
33
46
|
|
34
47
|
- name: Run tests, report coverage
|
35
48
|
run: |
|
36
|
-
bin/bundle install --retry 3 --quiet
|
37
49
|
bin/bundle exec rails db:drop
|
38
50
|
bin/bundle exec rails db:create
|
39
51
|
bin/bundle exec rails db:migrate
|
@@ -10,13 +10,13 @@ jobs:
|
|
10
10
|
strategy:
|
11
11
|
matrix:
|
12
12
|
ruby-version:
|
13
|
-
- "3.1"
|
14
13
|
- "3.2"
|
15
14
|
- "3.3"
|
15
|
+
- "3.4"
|
16
16
|
rails-version:
|
17
|
-
- "6.1"
|
18
17
|
- "7.1"
|
19
18
|
- "7.2"
|
19
|
+
- "8.0"
|
20
20
|
continue-on-error: [true]
|
21
21
|
name: ${{ format('Tests (Ruby {0}, Rails {1})', matrix.ruby-version, matrix.rails-version) }}
|
22
22
|
runs-on: ubuntu-latest
|
@@ -29,14 +29,26 @@ jobs:
|
|
29
29
|
- name: Checkout source
|
30
30
|
uses: actions/checkout@v2
|
31
31
|
|
32
|
+
- name: Install Node.js
|
33
|
+
uses: actions/setup-node@v4
|
34
|
+
with:
|
35
|
+
cache: npm
|
36
|
+
- run: npm ci
|
37
|
+
|
32
38
|
- name: Install Ruby ${{ matrix.ruby-version }}
|
33
39
|
uses: ruby/setup-ruby@v1
|
34
40
|
with:
|
35
41
|
ruby-version: ${{ matrix.ruby-version }}
|
42
|
+
bundler-cache: true
|
43
|
+
|
44
|
+
- name: Update surfer gem
|
45
|
+
run: bundle update comfortable_media_surfer
|
46
|
+
|
47
|
+
- name: Compile assets
|
48
|
+
run: bin/bundle exec rails comfy:compile_assets
|
36
49
|
|
37
50
|
- name: Run tests
|
38
51
|
run: |
|
39
|
-
bin/bundle install --retry 3 --quiet
|
40
52
|
bin/bundle exec rails db:drop
|
41
53
|
bin/bundle exec rails db:create
|
42
54
|
bin/bundle exec rails db:migrate
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -3,7 +3,7 @@ require:
|
|
3
3
|
# - rubocop-minitest
|
4
4
|
|
5
5
|
AllCops:
|
6
|
-
TargetRubyVersion: 3.
|
6
|
+
TargetRubyVersion: 3.2
|
7
7
|
NewCops: enable
|
8
8
|
Exclude:
|
9
9
|
- bin/*
|
@@ -59,6 +59,9 @@ Style/Documentation:
|
|
59
59
|
Style/DocumentDynamicEvalDefinition:
|
60
60
|
Enabled: false
|
61
61
|
|
62
|
+
Style/HashSyntax:
|
63
|
+
Enabled: false
|
64
|
+
|
62
65
|
Style/IfUnlessModifier:
|
63
66
|
Enabled: false
|
64
67
|
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project's source code will be documented in this file. Items under `Unreleased` are upcoming features that will be out in the next version.
|
4
|
+
|
5
|
+
## Contributors
|
6
|
+
|
7
|
+
Please follow the recommendations outlined at [keepachangelog.com](https://keepachangelog.com). Please use the existing headings and styling as a guide, and add a link for the version diff at the bottom of the file. Also, please update the `Unreleased` link to compare it to the latest release version.
|
8
|
+
|
9
|
+
For all changes prior to the inception of this project, see the [Release History](https://github.com/comfy/comfortable-mexican-sofa/releases) of ComfortableMexicanSofa.
|
10
|
+
|
11
|
+
## Versions
|
12
|
+
|
13
|
+
## [Unreleased]
|
14
|
+
|
15
|
+
### Fixed
|
16
|
+
|
17
|
+
- Fixed Expand/Collapse error in Admin/Pages.
|
18
|
+
- Include sassc-rails to gemspec, since it is deprecated after rails 7.0.8
|
19
|
+
- Update documentation to reflect recent changes
|
20
|
+
|
21
|
+
### Added
|
22
|
+
|
23
|
+
- added migration for Markdown snippets
|
24
|
+
|
25
|
+
## [v3.1.1] - 2025-02-08
|
26
|
+
|
27
|
+
### Fixed
|
28
|
+
|
29
|
+
- Fixed scss: use scss imports, not css ones that cannot be resolved by the browser
|
30
|
+
|
31
|
+
### Added
|
32
|
+
|
33
|
+
- Added rake task to compile assets, corresponding post install message
|
34
|
+
- Added import Rails from UJS
|
35
|
+
- Added missing jQuery import
|
36
|
+
|
37
|
+
### Removed
|
38
|
+
|
39
|
+
- Removed yarn, as not needed
|
40
|
+
|
41
|
+
## [v3.1.0] - 2024-12-31 (gem yanked, pending resolution of [Issue 8](https://github.com/shakacode/comfortable-media-surfer/issues/8)
|
42
|
+
|
43
|
+
### Added
|
44
|
+
|
45
|
+
- Added compatibility and support for Rails 8
|
46
|
+
- Added compatibility and support for propshaft (sprockets is still supported) - installing the gem now requires NodeJS to be installed. In addition, the `comfy:compile_assets` task needs to be run after installing the gem.
|
47
|
+
|
48
|
+
### Removed
|
49
|
+
|
50
|
+
- Removed sassc sprockets
|
51
|
+
- Rails 6.x compatibility dropped, since it is not being maintained as of October 2024
|
52
|
+
|
53
|
+
### Changed
|
54
|
+
|
55
|
+
- Updated README links to point to the Surfer wiki
|
56
|
+
|
57
|
+
## [v3.0.0] - 2024-11-30
|
58
|
+
|
59
|
+
First release of `comfortable_media_surfer`. This new gem is a revival of [ComfortableMexicanSofa](https://github.com/comfy/comfortable-mexican-sofa) which had been dormant for nearly 5 years.
|
60
|
+
|
61
|
+
### Fixed
|
62
|
+
|
63
|
+
- Fixed all broken tests to now pass on Rails 6.x and 7.x
|
64
|
+
- Code syntax per Rubocop linting
|
65
|
+
|
66
|
+
### Added
|
67
|
+
|
68
|
+
- Rails 7 compatibility, including many config and code changes. See the [PR](https://github.com/shakacode/comfortable-media-surfer/pull/1/files) for full details
|
69
|
+
- Added github actions workflows for CI build and test coverage
|
70
|
+
- Added CMS tags for navigation: children, siblings, breadcrumbs, with tests
|
71
|
+
- Added CMS tag for embedded audio, with tests
|
72
|
+
- Added CMS tag for image, with tests
|
73
|
+
- Added ability to write CMS snippets in Markdown, with tests
|
74
|
+
|
75
|
+
### Removed
|
76
|
+
|
77
|
+
- Rails 5 compatibility dropped, as it is EOL
|
78
|
+
|
79
|
+
### Changed
|
80
|
+
|
81
|
+
- Rebranded **ComfortableMexicanSofa** as **ComfortableMediaSurfer** in order to publish new gem (database table names and schema have not changed).
|
82
|
+
|
83
|
+
[Unreleased]: https://github.com/shakacode/comfortable-media-surfer/compare/v3.1.0...master
|
84
|
+
[v3.1.1]: https://github.com/shakacode/comfortable-media-surfer/compare/v3.1.0...v3.1.1
|
85
|
+
[v3.1.0]: https://github.com/shakacode/comfortable-media-surfer/compare/v3.0.0...v3.1.0
|
86
|
+
[v3.0.0]: https://github.com/shakacode/comfortable-media-surfer/compare/v2.0.19...v3.0.0
|
data/CONTRIBUTING.md
CHANGED
@@ -11,15 +11,18 @@ Fork the project. Optionally, create a branch you want to work on.
|
|
11
11
|
- Install gem dependencies with `bundle install`
|
12
12
|
- There's nothing to configure, by default database is SQLite so it will be
|
13
13
|
created for you. Just run `bundle exec rake db:migrate`
|
14
|
+
- Prepare the environment by running `rails comfy:compile_assets`, and
|
15
|
+
`rake db:test:prepare`
|
14
16
|
- Make sure that existing tests are passing by running `bundle exec rake test`
|
15
17
|
- There are system tests that can be run with `bundle exec rake test:system`.
|
16
18
|
You need to have `chromedriver` installed for that.
|
17
19
|
- You should be able to start the app via `bin/rails s` and navigate to http://localhost:3000/admin
|
20
|
+
and log in with username 'user' and password 'pass'
|
18
21
|
|
19
22
|
### 3. Hack away
|
20
23
|
|
21
24
|
- Create a few small pull requests instead of a humoungous one. I can merge small stuff faster.
|
22
|
-
- When adding new code just make sure it follows the same
|
25
|
+
- When adding new code just make sure it follows the same style as the existing code.
|
23
26
|
- Avoid adding 3rd party dependencies if you can.
|
24
27
|
- Tests please, but nothing complicated. UnitTest / Fixtures all the way. Make sure all tests pass.
|
25
28
|
- Run `bundle exec rubocop` and fix any issues raised.
|
@@ -27,7 +30,7 @@ Fork the project. Optionally, create a branch you want to work on.
|
|
27
30
|
### 4. Make a pull request
|
28
31
|
|
29
32
|
- If you never done it before read this: https://help.github.com/articles/using-pull-requests
|
30
|
-
- When PR is submitted check if
|
33
|
+
- When PR is submitted check if Github actions CI ran all tests successfully
|
31
34
|
|
32
35
|
### 5. Done!
|
33
36
|
|
data/Gemfile
CHANGED
@@ -5,13 +5,15 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
|
5
5
|
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
gem 'rails', '~>
|
8
|
+
gem 'rails', '~> 8.0'
|
9
9
|
|
10
10
|
group :development, :test do
|
11
|
-
gem 'autoprefixer-rails', '~> 10.4.
|
12
|
-
gem 'byebug', '~>
|
11
|
+
gem 'autoprefixer-rails', '~> 10.4.21.0'
|
12
|
+
gem 'byebug', '~> 12.0.0', platforms: %i[mri mingw x64_mingw]
|
13
|
+
gem 'gem-release'
|
13
14
|
gem 'image_processing', '>= 1.12.0'
|
14
|
-
gem '
|
15
|
+
gem 'propshaft', '~> 1.1.0'
|
16
|
+
gem 'sqlite3', '>= 2.1'
|
15
17
|
# gem 'mysql2', '~> 0.5'
|
16
18
|
# gem 'pg', '~> 1.5.4'
|
17
19
|
end
|
@@ -22,7 +24,7 @@ group :development do
|
|
22
24
|
end
|
23
25
|
|
24
26
|
group :test do
|
25
|
-
gem 'brakeman', '~>
|
27
|
+
gem 'brakeman', '~> 7.0.2'
|
26
28
|
gem 'bundler-audit', '~> 0.9.1'
|
27
29
|
gem 'coveralls_reborn', '~> 0.28.0', require: false
|
28
30
|
gem 'cuprite', '>= 0.15'
|
@@ -30,8 +32,10 @@ group :test do
|
|
30
32
|
gem 'minitest', '>= 5.23.0'
|
31
33
|
gem 'minitest-reporters', '>= 1.6.1'
|
32
34
|
gem 'mocha', '>= 2.3.0', require: false
|
35
|
+
gem 'ostruct'
|
36
|
+
gem 'puma'
|
33
37
|
gem 'rails-controller-testing', '~> 1.0.5'
|
34
|
-
gem 'rubocop', '~> 1.
|
38
|
+
gem 'rubocop', '~> 1.75.7', require: false
|
35
39
|
gem 'rubocop-minitest'
|
36
40
|
gem 'rubocop-rails'
|
37
41
|
gem 'simplecov', '~> 0.22.0', require: false
|
data/README.md
CHANGED
@@ -1,42 +1,50 @@
|
|
1
|
+
[](https://github.com/shakacode/comfortable-media-surfer/actions/workflows/rubyonrails.yml)
|
2
|
+
[](https://coveralls.io/github/shakacode/comfortable-media-surfer?branch=HEAD)
|
3
|
+
[](http://rubygems.org/gems/comfortable_media_surfer)
|
4
|
+
[](http://rubygems.org/gems/comfortable_media_surfer)
|
5
|
+
[](https://github.com/shakacode/comfortable-media-surfer/releases)
|
6
|
+
|
1
7
|
# ComfortableMediaSurfer
|
2
8
|
|
3
|
-
ComfortableMediaSurfer is a powerful Ruby
|
9
|
+
ComfortableMediaSurfer is a powerful Ruby 7.0+ CMS (Content Management System) Engine, picking up where [ComfortableMexicanSofa](https://github.com/comfy/comfortable-mexican-sofa) left off.
|
4
10
|
|
5
11
|
## Features
|
6
12
|
|
7
|
-
|
13
|
+
- Simple drop-in integration with Rails 7.0+ apps with minimal configuration
|
8
14
|
* The CMS keeps clear from the rest of your application
|
9
|
-
* Powerful page templating capability using [Content Tags](https://github.com/
|
10
|
-
* [Multiple Sites](https://github.com/
|
15
|
+
* Powerful page templating capability using [Content Tags](https://github.com/shakacode/comfortable-media-surfer/wiki/Docs:-Content-Tags)
|
16
|
+
* [Multiple Sites](https://github.com/shakacode/comfortable-media-surfer/wiki/Docs:-Sites) from a single installation
|
11
17
|
* Multi-Language Support (i18n) (ca, cs, da, de, en, es, fi, fr, gr, hr, it, ja, nb, nl, pl, pt-BR, ru, sv, tr, uk, zh-CN, zh-TW) and page localization.
|
12
|
-
* [CMS Seeds](https://github.com/
|
13
|
-
* [Revision History](https://github.com/
|
14
|
-
* [Extendable Admin Area](https://github.com/
|
18
|
+
* [CMS Seeds](https://github.com/shakacode/comfortable-media-surfer/wiki/Docs:-CMS-Seeds) for initial content population
|
19
|
+
* [Revision History](https://github.com/shakacode/comfortable-media-surfer/wiki/Docs:-Revisions) to revert changes
|
20
|
+
* [Extendable Admin Area](https://github.com/shakacode/comfortable-media-surfer/wiki/HowTo:-Reusing-Admin-Area) built with [Bootstrap 4](http://getbootstrap.com) (responsive design). Using [CodeMirror](http://codemirror.net) for HTML and Markdown highlighing and [Redactor](http://imperavi.com/redactor) as the WYSIWYG editor.
|
15
21
|
|
16
22
|
## Dependencies
|
17
23
|
|
18
|
-
|
19
|
-
|
20
|
-
|
24
|
+
- File attachments are handled by [ActiveStorage](https://github.com/rails/rails/tree/master/activestorage). Make sure that you can run appropriate migrations by running: `rails active_storage:install`
|
25
|
+
- Image resizing is done with with [ImageMagick](http://www.imagemagick.org/script/download.php), so make sure it's installed.
|
26
|
+
- Pagination is handled by [kaminari](https://github.com/amatsuda/kaminari).
|
21
27
|
|
22
28
|
## Compatibility
|
23
29
|
|
24
|
-
|
25
|
-
- On Ruby 3.x, Rails 7.x + is recommended, since performance is noticably better than on 6.x
|
30
|
+
On Ruby 3.x, Rails 7.x +
|
26
31
|
|
27
32
|
## Installation
|
28
33
|
|
29
34
|
Add gem definition to your Gemfile:
|
30
35
|
|
31
36
|
```ruby
|
32
|
-
gem "comfortable_media_surfer", "~> 3.
|
37
|
+
gem "comfortable_media_surfer", "~> 3.1.0"
|
33
38
|
```
|
34
39
|
|
35
40
|
Then from the Rails project's root run:
|
36
41
|
|
42
|
+
```
|
37
43
|
bundle install
|
38
44
|
rails generate comfy:cms
|
39
|
-
|
45
|
+
rails db:migrate
|
46
|
+
rails comfy:compile_assets
|
47
|
+
```
|
40
48
|
|
41
49
|
Now take a look inside your `config/routes.rb` file. You'll see where routes attach for the admin area and content serving. Make sure that content serving route appears as a very last item or it will make all other routes to be inaccessible.
|
42
50
|
|
@@ -45,11 +53,46 @@ comfy_route :cms_admin, path: "/admin"
|
|
45
53
|
comfy_route :cms, path: "/"
|
46
54
|
```
|
47
55
|
|
56
|
+
## Converting from ComfortableMexicanSofa or Occams
|
57
|
+
|
58
|
+
### From Sofa to Surfer
|
59
|
+
|
60
|
+
The database structure is the same. Your Sofa project will also need to be upgraded to >= Rails 7.x
|
61
|
+
Then you should simply be able to update your Gemfile thus, and run bundle
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
gem 'comfortable_media_surfer', '~> 3.1.0'
|
65
|
+
```
|
66
|
+
|
67
|
+
### From Occams to Surfer
|
68
|
+
|
69
|
+
Again the project must be >= Rails 7.x. Since the schema is different, executing this SQL should get you set for Surfer
|
70
|
+
|
71
|
+
```sql
|
72
|
+
ALTER TABLE occams_cms_categories RENAME TO comfy_cms_categories;
|
73
|
+
ALTER TABLE occams_cms_categorizations RENAME TO comfy_cms_categorizations;
|
74
|
+
ALTER TABLE occams_cms_files RENAME TO comfy_cms_files;
|
75
|
+
ALTER TABLE occams_cms_fragments RENAME TO comfy_cms_fragments;
|
76
|
+
ALTER TABLE occams_cms_layouts RENAME TO comfy_cms_layouts;
|
77
|
+
ALTER TABLE occams_cms_pages RENAME TO comfy_cms_pages;
|
78
|
+
ALTER TABLE occams_cms_revisions RENAME TO comfy_cms_revisions;
|
79
|
+
ALTER TABLE occams_cms_sites RENAME TO comfy_cms_sites;
|
80
|
+
ALTER TABLE occams_cms_snippets RENAME TO comfy_cms_snippets;
|
81
|
+
ALTER TABLE occams_cms_translations RENAME TO comfy_cms_translations;
|
82
|
+
UPDATE comfy_cms_fragments SET record_type = 'Comfy::Cms::Page' WHERE record_type = 'Occams::Cms::Page';
|
83
|
+
UPDATE comfy_cms_fragments SET record_type = 'Comfy::Cms::Layout' WHERE record_type = 'Occams::Cms::Layout';
|
84
|
+
UPDATE comfy_cms_fragments SET record_type = 'Comfy::Cms::Snippet' WHERE record_type = 'Occams::Cms::Snippet';
|
85
|
+
UPDATE comfy_cms_revisions SET record_type = 'Comfy::Cms::Page' WHERE record_type = 'Occams::Cms::Page';
|
86
|
+
UPDATE comfy_cms_revisions SET record_type = 'Comfy::Cms::Layout' WHERE record_type = 'Occams::Cms::Layout';
|
87
|
+
UPDATE comfy_cms_revisions SET record_type = 'Comfy::Cms::Snippet' WHERE record_type = 'Occams::Cms::Snippet';
|
88
|
+
UPDATE active_storage_attachments SET record_type = 'Comfy::Cms::File' WHERE record_type = 'Occams::Cms::File';
|
89
|
+
```
|
90
|
+
|
48
91
|
## Quick Start Guide
|
49
92
|
|
50
93
|
After finishing installation you should be able to navigate to http://localhost:3000/admin
|
51
94
|
|
52
|
-
Default username and password is 'user' and 'pass'. You probably want to change it right away. Admin credentials (among other things) can be found and changed in the cms initializer: [/config/initializers/
|
95
|
+
Default username and password is 'user' and 'pass'. You probably want to change it right away. Admin credentials (among other things) can be found and changed in the cms initializer: [/config/initializers/comfortable_media_surfer.rb](https://github.com/shakacode/comfortable-media-surfer/blob/master/config/initializers/comfortable_media_surfer.rb)
|
53
96
|
|
54
97
|
Before creating pages and populating them with content we need to create a Site. Site defines a hostname, content path and its language.
|
55
98
|
|
@@ -68,11 +111,8 @@ Once you have a layout, you may start creating pages and populating content. It'
|
|
68
111
|
|
69
112
|
## Documentation
|
70
113
|
|
71
|
-
For more information on how to use this CMS please refer to the [Wiki](https://github.com/
|
72
|
-
on [Content Tags](https://github.com/
|
73
|
-
|
74
|
-
[Comfy Demo App](https://github.com/comfy/comfy-demo) also can be used as an
|
75
|
-
example of a default Rails app with CMS installed.
|
114
|
+
For more information on how to use this CMS please refer to the [Wiki](https://github.com/shakacode/comfortable-media-surfer/wiki). Section that might be of interest is the entry
|
115
|
+
on [Content Tags](https://github.com/shakacode/comfortable-media-surfer/wiki/Docs:-Content-Tags).
|
76
116
|
|
77
117
|
## Add-ons
|
78
118
|
|
@@ -81,16 +121,13 @@ If you want to add a Blog functionality to your app take a look at
|
|
81
121
|
|
82
122
|

|
83
123
|
|
84
|
-
#### Old Versions
|
124
|
+
#### Old Versions of ComfortableMexicanSofa
|
85
125
|
|
86
|
-
[CHANGELOG](//github.com/comfy/comfortable-mexican-sofa/releases) is documented
|
87
|
-
in Github releases.
|
126
|
+
[CHANGELOG](//github.com/comfy/comfortable-mexican-sofa/releases) is documented in ComfortableMexicanSofa Github releases.
|
88
127
|
|
89
128
|
#### Contributing
|
90
129
|
|
91
|
-
ComfortableMediaSurfer
|
92
|
-
development environment. It's as easy to work on as any other Rails app out there.
|
93
|
-
For more detail take a look at [CONTRIBUTING](CONTRIBUTING.md)
|
130
|
+
ComfortableMediaSurfer can run like any Rails application in development. It's as easy to work on as any other Rails app. For more detail see [CONTRIBUTING](CONTRIBUTING.md)
|
94
131
|
|
95
132
|
#### Testing
|
96
133
|
|
@@ -105,5 +142,5 @@ For more detail take a look at [CONTRIBUTING](CONTRIBUTING.md)
|
|
105
142
|
|
106
143
|
---
|
107
144
|
|
108
|
-
Copyright 2010-2019 Oleg Khabarov, 2024 ShakaCode LLC
|
145
|
+
Copyright 2010-2019 Oleg Khabarov, 2024-2025 ShakaCode LLC
|
109
146
|
Released under the [MIT license](LICENSE)
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
//= link_tree ../builds
|
@@ -1,39 +1,24 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import ujs from "@rails/ujs";
|
2
|
+
ujs.start();
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
//= require comfy/vendor/codemirror/mode/htmlmixed/htmlmixed
|
7
|
-
//= require comfy/vendor/codemirror/mode/javascript/javascript
|
8
|
-
//= require comfy/vendor/codemirror/mode/markdown/markdown
|
9
|
-
//= require comfy/vendor/codemirror/mode/xml/xml
|
10
|
-
//= require comfy/vendor/codemirror/addon/edit/closetag
|
11
|
-
//= require comfy/vendor/sortable.min
|
12
|
-
//= require comfy/vendor/bootstrap.bundle.min
|
13
|
-
//= require comfy/vendor/diff/diff_match_patch.min
|
14
|
-
//= require comfy/vendor/diff/pretty_text_diff
|
15
|
-
//= require comfy/vendor/fontawesome
|
16
|
-
//= require comfy/vendor/redactor
|
17
|
-
//= require comfy/vendor/redactor/filemanager
|
18
|
-
//= require comfy/vendor/redactor/imagemanager
|
19
|
-
//= require comfy/vendor/redactor/definedlinks
|
20
|
-
//= require comfy/vendor/redactor/table
|
21
|
-
//= require comfy/vendor/redactor/video
|
22
|
-
//= require_directory ../../vendor/redactor/i18n/
|
23
|
-
//= require comfy/vendor/flatpickr.min
|
24
|
-
//= require_directory ../../vendor/flatpickr/i18n/
|
4
|
+
import "bootstrap/js/src/tab";
|
5
|
+
import "bootstrap/js/src/collapse";
|
25
6
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
//= require comfy/admin/cms/diff
|
30
|
-
//= require comfy/admin/cms/file_link
|
31
|
-
//= require comfy/admin/cms/file_upload
|
32
|
-
//= require comfy/admin/cms/files_modal
|
33
|
-
//= require comfy/admin/cms/page_fragments
|
34
|
-
//= require comfy/admin/cms/sortable_list
|
35
|
-
//= require comfy/admin/cms/slugify
|
36
|
-
//= require comfy/admin/cms/timepicker
|
37
|
-
//= require comfy/admin/cms/wysiwyg
|
7
|
+
import "../../vendor/diff/diff_match_patch.min";
|
8
|
+
import "../../vendor/diff/pretty_text_diff";
|
9
|
+
import "../../vendor/fontawesome";
|
38
10
|
|
39
|
-
|
11
|
+
import "./base";
|
12
|
+
import "./categories";
|
13
|
+
import "./codemirror";
|
14
|
+
import "./diff";
|
15
|
+
import "./file_link";
|
16
|
+
import "./file_upload";
|
17
|
+
import "./files_modal";
|
18
|
+
import "./page_fragments";
|
19
|
+
import "./sortable_list";
|
20
|
+
import "./slugify";
|
21
|
+
import "./timepicker";
|
22
|
+
import "./wysiwyg";
|
23
|
+
|
24
|
+
import "./custom";
|
@@ -4,16 +4,16 @@
|
|
4
4
|
|
5
5
|
// TODO(glebm): Use the battle-tested universal onPageLoad code and enable Turbolinks+async in the demo app.
|
6
6
|
// See: https://gist.github.com/glebm/2496daf445877055447a6fac46509d9a
|
7
|
-
const isTurbolinks =
|
7
|
+
const isTurbolinks = "Turbolinks" in window && window.Turbolinks.supported;
|
8
8
|
if (isTurbolinks) {
|
9
|
-
document.addEventListener(
|
9
|
+
document.addEventListener("turbolinks:load", () => {
|
10
10
|
window.CMS.init();
|
11
11
|
});
|
12
|
-
document.addEventListener(
|
12
|
+
document.addEventListener("turbolinks:before-cache", () => {
|
13
13
|
window.CMS.dispose();
|
14
14
|
});
|
15
15
|
} else {
|
16
|
-
document.addEventListener(
|
16
|
+
document.addEventListener("DOMContentLoaded", () => {
|
17
17
|
window.CMS.init();
|
18
18
|
});
|
19
19
|
}
|
@@ -42,5 +42,6 @@
|
|
42
42
|
CMS.timepicker.dispose();
|
43
43
|
};
|
44
44
|
|
45
|
-
CMS.getLocale = () =>
|
45
|
+
CMS.getLocale = () =>
|
46
|
+
document.querySelector('meta[name="cms-locale"]').content;
|
46
47
|
})();
|
@@ -1,31 +1,43 @@
|
|
1
|
+
import jQuery from "jquery";
|
2
|
+
import CodeMirror from "codemirror";
|
3
|
+
import "codemirror/mode/markdown/markdown";
|
4
|
+
import "codemirror/mode/htmlmixed/htmlmixed";
|
5
|
+
|
1
6
|
(() => {
|
2
7
|
const codeMirrorInstances = [];
|
3
8
|
window.CMS.codemirror = {
|
4
9
|
init(root = document) {
|
5
|
-
for (const textarea of root.querySelectorAll(
|
10
|
+
for (const textarea of root.querySelectorAll(
|
11
|
+
"textarea[data-cms-cm-mode]"
|
12
|
+
)) {
|
6
13
|
const codemirror = CodeMirror.fromTextArea(textarea, {
|
7
14
|
mode: textarea.dataset.cmsCmMode,
|
8
15
|
tabSize: 2,
|
9
16
|
lineWrapping: true,
|
10
17
|
autoCloseTags: true,
|
11
18
|
lineNumbers: true,
|
12
|
-
viewportMargin: Infinity
|
19
|
+
viewportMargin: Infinity,
|
13
20
|
});
|
14
21
|
codeMirrorInstances.push(codemirror);
|
15
22
|
}
|
16
23
|
|
17
|
-
const tabsRoot =
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
24
|
+
const tabsRoot =
|
25
|
+
root.id === "form-fragments"
|
26
|
+
? root
|
27
|
+
: root.querySelector("#form-fragments");
|
28
|
+
jQuery(tabsRoot)
|
29
|
+
.find('a[data-toggle="tab"]')
|
30
|
+
.on("shown.bs.tab", () => {
|
31
|
+
for (const codemirror of codeMirrorInstances) {
|
32
|
+
codemirror.refresh();
|
33
|
+
}
|
34
|
+
});
|
23
35
|
},
|
24
36
|
dispose() {
|
25
37
|
for (const codemirror of codeMirrorInstances) {
|
26
38
|
codemirror.toTextArea();
|
27
39
|
}
|
28
40
|
codeMirrorInstances.length = 0;
|
29
|
-
}
|
30
|
-
}
|
41
|
+
},
|
42
|
+
};
|
31
43
|
})();
|
@@ -1,10 +1,12 @@
|
|
1
|
+
import jQuery from "jquery";
|
2
|
+
|
1
3
|
(() => {
|
2
4
|
window.CMS.diff = () => {
|
3
|
-
jQuery(
|
5
|
+
jQuery(".revision").prettyTextDiff({
|
4
6
|
cleanup: true,
|
5
|
-
originalContainer:
|
6
|
-
changedContainer:
|
7
|
-
diffContainer:
|
7
|
+
originalContainer: ".original",
|
8
|
+
changedContainer: ".current",
|
9
|
+
diffContainer: ".diff .content",
|
8
10
|
});
|
9
|
-
}
|
11
|
+
};
|
10
12
|
})();
|