comfortable_media_surfer 3.0.0 → 3.1.1

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 (121) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +1 -0
  3. data/.github/workflows/coveralls.yml +13 -1
  4. data/.github/workflows/rubyonrails.yml +15 -3
  5. data/.gitignore +4 -0
  6. data/.rubocop.yml +4 -1
  7. data/CHANGELOG.md +59 -0
  8. data/CONTRIBUTING.md +4 -2
  9. data/Gemfile +6 -2
  10. data/README.md +60 -25
  11. data/app/assets/builds/.keep +0 -0
  12. data/app/assets/config/manifest.js +1 -0
  13. data/app/assets/javascripts/comfy/admin/cms/application.js +21 -36
  14. data/app/assets/javascripts/comfy/admin/cms/base.js +6 -5
  15. data/app/assets/javascripts/comfy/admin/cms/codemirror.js +22 -10
  16. data/app/assets/javascripts/comfy/admin/cms/diff.js +7 -5
  17. data/app/assets/javascripts/comfy/admin/cms/file_link.js +17 -11
  18. data/app/assets/javascripts/comfy/admin/cms/file_upload.js +67 -41
  19. data/app/assets/javascripts/comfy/admin/cms/files_modal.js +20 -13
  20. data/app/assets/javascripts/comfy/admin/cms/sortable_list.js +28 -19
  21. data/app/assets/javascripts/comfy/admin/cms/timepicker.js +20 -12
  22. data/app/assets/javascripts/comfy/admin/cms/wysiwyg.js +39 -20
  23. data/app/assets/javascripts/comfy/vendor/diff/pretty_text_diff.js +30 -18
  24. data/app/assets/javascripts/comfy/vendor/redactor/definedlinks.js +31 -34
  25. data/app/assets/javascripts/comfy/vendor/redactor/filemanager.js +77 -62
  26. data/app/assets/javascripts/comfy/vendor/redactor/i18n/hr.js +78 -76
  27. data/app/assets/javascripts/comfy/vendor/redactor/i18n/nb.js +76 -74
  28. data/app/assets/javascripts/comfy/vendor/redactor/i18n/pl.js +77 -75
  29. data/app/assets/javascripts/comfy/vendor/redactor/imagemanager.js +66 -55
  30. data/app/assets/javascripts/comfy/vendor/redactor/table.js +346 -335
  31. data/app/assets/javascripts/comfy/vendor/redactor/video.js +69 -64
  32. data/app/assets/javascripts/comfy/vendor/redactor.js +2 -0
  33. data/app/assets/stylesheets/comfy/admin/cms/application.sass +2 -2
  34. data/app/assets/stylesheets/comfy/admin/cms/codemirror_overrides.sass +1 -1
  35. data/app/helpers/comfy/admin/cms_helper.rb +2 -2
  36. data/comfortable_media_surfer.gemspec +6 -8
  37. data/config/application.rb +1 -1
  38. data/config/environments/development.rb +11 -10
  39. data/config/environments/production.rb +0 -6
  40. data/config/puma.rb +43 -0
  41. data/gemfiles/7.1.gemfile +3 -2
  42. data/gemfiles/7.2.gemfile +3 -2
  43. data/gemfiles/{6.1.gemfile → 8.0.gemfile} +3 -2
  44. data/lib/comfortable_media_surfer/engine.rb +3 -8
  45. data/lib/comfortable_media_surfer/extensions/has_revisions.rb +1 -1
  46. data/lib/comfortable_media_surfer/render_methods.rb +7 -7
  47. data/lib/comfortable_media_surfer/version.rb +1 -1
  48. data/lib/generators/comfy/scaffold/scaffold_generator.rb +1 -1
  49. data/lib/tasks/cms_assets.rake +19 -0
  50. data/package-lock.json +379 -0
  51. data/package.json +23 -0
  52. data/rakelib/create_release.rake +17 -17
  53. metadata +16 -152
  54. data/app/assets/javascripts/comfy/vendor/Moxie.swf +0 -0
  55. data/app/assets/javascripts/comfy/vendor/Moxie.xap +0 -0
  56. data/app/assets/javascripts/comfy/vendor/bootstrap.bundle.min.js +0 -7
  57. data/app/assets/javascripts/comfy/vendor/bootstrap.bundle.min.js.map +0 -1
  58. data/app/assets/javascripts/comfy/vendor/codemirror/addon/edit/closetag.js +0 -169
  59. data/app/assets/javascripts/comfy/vendor/codemirror/mode/css/css.js +0 -832
  60. data/app/assets/javascripts/comfy/vendor/codemirror/mode/htmlmixed/htmlmixed.js +0 -152
  61. data/app/assets/javascripts/comfy/vendor/codemirror/mode/javascript/javascript.js +0 -875
  62. data/app/assets/javascripts/comfy/vendor/codemirror/mode/markdown/markdown.js +0 -861
  63. data/app/assets/javascripts/comfy/vendor/codemirror/mode/xml/xml.js +0 -394
  64. data/app/assets/javascripts/comfy/vendor/codemirror.js +0 -9653
  65. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ar.js +0 -52
  66. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/bg.js +0 -65
  67. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/bn.js +0 -65
  68. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ca.js +0 -83
  69. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/cs.js +0 -70
  70. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/cy.js +0 -92
  71. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/da.js +0 -71
  72. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/de.js +0 -70
  73. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/default.js +0 -80
  74. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/eo.js +0 -73
  75. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/es.js +0 -69
  76. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/et.js +0 -73
  77. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/fa.js +0 -68
  78. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/fi.js +0 -69
  79. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/fr.js +0 -75
  80. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/gr.js +0 -74
  81. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/he.js +0 -57
  82. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/hi.js +0 -65
  83. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/hr.js +0 -66
  84. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/hu.js +0 -72
  85. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/id.js +0 -61
  86. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/it.js +0 -70
  87. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ja.js +0 -57
  88. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ko.js +0 -60
  89. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/lt.js +0 -72
  90. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/lv.js +0 -67
  91. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/mk.js +0 -69
  92. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/mn.js +0 -67
  93. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ms.js +0 -68
  94. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/my.js +0 -69
  95. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/nl.js +0 -75
  96. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/no.js +0 -73
  97. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/pa.js +0 -65
  98. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/pl.js +0 -68
  99. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/pt-BR.js +0 -66
  100. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/pt.js +0 -66
  101. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ro.js +0 -69
  102. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ru.js +0 -66
  103. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/si.js +0 -65
  104. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sk.js +0 -70
  105. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sl.js +0 -70
  106. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sq.js +0 -65
  107. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sr.js +0 -69
  108. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sv.js +0 -70
  109. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/th.js +0 -72
  110. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/tr.js +0 -66
  111. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/uk.js +0 -66
  112. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/vn.js +0 -66
  113. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/zh-CN.js +0 -61
  114. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/zh-TW.js +0 -61
  115. data/app/assets/javascripts/comfy/vendor/moxie.min.js +0 -16
  116. data/app/assets/javascripts/comfy/vendor/plupload.dev.js +0 -2497
  117. data/app/assets/javascripts/comfy/vendor/sortable.min.js +0 -5
  118. data/app/assets/stylesheets/comfy/vendor/codemirror.css +0 -346
  119. data/app/assets/stylesheets/comfy/vendor/flatpickr.min.css +0 -13
  120. data/config/initializers/assets.rb +0 -14
  121. 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: 7e13956535a432a90cf4905da00b95ed763fcf7045666eb2951fa0e61cda1687
