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.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +1 -0
  3. data/.github/dependabot.yml +7 -0
  4. data/.github/workflows/coveralls.yml +13 -1
  5. data/.github/workflows/rubyonrails.yml +15 -3
  6. data/.gitignore +4 -0
  7. data/.rubocop.yml +4 -1
  8. data/CHANGELOG.md +86 -0
  9. data/CONTRIBUTING.md +5 -2
  10. data/Gemfile +10 -6
  11. data/README.md +64 -27
  12. data/app/assets/builds/.keep +0 -0
  13. data/app/assets/config/manifest.js +1 -0
  14. data/app/assets/javascripts/comfy/admin/cms/application.js +21 -36
  15. data/app/assets/javascripts/comfy/admin/cms/base.js +6 -5
  16. data/app/assets/javascripts/comfy/admin/cms/codemirror.js +22 -10
  17. data/app/assets/javascripts/comfy/admin/cms/diff.js +7 -5
  18. data/app/assets/javascripts/comfy/admin/cms/file_link.js +17 -11
  19. data/app/assets/javascripts/comfy/admin/cms/file_upload.js +67 -41
  20. data/app/assets/javascripts/comfy/admin/cms/files_modal.js +20 -13
  21. data/app/assets/javascripts/comfy/admin/cms/sortable_list.js +28 -19
  22. data/app/assets/javascripts/comfy/admin/cms/timepicker.js +20 -12
  23. data/app/assets/javascripts/comfy/admin/cms/wysiwyg.js +39 -20
  24. data/app/assets/javascripts/comfy/vendor/diff/pretty_text_diff.js +30 -18
  25. data/app/assets/javascripts/comfy/vendor/redactor/definedlinks.js +31 -34
  26. data/app/assets/javascripts/comfy/vendor/redactor/filemanager.js +77 -62
  27. data/app/assets/javascripts/comfy/vendor/redactor/i18n/hr.js +78 -76
  28. data/app/assets/javascripts/comfy/vendor/redactor/i18n/nb.js +76 -74
  29. data/app/assets/javascripts/comfy/vendor/redactor/i18n/pl.js +77 -75
  30. data/app/assets/javascripts/comfy/vendor/redactor/imagemanager.js +66 -55
  31. data/app/assets/javascripts/comfy/vendor/redactor/table.js +346 -335
  32. data/app/assets/javascripts/comfy/vendor/redactor/video.js +69 -64
  33. data/app/assets/javascripts/comfy/vendor/redactor.js +2 -0
  34. data/app/assets/stylesheets/comfy/admin/cms/application.sass +2 -2
  35. data/app/assets/stylesheets/comfy/admin/cms/codemirror_overrides.sass +1 -1
  36. data/app/helpers/comfy/admin/cms_helper.rb +2 -2
  37. data/app/views/comfy/admin/cms/pages/toggle_branch.js.erb +14 -8
  38. data/comfortable_media_surfer.gemspec +8 -9
  39. data/config/application.rb +4 -1
  40. data/config/environments/development.rb +11 -10
  41. data/config/environments/production.rb +0 -6
  42. data/config/puma.rb +43 -0
  43. data/db/migrate/01_create_cms.rb +0 -1
  44. data/db/migrate/02_add_markdown_to_snippets.rb +5 -0
  45. data/gemfiles/7.1.gemfile +3 -2
  46. data/gemfiles/7.2.gemfile +3 -2
  47. data/gemfiles/{6.1.gemfile → 8.0.gemfile} +3 -2
  48. data/lib/comfortable_media_surfer/content/tags/audio.rb +1 -1
  49. data/lib/comfortable_media_surfer/content/tags/breadcrumbs.rb +1 -1
  50. data/lib/comfortable_media_surfer/content/tags/children.rb +1 -1
  51. data/lib/comfortable_media_surfer/content/tags/siblings.rb +1 -1
  52. data/lib/comfortable_media_surfer/engine.rb +3 -8
  53. data/lib/comfortable_media_surfer/extensions/has_revisions.rb +1 -1
  54. data/lib/comfortable_media_surfer/render_methods.rb +7 -7
  55. data/lib/comfortable_media_surfer/version.rb +1 -1
  56. data/lib/generators/comfy/cms/README +2 -9
  57. data/lib/generators/comfy/cms/cms_generator.rb +9 -7
  58. data/lib/generators/comfy/scaffold/scaffold_generator.rb +1 -1
  59. data/lib/tasks/cms_assets.rake +19 -0
  60. data/package-lock.json +379 -0
  61. data/package.json +23 -0
  62. data/rakelib/create_release.rake +17 -17
  63. metadata +24 -146
  64. data/app/assets/javascripts/comfy/vendor/Moxie.swf +0 -0
  65. data/app/assets/javascripts/comfy/vendor/Moxie.xap +0 -0
  66. data/app/assets/javascripts/comfy/vendor/bootstrap.bundle.min.js +0 -7
  67. data/app/assets/javascripts/comfy/vendor/bootstrap.bundle.min.js.map +0 -1
  68. data/app/assets/javascripts/comfy/vendor/codemirror/addon/edit/closetag.js +0 -169
  69. data/app/assets/javascripts/comfy/vendor/codemirror/mode/css/css.js +0 -832
  70. data/app/assets/javascripts/comfy/vendor/codemirror/mode/htmlmixed/htmlmixed.js +0 -152
  71. data/app/assets/javascripts/comfy/vendor/codemirror/mode/javascript/javascript.js +0 -875
  72. data/app/assets/javascripts/comfy/vendor/codemirror/mode/markdown/markdown.js +0 -861
  73. data/app/assets/javascripts/comfy/vendor/codemirror/mode/xml/xml.js +0 -394
  74. data/app/assets/javascripts/comfy/vendor/codemirror.js +0 -9653
  75. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ar.js +0 -52
  76. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/bg.js +0 -65
  77. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/bn.js +0 -65
  78. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ca.js +0 -83
  79. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/cs.js +0 -70
  80. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/cy.js +0 -92
  81. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/da.js +0 -71
  82. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/de.js +0 -70
  83. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/default.js +0 -80
  84. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/eo.js +0 -73
  85. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/es.js +0 -69
  86. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/et.js +0 -73
  87. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/fa.js +0 -68
  88. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/fi.js +0 -69
  89. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/fr.js +0 -75
  90. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/gr.js +0 -74
  91. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/he.js +0 -57
  92. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/hi.js +0 -65
  93. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/hr.js +0 -66
  94. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/hu.js +0 -72
  95. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/id.js +0 -61
  96. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/it.js +0 -70
  97. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ja.js +0 -57
  98. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ko.js +0 -60
  99. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/lt.js +0 -72
  100. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/lv.js +0 -67
  101. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/mk.js +0 -69
  102. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/mn.js +0 -67
  103. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ms.js +0 -68
  104. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/my.js +0 -69
  105. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/nl.js +0 -75
  106. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/no.js +0 -73
  107. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/pa.js +0 -65
  108. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/pl.js +0 -68
  109. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/pt-BR.js +0 -66
  110. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/pt.js +0 -66
  111. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ro.js +0 -69
  112. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ru.js +0 -66
  113. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/si.js +0 -65
  114. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sk.js +0 -70
  115. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sl.js +0 -70
  116. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sq.js +0 -65
  117. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sr.js +0 -69
  118. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sv.js +0 -70
  119. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/th.js +0 -72
  120. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/tr.js +0 -66
  121. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/uk.js +0 -66
  122. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/vn.js +0 -66
  123. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/zh-CN.js +0 -61
  124. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/zh-TW.js +0 -61
  125. data/app/assets/javascripts/comfy/vendor/moxie.min.js +0 -16
  126. data/app/assets/javascripts/comfy/vendor/plupload.dev.js +0 -2497
  127. data/app/assets/javascripts/comfy/vendor/sortable.min.js +0 -5
  128. data/app/assets/stylesheets/comfy/vendor/codemirror.css +0 -346
  129. data/app/assets/stylesheets/comfy/vendor/flatpickr.min.css +0 -13
  130. data/config/initializers/assets.rb +0 -14
  131. data/gemfiles/7.0.gemfile +0 -31
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ebf4f5ffb32f8c4e6aa359c897a5d35aead15a9c3839fc7e41af49db4f44676
4
- data.tar.gz: cec761f797bc01265e44d5f64f9426a59eb5940e722ab2f149b29e8d7dec818f
3
+ metadata.gz: 4a85a3f0b343392faa4c1a694a01ed10f22a2bbc4a0226457ccc4477560ca3d4
4
+ data.tar.gz: 637c668f4813532a4c184b7513b72497c636ff3d507d0f165b586b580cf3f536
5
5
  SHA512:
