comfy_middle_seat 3.2.1 → 4.0.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -4
- data/CONTRIBUTING.md +8 -5
- data/Gemfile +1 -1
- data/README.md +60 -20
- data/Rakefile +3 -3
- data/app/assets/javascripts/comfy/admin/cms/application.js +1 -0
- data/app/assets/javascripts/comfy/admin/cms/base.js +4 -1
- data/app/assets/javascripts/comfy/admin/cms/codemirror.js +17 -0
- data/app/assets/javascripts/comfy/admin/cms/draft_forms.js +468 -0
- data/app/assets/javascripts/comfy/admin/cms/page_fragments.js +393 -22
- data/app/assets/javascripts/comfy/admin/cms/wysiwyg.js +21 -0
- data/app/assets/javascripts/comfy/vendor/redactor/filemanager.js +48 -30
- data/app/assets/javascripts/comfy/vendor/redactor/imagemanager.js +43 -25
- data/app/assets/stylesheets/comfy/admin/cms/base.sass +23 -0
- data/app/controllers/comfy/admin/base_controller.rb +3 -3
- data/app/controllers/comfy/admin/cms/base_controller.rb +12 -7
- data/app/controllers/comfy/admin/cms/files_controller.rb +1 -1
- data/app/controllers/comfy/admin/cms/pages_controller.rb +76 -16
- data/app/controllers/comfy/admin/cms/revisions/base_controller.rb +39 -1
- data/app/controllers/comfy/admin/cms/revisions/page_controller.rb +9 -8
- data/app/controllers/comfy/admin/cms/revisions/translation_controller.rb +14 -8
- data/app/controllers/comfy/admin/cms/sites_controller.rb +1 -1
- data/app/controllers/comfy/admin/cms/translations_controller.rb +3 -1
- data/app/controllers/comfy/cms/base_controller.rb +1 -1
- data/app/controllers/comfy/cms/content_controller.rb +5 -5
- data/app/controllers/concerns/comfy/reorder_action.rb +24 -4
- data/app/helpers/comfy/admin/cms_helper.rb +24 -3
- data/app/helpers/comfy/cms_helper.rb +1 -1
- data/app/models/comfy/cms/file.rb +25 -3
- data/app/models/comfy/cms/layout.rb +8 -6
- data/app/models/comfy/cms/page.rb +22 -0
- data/app/models/comfy/cms/site.rb +3 -3
- data/app/models/comfy/cms/snippet.rb +8 -3
- data/app/models/concerns/comfy/cms/with_fragments.rb +2 -2
- data/app/views/comfy/admin/cms/categories/_index.html.haml +1 -1
- data/app/views/comfy/admin/cms/categories/_show.html.haml +1 -1
- data/app/views/comfy/admin/cms/files/_file.html.haml +1 -1
- data/app/views/comfy/admin/cms/files/index.html.haml +9 -2
- data/app/views/comfy/admin/cms/fragments/_form_fragments.html.haml +2 -2
- data/app/views/comfy/admin/cms/pages/_form.html.haml +2 -1
- data/app/views/comfy/admin/cms/pages/_index_branch.html.haml +11 -10
- data/app/views/comfy/admin/cms/pages/edit.html.haml +3 -1
- data/app/views/comfy/admin/cms/pages/index.html.haml +9 -2
- data/app/views/comfy/admin/cms/pages/new.html.haml +3 -1
- data/app/views/comfy/admin/cms/pages/toggle_branch.js.erb +2 -2
- data/app/views/comfy/admin/cms/revisions/show.html.haml +25 -7
- data/app/views/comfy/admin/cms/shared/_search.html.haml +9 -0
- data/app/views/comfy/admin/cms/sites/_form.html.haml +1 -1
- data/app/views/comfy/admin/cms/translations/_form.html.haml +2 -1
- data/app/views/comfy/admin/cms/translations/edit.html.haml +3 -1
- data/app/views/comfy/admin/cms/translations/new.html.haml +3 -1
- data/app/views/layouts/comfy/admin/cms/_flash.html.haml +1 -1
- data/app/views/layouts/comfy/admin/cms/_head.html.haml +3 -1
- data/app/views/layouts/comfy/admin/cms/_left.html.haml +1 -1
- data/comfy_middle_seat.gemspec +10 -5
- data/config/application.rb +2 -2
- data/config/cms_routes.rb +1 -1
- data/config/environment.rb +1 -1
- data/config/environments/development.rb +1 -1
- data/config/environments/production.rb +1 -1
- data/config/environments/test.rb +1 -1
- data/config/initializers/{comfortable_media_surfer.rb → comfy_middle_seat.rb} +4 -4
- data/config/locales/ar.yml +12 -0
- data/config/locales/ca.yml +12 -0
- data/config/locales/cs.yml +12 -0
- data/config/locales/da.yml +12 -0
- data/config/locales/de.yml +12 -0
- data/config/locales/en.yml +12 -0
- data/config/locales/es.yml +12 -0
- data/config/locales/fi.yml +12 -0
- data/config/locales/fr.yml +12 -0
- data/config/locales/gr.yml +12 -0
- data/config/locales/hr.yml +12 -0
- data/config/locales/it.yml +12 -0
- data/config/locales/ja.yml +12 -0
- data/config/locales/nb.yml +12 -0
- data/config/locales/nl.yml +12 -0
- data/config/locales/pl.yml +12 -0
- data/config/locales/pt-BR.yml +12 -0
- data/config/locales/ru.yml +12 -0
- data/config/locales/sk.yml +12 -0
- data/config/locales/sv.yml +12 -0
- data/config/locales/tr.yml +12 -0
- data/config/locales/uk.yml +12 -0
- data/config/locales/zh-CN.yml +12 -0
- data/config/locales/zh-TW.yml +12 -0
- data/config.ru +1 -1
- data/exe/comfy-middle-seat-upgrade +34 -0
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/access_control/admin_authentication.rb +4 -4
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/access_control/admin_authorization.rb +1 -1
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/access_control/public_authentication.rb +1 -1
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/access_control/public_authorization.rb +1 -1
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/configuration.rb +7 -7
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/block.rb +1 -1
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/params_parser.rb +1 -1
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/renderer.rb +10 -10
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tag.rb +4 -4
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/asset.rb +4 -4
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/audio.rb +3 -3
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/breadcrumbs.rb +3 -3
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/checkbox.rb +3 -3
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/children.rb +3 -3
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/date.rb +3 -3
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/datetime.rb +3 -3
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/file.rb +5 -5
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/file_link.rb +4 -4
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/files.rb +3 -3
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/fragment.rb +2 -2
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/helper.rb +4 -4
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/image.rb +4 -4
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/markdown.rb +3 -3
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/mixins/file_content.rb +1 -1
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/number.rb +3 -3
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/page_file_link.rb +5 -5
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/partial.rb +4 -4
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/siblings.rb +3 -3
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/snippet.rb +3 -3
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/template.rb +4 -4
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/text.rb +3 -3
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/textarea.rb +3 -3
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags/wysiwyg.rb +3 -3
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content/tags.rb +1 -1
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/content.rb +1 -1
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/engine.rb +4 -4
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/error.rb +4 -4
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/extensions/acts_as_tree.rb +3 -3
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/extensions/has_revisions.rb +4 -4
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/extensions.rb +1 -1
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/form_builder.rb +2 -2
- data/lib/comfy_middle_seat/initializer_upgrader.rb +115 -0
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/render_methods.rb +7 -7
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/routing.rb +3 -2
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/seeds/file/exporter.rb +5 -5
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/seeds/file/importer.rb +5 -5
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/seeds/layout/exporter.rb +4 -4
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/seeds/layout/importer.rb +5 -5
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/seeds/page/exporter.rb +5 -5
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/seeds/page/importer.rb +7 -7
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/seeds/snippet/exporter.rb +4 -4
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/seeds/snippet/importer.rb +5 -5
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/seeds.rb +4 -4
- data/lib/comfy_middle_seat/version.rb +2 -2
- data/lib/{comfortable_media_surfer → comfy_middle_seat}/view_hooks.rb +2 -2
- data/lib/comfy_middle_seat.rb +54 -1
- data/lib/generators/comfy/cms/README +3 -11
- data/lib/generators/comfy/cms/cms_generator.rb +2 -2
- data/lib/generators/comfy/scaffold/templates/tests/controller.rb.tt +2 -2
- data/lib/tasks/cms_seeds.rake +8 -8
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +67 -62
- data/lib/comfortable_media_surfer/version.rb +0 -3
- data/lib/comfortable_media_surfer.rb +0 -56
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c2b743bb8f3cdbae17801963c031a890072c7b4694336e155dd0d381a49ec2ff
|
|
4
|
+
data.tar.gz: c73a92f4aa40a06760914731d40cd0c9f7471b5abf20aa3710f522d300353f84
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: edd044c383fafb4c9c310df6c83e35f365fa5aeac4052f844f0fd8051a89b1b63564af6ad6ddc5a12637a866b700f34ce3342d077ca9e54dacf20b35a3ccec2a
|
|
7
|
+
data.tar.gz: 204fac7b1e4c2b3bfc3677529fede906334ffe97cdda1180a24c19a40c6b8175b0a13e6635b2d5d1ad78cb87e9fdd1c62c604f057f28193ca23065d6375b3374
|
data/CHANGELOG.md
CHANGED
|
@@ -12,10 +12,26 @@ This changelog follows the project's lineage: **Comfortable Mexican Sofa → Com
|
|
|
12
12
|
|
|
13
13
|
## [Unreleased]
|
|
14
14
|
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- Complete the implementation namespace and internal-path decoupling from Comfortable Media Surfer: current Ruby APIs now use `ComfyMiddleSeat`, library files live under `comfy_middle_seat`, and generated configuration belongs at `config/initializers/comfy_middle_seat.rb`.
|
|
18
|
+
- Require applications upgrading from `comfortable_media_surfer` to rename the initializer and replace Ruby configuration or integration references from `ComfortableMediaSurfer` to `ComfyMiddleSeat`. The existing `comfy_cms_*` database tables, schema, and stored data remain unchanged, so no database migration is required.
|
|
19
|
+
- Add the standalone `comfy-middle-seat-upgrade` executable to safely preview and convert a legacy initializer without booting Rails, preserving the original as a backup and refusing ambiguous or destructive changes.
|
|
20
|
+
- Preserve Comfortable Media Surfer names and URLs where they describe project history, acknowledgements, inherited release notes, or upstream resources rather than the current API.
|
|
21
|
+
|
|
22
|
+
## [v3.2.1] - 2026-09-17
|
|
23
|
+
|
|
15
24
|
### Fixed
|
|
16
25
|
|
|
17
26
|
- Fix CI eager loading after the gem rename by excluding the explicitly required `comfy_middle_seat` entrypoint and version directory from Zeitwerk autoloading. Add a regression test that also checks eager loading outside CI.
|
|
18
27
|
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- At the time of this release, update the admin footer branding and repository link to Comfy Middle Seat while retaining the then-current `ComfortableMediaSurfer::VERSION` compatibility constant.
|
|
31
|
+
- Check that `COVERALLS_REPO_TOKEN` is configured before running the coverage job, with a clear error when it is missing.
|
|
32
|
+
- Document asset compilation and explicit test database setup, along with commands for running the main and browser/system test suites.
|
|
33
|
+
- Update README badges and release documentation, preserving the distinction between Seat releases and inherited Surfer history.
|
|
34
|
+
|
|
19
35
|
## [v3.2.0] - 2026-09-17
|
|
20
36
|
|
|
21
37
|
**First Comfy Middle Seat release.** Forked from [Comfortable Media Surfer](https://github.com/shakacode/comfortable-media-surfer), itself a revival of [Comfortable Mexican Sofa](https://github.com/comfy/comfortable-mexican-sofa). The new name keeps the C.M.S. initials and pays homage to the original.
|
|
@@ -23,7 +39,7 @@ This changelog follows the project's lineage: **Comfortable Mexican Sofa → Com
|
|
|
23
39
|
### Changed
|
|
24
40
|
|
|
25
41
|
- Publish the gem as `comfy_middle_seat` and rename the gemspec to `comfy_middle_seat.gemspec`.
|
|
26
|
-
-
|
|
42
|
+
- At the time of v3.2.0, preserve the `ComfortableMediaSurfer` Ruby namespace and configuration while retaining the existing routes and database tables. The Unreleased namespace decoupling supersedes the Ruby compatibility behavior; the database compatibility remains unchanged.
|
|
27
43
|
- Move the version definition to `lib/comfy_middle_seat/version.rb` for release tooling, retaining a compatibility loader at the old path.
|
|
28
44
|
- Run the main test suite in six isolated processes by default, with merged coverage and a separate `test:serial` task for Coveralls.
|
|
29
45
|
- Update CI coverage to Rails 7.2, 8.0, and 8.1, with a separate browser/system test job.
|
|
@@ -39,9 +55,9 @@ This changelog follows the project's lineage: **Comfortable Mexican Sofa → Com
|
|
|
39
55
|
- Fix file modal cleanup and reinitialization, and expose jQuery for Bootstrap integration.
|
|
40
56
|
- Remove the unsupported `:escape` option before JSON parsing while preserving other parser options.
|
|
41
57
|
|
|
42
|
-
###
|
|
58
|
+
### Historical v3.2.0 upgrade behavior
|
|
43
59
|
|
|
44
|
-
|
|
60
|
+
For v3.2.0, users replaced `comfortable_media_surfer` with `comfy_middle_seat` in the Gemfile while keeping the former Ruby namespace and initializer name. That release-specific compatibility guidance is preserved for history but is superseded by the Unreleased change: current upgrades must rename the initializer to `config/initializers/comfy_middle_seat.rb` and replace `ComfortableMediaSurfer` Ruby references with `ComfyMiddleSeat`. Neither stage changes the database schema.
|
|
45
61
|
|
|
46
62
|
## Comfortable Media Surfer — inherited releases
|
|
47
63
|
|
|
@@ -170,7 +186,8 @@ First release of `comfortable_media_surfer`. This new gem is a revival of [Comfo
|
|
|
170
186
|
|
|
171
187
|
- Rebranded **ComfortableMexicanSofa** as **ComfortableMediaSurfer** in order to publish new gem (database table names and schema have not changed).
|
|
172
188
|
|
|
173
|
-
[Unreleased]: https://github.com/avonderluft/comfy-middle-seat/compare/v3.2.
|
|
189
|
+
[Unreleased]: https://github.com/avonderluft/comfy-middle-seat/compare/v3.2.1...master
|
|
190
|
+
[v3.2.1]: https://github.com/avonderluft/comfy-middle-seat/compare/v3.2.0...v3.2.1
|
|
174
191
|
[v3.2.0]: https://github.com/avonderluft/comfy-middle-seat/compare/eeb5d590f47b5d6bb70191fb81c781540753fa97...v3.2.0
|
|
175
192
|
[v3.1.7]: https://github.com/shakacode/comfortable-media-surfer/compare/v3.1.6...v3.1.7
|
|
176
193
|
[v3.1.6]: https://github.com/shakacode/comfortable-media-surfer/compare/v3.1.5...v3.1.6
|
data/CONTRIBUTING.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Contributing
|
|
2
2
|
|
|
3
|
-
Contribute
|
|
3
|
+
Contribute to [Comfy Middle Seat](https://github.com/avonderluft/comfy-middle-seat) in five steps:
|
|
4
4
|
|
|
5
5
|
### 1. Fork it
|
|
6
6
|
|
|
7
|
-
Fork the
|
|
7
|
+
Fork the [current repository](https://github.com/avonderluft/comfy-middle-seat). Optionally, create a branch for your work.
|
|
8
8
|
|
|
9
9
|
### 2. Get it running locally
|
|
10
10
|
|
|
@@ -25,9 +25,12 @@ Fork the project. Optionally, create a branch you want to work on.
|
|
|
25
25
|
|
|
26
26
|
### 3. Hack away
|
|
27
27
|
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
28
|
+
- Use the current `ComfyMiddleSeat` Ruby namespace and `comfy_middle_seat` internal paths. New configuration examples and generated initializers belong in `config/initializers/comfy_middle_seat.rb`; do not reintroduce `ComfortableMediaSurfer` as a current API.
|
|
29
|
+
- Keep the existing `comfy_cms_*` database tables and schema stable. The namespace and internal-path decoupling does not require a database migration.
|
|
30
|
+
- Historical release notes, acknowledgements, and upstream links may intentionally retain the Comfortable Media Surfer name.
|
|
31
|
+
- Create a few small pull requests instead of one huge pull request. Smaller changes can be reviewed and merged faster.
|
|
32
|
+
- When adding new code, make sure it follows the same style as the existing code.
|
|
33
|
+
- Avoid adding third-party dependencies if you can.
|
|
31
34
|
- Tests please, but nothing complicated. UnitTest / Fixtures all the way. Make sure all tests pass.
|
|
32
35
|
- Run `bundle exec rubocop` and fix any issues raised.
|
|
33
36
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
[](https://github.com/avonderluft/comfy-middle-seat/actions/workflows/rubyonrails.yml) [](https://coveralls.io/github/avonderluft/comfy-middle-seat?branch=master) [](https://rubygems.org/gems/comfy_middle_seat) [](https://rubygems.org/gems/comfy_middle_seat) [](https://github.com/avonderluft/comfy-middle-seat/releases)
|
|
2
2
|
|
|
3
3
|
# Comfy Middle Seat
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
It all depends on who is sitting on your left and on your right.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Comfy Middle Seat is a Rails CMS (Content Management System) engine, published as the `comfy_middle_seat` gem. It is descended from Comfortable Media Surfer and pays homage to the original Comfortable Mexican Sofa—with the same C.M.S. initials with a new place to sit.
|
|
8
|
+
|
|
9
|
+
The current implementation uses the `ComfyMiddleSeat` Ruby namespace, `comfy_middle_seat` internal paths, and the initializer `config/initializers/comfy_middle_seat.rb`. Database storage remains compatible: the existing `comfy_cms_*` tables and schema are unchanged, so this namespace change requires no database migration.
|
|
8
10
|
|
|
9
11
|
## Project History
|
|
10
12
|
|
|
11
13
|
- **[Comfortable Mexican Sofa](https://github.com/comfy/comfortable-mexican-sofa)**, created by Oleg Khabarov, is the original Rails CMS on which this project is built. Oleg deserves the lion's share of kudos.
|
|
12
|
-
- **[
|
|
13
|
-
- **[Comfortable Media Surfer](https://github.com/shakacode/comfortable-media-surfer)** revived Sofa under the
|
|
14
|
-
- **Comfy Middle Seat**
|
|
14
|
+
- **[oCcaMS](https://github.com/avonderluft/occams)** was an attempted revival of Sofa. Andrew vonderLuft was a contributor to [RadiantCMS](https://github.com/radiant/radiant) back in the day, but that project became inactive. He found Sofa and liked it even better than Radiant, but sadly it too became inactive. Hence Occams.
|
|
15
|
+
- **[Comfortable Media Surfer](https://github.com/shakacode/comfortable-media-surfer)** revived Sofa under the sponsorship of ShakaCode, continuing its development for modern Rails applications.
|
|
16
|
+
- **[Comfy Middle Seat](https://github.com/avonderluft/comfy-middle-seat)** began as a fork of Comfortable Media Surfer and is now implemented under its own `ComfyMiddleSeat` namespace and `comfy_middle_seat` paths.
|
|
15
17
|
|
|
16
18
|
See the [CHANGELOG](CHANGELOG.md) for the inherited development history, and the original [Sofa releases](https://github.com/comfy/comfortable-mexican-sofa/releases) and [Surfer releases](https://github.com/shakacode/comfortable-media-surfer/releases) for earlier releases.
|
|
17
19
|
|
|
@@ -44,15 +46,17 @@ Add gem definition to your Gemfile:
|
|
|
44
46
|
gem "comfy_middle_seat", "~> 3.2.0"
|
|
45
47
|
```
|
|
46
48
|
|
|
47
|
-
Then from the Rails project's root
|
|
49
|
+
Then, for a new installation, run these commands from the Rails project's root:
|
|
48
50
|
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
```sh
|
|
52
|
+
bundle install
|
|
53
|
+
rails generate comfy:cms
|
|
54
|
+
rails db:migrate
|
|
55
|
+
rails comfy:compile_assets
|
|
54
56
|
```
|
|
55
57
|
|
|
58
|
+
`rails db:migrate` is part of a new installation. Applications upgrading from Comfortable Media Surfer already have the same tables and schema and do not need a database migration for the gem, namespace, or internal-path rename.
|
|
59
|
+
|
|
56
60
|
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.
|
|
57
61
|
|
|
58
62
|
```ruby
|
|
@@ -60,24 +64,60 @@ comfy_route :cms_admin, path: "/admin"
|
|
|
60
64
|
comfy_route :cms, path: "/"
|
|
61
65
|
```
|
|
62
66
|
|
|
67
|
+
The generator creates `config/initializers/comfy_middle_seat.rb`. Use `ComfyMiddleSeat` for configuration and other library API references:
|
|
68
|
+
|
|
69
|
+
```ruby
|
|
70
|
+
ComfyMiddleSeat.configure do |config|
|
|
71
|
+
config.cms_title = "My CMS"
|
|
72
|
+
config.admin_base_controller = "ApplicationController"
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
ComfyMiddleSeat::AccessControl::AdminAuthentication.username = "user"
|
|
76
|
+
ComfyMiddleSeat::AccessControl::AdminAuthentication.password = "change-me"
|
|
77
|
+
```
|
|
78
|
+
|
|
63
79
|
## Converting from Comfortable Media Surfer, Comfortable Mexican Sofa, or Occams
|
|
64
80
|
|
|
65
81
|
### From Surfer to Middle Seat
|
|
66
82
|
|
|
67
|
-
Replace `comfortable_media_surfer` in your Gemfile with `comfy_middle_seat` and run `bundle install`. Do not include both gems.
|
|
83
|
+
1. Replace `comfortable_media_surfer` in your Gemfile with `comfy_middle_seat` and run `bundle install`. Do not include both gems.
|
|
84
|
+
2. From the Rails application root, preview and run the standalone initializer upgrader. It does not boot Rails:
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
bundle exec comfy-middle-seat-upgrade --dry-run
|
|
88
|
+
bundle exec comfy-middle-seat-upgrade
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
It renames `config/initializers/comfortable_media_surfer.rb` to `config/initializers/comfy_middle_seat.rb`, updates the project namespace references inside it, and preserves the original as `config/initializers/comfortable_media_surfer.rb.bak`. It refuses to overwrite an existing initializer or backup.
|
|
92
|
+
3. In any other application integrations, replace Ruby references to `ComfortableMediaSurfer` with `ComfyMiddleSeat`.
|
|
93
|
+
|
|
94
|
+
For example:
|
|
95
|
+
|
|
96
|
+
```ruby
|
|
97
|
+
# Before
|
|
98
|
+
ComfortableMediaSurfer.configure do |config|
|
|
99
|
+
config.cms_title = "My CMS"
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# After
|
|
103
|
+
ComfyMiddleSeat.configure do |config|
|
|
104
|
+
config.cms_title = "My CMS"
|
|
105
|
+
end
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Review the converted initializer and remove its `.bak` file when satisfied. The database tables, schema, and stored records remain unchanged; existing `comfy_cms_*` tables are used as-is, and **no database migration is required** for this upgrade.
|
|
68
109
|
|
|
69
110
|
### From Sofa to Middle Seat
|
|
70
111
|
|
|
71
|
-
The database structure is the same.
|
|
72
|
-
Then you should simply be able to update your Gemfile thus, and run bundle
|
|
112
|
+
The database structure is the same, so no database migration is required for the CMS tables. Your Sofa project must first be upgraded to Rails 7.2 or newer. Then update the Gemfile, run `bundle install`, use `config/initializers/comfy_middle_seat.rb`, and update CMS library references in application code to `ComfyMiddleSeat`:
|
|
73
113
|
|
|
74
114
|
```ruby
|
|
75
|
-
gem
|
|
115
|
+
gem "comfy_middle_seat", "~> 3.2.0"
|
|
76
116
|
```
|
|
77
117
|
|
|
78
118
|
### From Occams to Middle Seat
|
|
79
119
|
|
|
80
|
-
|
|
120
|
+
The project must be on Rails 7.2 or newer. Unlike Surfer and Sofa, Occams used different table names, so converting an Occams database requires the following SQL. This is an Occams data conversion, not a migration caused by the current `ComfyMiddleSeat` namespace or internal-path change.
|
|
81
121
|
|
|
82
122
|
```sql
|
|
83
123
|
ALTER TABLE occams_cms_categories RENAME TO comfy_cms_categories;
|
|
@@ -105,7 +145,7 @@ UPDATE active_storage_attachments SET record_type = 'Comfy::Cms::File' WHERE rec
|
|
|
105
145
|
|
|
106
146
|
After finishing installation you should be able to navigate to http://localhost:3000/admin
|
|
107
147
|
|
|
108
|
-
|
|
148
|
+
The default username and password are `user` and `pass`. Change them before exposing the application. Admin credentials and other CMS settings are configured in `config/initializers/comfy_middle_seat.rb` through the `ComfyMiddleSeat` namespace.
|
|
109
149
|
|
|
110
150
|
Before creating pages and populating them with content we need to create a Site. Site defines a hostname, content path and its language.
|
|
111
151
|
|
|
@@ -124,7 +164,7 @@ Once you have a layout, you may start creating pages and populating content. It'
|
|
|
124
164
|
|
|
125
165
|
## Documentation
|
|
126
166
|
|
|
127
|
-
The [Comfortable Media Surfer Wiki](https://github.com/shakacode/comfortable-media-surfer/wiki) remains
|
|
167
|
+
The [Comfortable Media Surfer Wiki](https://github.com/shakacode/comfortable-media-surfer/wiki) remains an upstream reference for inherited CMS features, including [Content Tags](https://github.com/shakacode/comfortable-media-surfer/wiki/Docs:-Content-Tags). These historical upstream links are intentionally preserved. When adapting its examples, use the `comfy_middle_seat` gem, `config/initializers/comfy_middle_seat.rb`, and the `ComfyMiddleSeat` Ruby namespace; upstream examples that use `ComfortableMediaSurfer` show the former API and must be updated.
|
|
128
168
|
|
|
129
169
|
## Add-ons
|
|
130
170
|
|
|
@@ -136,7 +176,7 @@ If you want to add a Blog functionality to your app take a look at
|
|
|
136
176
|
|
|
137
177
|
#### Contributing
|
|
138
178
|
|
|
139
|
-
Comfy Middle Seat 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).
|
|
179
|
+
Comfy Middle Seat 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).
|
|
140
180
|
|
|
141
181
|
#### Testing
|
|
142
182
|
|
data/Rakefile
CHANGED
|
@@ -8,7 +8,7 @@ require 'stringio'
|
|
|
8
8
|
|
|
9
9
|
Rails.application.load_tasks
|
|
10
10
|
|
|
11
|
-
module
|
|
11
|
+
module ComfyMiddleSeatTestOutput
|
|
12
12
|
SUMMARY = %r{(?<assertions>\d+) assertions, (?<errors>\d+) errors, (?<failures>\d+) failures, (?<skips>\d+) skips?, (?<tests>\d+) tests}
|
|
13
13
|
COLORS = { green: 32, yellow: 33, red: 31, cyan: 36 }.freeze
|
|
14
14
|
|
|
@@ -71,7 +71,7 @@ module ComfortableMediaSurferTestOutput
|
|
|
71
71
|
def flush
|
|
72
72
|
return if @pending.empty?
|
|
73
73
|
|
|
74
|
-
@io.print
|
|
74
|
+
@io.print ComfyMiddleSeatTestOutput.progress_color(@pending)
|
|
75
75
|
@io.flush
|
|
76
76
|
@pending.clear
|
|
77
77
|
end
|
|
@@ -197,7 +197,7 @@ namespace :test do
|
|
|
197
197
|
Rake::Task['test:serial'].enhance(['test:prepare_serial'])
|
|
198
198
|
|
|
199
199
|
desc 'Run tests in isolated processes'
|
|
200
|
-
task(:parallel) {
|
|
200
|
+
task(:parallel) { ComfyMiddleSeatTestOutput.run_parallel }
|
|
201
201
|
end
|
|
202
202
|
|
|
203
203
|
Rake::Task[:test].clear
|
|
@@ -25,15 +25,18 @@
|
|
|
25
25
|
CMS.wysiwyg.init();
|
|
26
26
|
CMS.sortableList.init();
|
|
27
27
|
CMS.timepicker.init();
|
|
28
|
-
CMS.pageFragments();
|
|
28
|
+
CMS.pageFragments.init();
|
|
29
29
|
CMS.categories();
|
|
30
30
|
CMS.files.init();
|
|
31
31
|
CMS.fileLinks();
|
|
32
32
|
CMS.fileUpload.init();
|
|
33
33
|
CMS.diff();
|
|
34
|
+
CMS.draftForms.init();
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
CMS.dispose = () => {
|
|
38
|
+
CMS.pageFragments.dispose();
|
|
39
|
+
CMS.draftForms.dispose();
|
|
37
40
|
CMS.codemirror.dispose();
|
|
38
41
|
CMS.wysiwyg.dispose();
|
|
39
42
|
CMS.files.dispose();
|
|
@@ -18,6 +18,9 @@ import "codemirror/mode/htmlmixed/htmlmixed";
|
|
|
18
18
|
lineNumbers: true,
|
|
19
19
|
viewportMargin: Infinity,
|
|
20
20
|
});
|
|
21
|
+
codemirror.on("change", () => {
|
|
22
|
+
textarea.dispatchEvent(new Event("input", { bubbles: true }));
|
|
23
|
+
});
|
|
21
24
|
codeMirrorInstances.push(codemirror);
|
|
22
25
|
}
|
|
23
26
|
|
|
@@ -33,6 +36,20 @@ import "codemirror/mode/htmlmixed/htmlmixed";
|
|
|
33
36
|
}
|
|
34
37
|
});
|
|
35
38
|
},
|
|
39
|
+
sync(root = document) {
|
|
40
|
+
for (const codemirror of codeMirrorInstances) {
|
|
41
|
+
if (root.contains(codemirror.getTextArea())) codemirror.save();
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
restore(root = document) {
|
|
45
|
+
for (const codemirror of codeMirrorInstances) {
|
|
46
|
+
const textarea = codemirror.getTextArea();
|
|
47
|
+
if (!root.contains(textarea)) continue;
|
|
48
|
+
|
|
49
|
+
codemirror.setValue(textarea.value);
|
|
50
|
+
codemirror.refresh();
|
|
51
|
+
}
|
|
52
|
+
},
|
|
36
53
|
dispose() {
|
|
37
54
|
for (const codemirror of codeMirrorInstances) {
|
|
38
55
|
codemirror.toTextArea();
|