4
+ data.tar.gz: ffb8456f3b63e657765e1f99f3063cd10e4358fb1ffb8edf889d2d51858618c9
5
5
  SHA512:
6
- metadata.gz: c301e8f8152f0eaeadda3f7560f0926370987fda15647218701751953d712891e97aeedda19d462cbf054c50d2a9e56a85c8381640a5200dd623cd6b1a744760
7
- data.tar.gz: 2aa71081385b605f87e1f9d4642f0ca4f3f92a9fd91e9b927562ec289adb3f3f71111d05f15ebb2e61f62491c61e1a2f7655bf9ca53787dd852678f091361e72
6
+ metadata.gz: b457c2eaad7e7f76d3f8ae944d9f7dc7f28dbb1a4892e08f4ba3369f4037ab8818c26084abaf84d0e5aee897f9a723d9c5d84616031fb8ad4b70cdf338a29a80
7
+ data.tar.gz: bd40c8934a344398aaa8d89be7191ca5d7d0391f1ad544cc9c3faa5e26c91db0dc86f9314cc356b2095ad1e1c474bbb479795dbe348e864e957af79537a8db04
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
@@ -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,59 @@
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
+ ## [v3.1.0] - 2024-12-31 (gem yanked, pending resolution of [Issue 8](https://github.com/shakacode/comfortable-media-surfer/issues/8)
16
+
17
+ ### Added
18
+
19
+ - Added compatibility and support for Rails 8
20
+ - 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.
21
+
22
+ ### Removed
23
+
24
+ - Removed sassc sprockets
25
+ - Rails 6.x compatibility dropped, since it is not being maintained as of October 2024
26
+
27
+ ### Changed
28
+
29
+ - Updated README links to point to the Surfer wiki
30
+
31
+ ## [v3.0.0] - 2024-11-30
32
+
33
+ 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.
34
+
35
+ ### Fixed
36
+
37
+ - Fixed all broken tests to now pass on Rails 6.x and 7.x
38
+ - Code syntax per Rubocop linting
39
+
40
+ ### Added
41
+
42
+ - 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
43
+ - Added github actions workflows for CI build and test coverage
44
+ - Added CMS tags for navigation: children, siblings, breadcrumbs, with tests
45
+ - Added CMS tag for embedded audio, with tests
46
+ - Added CMS tag for image, with tests
47
+ - Added ability to write CMS snippets in Markdown, with tests
48
+
49
+ ### Removed
50
+
51
+ - Rails 5 compatibility dropped, as it is EOL
52
+
53
+ ### Changed
54
+
55
+ - Rebranded **ComfortableMexicanSofa** as **ComfortableMediaSurfer** in order to publish new gem (database table names and schema have not changed).
56
+
57
+ [Unreleased]: https://github.com/shakacode/comfortable-media-surfer/compare/v3.1.0...master
58
+ [v3.1.0]: https://github.com/shakacode/comfortable-media-surfer/compare/v3.0.0...v3.1.0
59
+ [v3.0.0]: https://github.com/shakacode/comfortable-media-surfer/compare/v2.0.19...v3.0.0
data/CONTRIBUTING.md CHANGED
@@ -8,6 +8,8 @@ Fork the project. Optionally, create a branch you want to work on.
8
8
 