6
- metadata.gz: c301e8f8152f0eaeadda3f7560f0926370987fda15647218701751953d712891e97aeedda19d462cbf054c50d2a9e56a85c8381640a5200dd623cd6b1a744760
7
- data.tar.gz: 2aa71081385b605f87e1f9d4642f0ca4f3f92a9fd91e9b927562ec289adb3f3f71111d05f15ebb2e61f62491c61e1a2f7655bf9ca53787dd852678f091361e72
6
+ metadata.gz: 2f48fbc4b720a10e251a088d125a0e3e45e4539a7f2e5d697209f8ba21afa7f206a875e53702ed87f2819391886e344c32fc2cb3b170dd32a53e68c6a6b275cb
7
+ data.tar.gz: 78dbda62d0289007c4cf021866585057b4448a1452f06dd1b97d718b0ce597dc98b5a31fcf54962e13662bf0da012aa2106b0a5ebad0d1406e525b9ff7e8bd1c
data/.gitattributes CHANGED
@@ -1,2 +1,3 @@
1
1
  app/assets/javascripts/comfy/vendor/* linguist-vendored
2
2
  app/assets/stylesheets/comfy/vendor/* linguist-vendored
3
+ app/assets/builds/* linguist-generated
@@ -0,0 +1,7 @@
1
+ version: 2
2
+ updates:
3
+ # Enable version updates for npm
4
+ - package-ecosystem: "bundler"
5
+ directory: "/" # The root directory where your Gemfile is located
6
+ schedule:
7
+ interval: "monthly" # Options: "daily", "weekly", "monthly"
@@ -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
@@ -19,3 +19,7 @@ coverage/
19
19
  /storage
20
20
  db/cms_fixtures/test-site/
21
21
  .idea
22
+
23
+ /node_modules
24
+ /app/assets/builds/*
25
+ !/app/assets/builds/.keep
data/.rubocop.yml CHANGED
@@ -3,7 +3,7 @@ require:
3
3
  # - rubocop-minitest
4
4
 
5
5
  AllCops:
6
- TargetRubyVersion: 3.0
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 slyle as the existing code.
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 TravisCI ran all tests successfully and Rubocop didn't raise any issues
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', '~> 7.2'
8
+ gem 'rails', '~> 8.0'
9
9
 
10
10
  group :development, :test do
11
- gem 'autoprefixer-rails', '~> 10.4.16.0'
12
- gem 'byebug', '~> 11.1.0', platforms: %i[mri mingw x64_mingw]
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 'sqlite3', '~> 1.6.7'
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', '~> 6.1.2'
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.63.0', require: false
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
+ [![Rails CI](https://github.com/shakacode/comfortable-media-surfer/actions/workflows/rubyonrails.yml/badge.svg)](https://github.com/shakacode/comfortable-media-surfer/actions/workflows/rubyonrails.yml)
2
+ [![Coverage Status](https://coveralls.io/repos/github/shakacode/comfortable-media-surfer/badge.svg?branch=HEAD)](https://coveralls.io/github/shakacode/comfortable-media-surfer?branch=HEAD)
3
+ [![Gem Version](https://img.shields.io/gem/v/comfortable_media_surfer.svg?style=flat)](http://rubygems.org/gems/comfortable_media_surfer)
4
+ [![Gem Downloads](https://img.shields.io/gem/dt/comfortable_media_surfer.svg?style=flat)](http://rubygems.org/gems/comfortable_media_surfer)
5
+ [![GitHub Release Date - Published_At](https://img.shields.io/github/release-date/shakacode/comfortable-media-surfer?label=last%20release&color=seagreen)](https://github.com/shakacode/comfortable-media-surfer/releases)
6
+
1
7
  # ComfortableMediaSurfer
2
8
 
3
- ComfortableMediaSurfer is a powerful Ruby 6.1+ CMS (Content Management System) Engine, picking up where [ComfortableMexicanSofa](https://github.com/comfy/comfortable-mexican-sofa) left off.
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
- * Simple drop-in integration with Rails 6.1+ apps with minimal configuration
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/comfy/comfortable-mexican-sofa/wiki/Docs:-Content-Tags)
10
- * [Multiple Sites](https://github.com/comfy/comfortable-mexican-sofa/wiki/Docs:-Sites) from a single installation
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/comfy/comfortable-mexican-sofa/wiki/Docs:-CMS-Seeds) for initial content population
13
- * [Revision History](https://github.com/comfy/comfortable-mexican-sofa/wiki/Docs:-Revisions) to revert changes
14
- * [Extendable Admin Area](https://github.com/comfy/comfortable-mexican-sofa/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.
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
- * 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`
19
- * Image resizing is done with with [ImageMagick](http://www.imagemagick.org/script/download.php), so make sure it's installed.
20
- * Pagination is handled by [kaminari](https://github.com/amatsuda/kaminari) or [will_paginate](https://github.com/mislav/will_paginate). Please add one of those to your Gemfile.
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
- - Ruby >= 3.0 with Rails >= 6.1
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.0.0"
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
- rake db:migrate
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/comfortable\_media\_surfer.rb](https://github.com/shakacode/comfortable-media-surfer/blob/master/config/initializers/comfortable_media_surfer.rb)
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/comfy/comfortable-mexican-sofa/wiki). Section that might be of interest is the entry
72
- on [Content Tags](https://github.com/comfy/comfortable-mexican-sofa/wiki/Docs:-Content-Tags).
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
  ![Admin Area Preview](doc/preview.jpg)
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 repository can be ran like a regular Rails application in
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
- //= require rails-ujs
2
- //= require jquery3
1
+ import ujs from "@rails/ujs";
2
+ ujs.start();
3
3
 
4
- //= require comfy/vendor/codemirror
5
- //= require comfy/vendor/codemirror/mode/css/css
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
- //= require comfy/admin/cms/base
27
- //= require comfy/admin/cms/categories
28
- //= require comfy/admin/cms/codemirror
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
- //= require comfy/admin/cms/custom
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 = 'Turbolinks' in window && window.Turbolinks.supported;
7
+ const isTurbolinks = "Turbolinks" in window && window.Turbolinks.supported;
8
8
  if (isTurbolinks) {
9
- document.addEventListener('turbolinks:load', () => {
9
+ document.addEventListener("turbolinks:load", () => {
10
10
  window.CMS.init();
11
11
  });
12
- document.addEventListener('turbolinks:before-cache', () => {
12
+ document.addEventListener("turbolinks:before-cache", () => {
13
13
  window.CMS.dispose();
14
14
  });
15
15
  } else {
16
- document.addEventListener('DOMContentLoaded', () => {
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 = () => document.querySelector('meta[name="cms-locale"]').content;
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('textarea[data-cms-cm-mode]')) {
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 = root.id === 'form-fragments' ? root : root.querySelector('#form-fragments');
18
- jQuery(tabsRoot).find('a[data-toggle="tab"]').on('shown.bs.tab', () => {
19
- for (const codemirror of codeMirrorInstances) {
20
- codemirror.refresh();
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('.revision').prettyTextDiff({
5
+ jQuery(".revision").prettyTextDiff({
4
6
  cleanup: true,
5
- originalContainer: '.original',
6
- changedContainer: '.current',
7
- diffContainer: '.diff .content',
7
+ originalContainer: ".original",
8
+ changedContainer: ".current",
9
+ diffContainer: ".diff .content",
8
10
  });
9
- }
11
+ };
10
12
  })();