9
9
  ### 2. Get it running locally
10
10
 
11
+ - Install NodeJS and yarn
12
+ - Install JS dependencies with `yarn`
11
13
  - Install gem dependencies with `bundle install`
12
14
  - There's nothing to configure, by default database is SQLite so it will be
13
15
  created for you. Just run `bundle exec rake db:migrate`
@@ -19,7 +21,7 @@ Fork the project. Optionally, create a branch you want to work on.
19
21
  ### 3. Hack away
20
22
 
21
23
  - 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.
24
+ - When adding new code just make sure it follows the same style as the existing code.
23
25
  - Avoid adding 3rd party dependencies if you can.
24
26
  - Tests please, but nothing complicated. UnitTest / Fixtures all the way. Make sure all tests pass.
25
27
  - Run `bundle exec rubocop` and fix any issues raised.
@@ -27,7 +29,7 @@ Fork the project. Optionally, create a branch you want to work on.
27
29
  ### 4. Make a pull request
28
30
 
29
31
  - 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
32
+ - When PR is submitted check if Github actions CI ran all tests successfully
31
33
 
32
34
  ### 5. Done!
33
35
 
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
11
  gem 'autoprefixer-rails', '~> 10.4.16.0'
12
12
  gem 'byebug', '~> 11.1.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
@@ -30,6 +32,8 @@ 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
38
  gem 'rubocop', '~> 1.63.0', require: false
35
39
  gem 'rubocop-minitest'
data/README.md CHANGED
@@ -1,42 +1,49 @@
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
45
  rake db:migrate
46
+ ```
40
47
 
41
48
  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
49
 
@@ -45,11 +52,45 @@ comfy_route :cms_admin, path: "/admin"
45
52
  comfy_route :cms, path: "/"
46
53
  ```
47
54
 
55
+ ## Converting from ComfortableMexicanSofa or Occams
56
+
57
+ ### From Sofa to Surfer
58
+
59
+ The database structure is the same. Your Sofa project will also need to be upgraded to >= Rails 7.x
60
+ Then you should simply be able to update your Gemfile thus, and run bundle
61
+
62
+ ```ruby
63
+ gem 'comfortable_media_surfer', '~> 3.1.0'
64
+ ```
65
+
66
+ ### From Occams to Surfer
67
+
68
+ Again the project must be >= Rails 7.x. Since the schema is different, executing this SQL should get you set for Surfer
69
+
70
+ ```sql
71
+ ALTER TABLE occams_cms_categories RENAME TO comfy_cms_categories;
72
+ ALTER TABLE occams_cms_categorizations RENAME TO comfy_cms_categorizations;
73
+ ALTER TABLE occams_cms_files RENAME TO comfy_cms_files;
74
+ ALTER TABLE occams_cms_fragments RENAME TO comfy_cms_fragments;
75
+ ALTER TABLE occams_cms_layouts RENAME TO comfy_cms_layouts;
76
+ ALTER TABLE occams_cms_pages RENAME TO comfy_cms_pages;
77
+ ALTER TABLE occams_cms_revisions RENAME TO comfy_cms_revisions;
78
+ ALTER TABLE occams_cms_sites RENAME TO comfy_cms_sites;
79
+ ALTER TABLE occams_cms_snippets RENAME TO comfy_cms_snippets;
80
+ ALTER TABLE occams_cms_translations RENAME TO comfy_cms_translations;
81
+ UPDATE comfy_cms_fragments SET record_type = 'Comfy::Cms::Page' WHERE record_type = 'Occams::Cms::Page';
82
+ UPDATE comfy_cms_fragments SET record_type = 'Comfy::Cms::Layout' WHERE record_type = 'Occams::Cms::Layout';
83
+ UPDATE comfy_cms_fragments SET record_type = 'Comfy::Cms::Snippet' WHERE record_type = 'Occams::Cms::Snippet';
84
+ UPDATE comfy_cms_revisions SET record_type = 'Comfy::Cms::Page' WHERE record_type = 'Occams::Cms::Page';
85
+ UPDATE comfy_cms_revisions SET record_type = 'Comfy::Cms::Layout' WHERE record_type = 'Occams::Cms::Layout';
86
+ UPDATE comfy_cms_revisions SET record_type = 'Comfy::Cms::Snippet' WHERE record_type = 'Occams::Cms::Snippet';
87
+ ```
88
+
48
89
  ## Quick Start Guide
49
90
 
50
91
  After finishing installation you should be able to navigate to http://localhost:3000/admin
51
92
 
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)
93
+ 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
94
 
54
95
  Before creating pages and populating them with content we need to create a Site. Site defines a hostname, content path and its language.
55
96
 
@@ -68,11 +109,8 @@ Once you have a layout, you may start creating pages and populating content. It'
68
109
 
69
110
  ## Documentation
70
111
 
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.
112
+ 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
113
+ on [Content Tags](https://github.com/shakacode/comfortable-media-surfer/wiki/Docs:-Content-Tags).
76
114
 
77
115
  ## Add-ons
78
116
 
@@ -81,16 +119,13 @@ If you want to add a Blog functionality to your app take a look at
81
119
 
82
120
  ![Admin Area Preview](doc/preview.jpg)
83
121
 
84
- #### Old Versions
122
+ #### Old Versions of ComfortableMexicanSofa
85
123
 
86
- [CHANGELOG](//github.com/comfy/comfortable-mexican-sofa/releases) is documented
87
- in Github releases.
124
+ [CHANGELOG](//github.com/comfy/comfortable-mexican-sofa/releases) is documented in ComfortableMexicanSofa Github releases.
88
125
 
89
126
  #### Contributing
90
127
 
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)
128
+ 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
129
 
95
130
  #### Testing
96
131
 
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
  })();
@@ -1,3 +1,6 @@
1
+ import jQuery from "jquery";
2
+ import Popover from "bootstrap/js/src/popover";
3
+
1
4
  (() => {
2
5
  const isFirefox = /\bFirefox\//.test(navigator.userAgent);
3
6
 
@@ -6,20 +9,23 @@
6
9
  this.link = link;
7
10
  this.isImage = !!link.dataset.cmsFileThumbUrl;
8
11
 
9
- link.addEventListener('dragstart', (evt) => {
10
- evt.dataTransfer.setData('text/plain', this.link.dataset.cmsFileLinkTag);
12
+ link.addEventListener("dragstart", (evt) => {
13
+ evt.dataTransfer.setData(
14
+ "text/plain",
15
+ this.link.dataset.cmsFileLinkTag
16
+ );
11
17
  });
12
18
 
13
19
  if (this.isImage) {
14
- new bootstrap.Popover(link, {
20
+ new Popover(link, {
15
21
  container: link.parentElement,
16
- trigger: 'hover',
17
- placement: 'top',
22
+ trigger: "hover",
23
+ placement: "top",
18
24
  content: this.buildFileThumbnail(),
19
- html: true
25
+ html: true,
20
26
  });
21
27
 
22
- link.addEventListener('dragstart', (evt) => {
28
+ link.addEventListener("dragstart", (evt) => {
23
29
  evt.dataTransfer.setDragImage(this.buildFileThumbnail(), 4, 2);
24
30
  this.getPopover().hide();
25
31
  });
@@ -41,10 +47,10 @@
41
47
  // https://bugzilla.mozilla.org/show_bug.cgi?id=505521
42
48
  workAroundFirefoxPopoverGlitch() {
43
49
  if (!isFirefox) return;
44
- this.link.addEventListener('dragstart', () => {
50
+ this.link.addEventListener("dragstart", () => {
45
51
  this.getPopover().disable();
46
52
  });
47
- this.link.addEventListener('dragend', () => {
53
+ this.link.addEventListener("dragend", () => {
48
54
  setTimeout(() => {
49
55
  const popover = this.getPopover();
50
56
  popover.enable();
@@ -55,12 +61,12 @@
55
61
 
56
62
  // We can't keep a reference to the Popover object, because Bootstrap re-creates it internally.
57
63
  getPopover() {
58
- return jQuery(this.link).data(bootstrap.Popover.DATA_KEY);
64
+ return jQuery(this.link).data(Popover.DATA_KEY);
59
65
  }
60
66
  }
61
67
 
62
68
  window.CMS.fileLinks = (root = document) => {
63
- for (const link of root.querySelectorAll('[data-cms-file-link-tag]')) {
69
+ for (const link of root.querySelectorAll("[data-cms-file-link-tag]")) {
64
70
  new FileLink(link);
65
71
  }
66
72
  };