occams 1.0.8 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fcc8760162308f5d0ad46ac82f46fa92be816f9e8c6ee291759709ddc472513e
4
- data.tar.gz: f67e7efd920a103c3027e0201e824ee95bea38853893688ca7cbd9b0961d9a6d
3
+ metadata.gz: 4a97f751e8ded8222b0ef73e6f06b6633bdc5a2cef1858872d0e4ccbcdbc56c8
4
+ data.tar.gz: 1c1b034bc1599c94a72e99bf67b5eecb45cdffc35d4bccd2aa1c906780e760a7
5
5
  SHA512:
6
- metadata.gz: aa7e678609d40af0dcd82a99a135f398006120c6b867a51a5814a7295f2540ec9771a21a0e972d64299e552b989b267748d35f8fe0c242b4fb2cc731e0086275
7
- data.tar.gz: aaab1c6865ad43badee1f359c76fa3e45157f85ecb16f742c309c2ebd5de5430426745155f97fb619568d1d3280b2bdc21b33a9ba48f7e6eed763dcaa47a0ec9
6
+ metadata.gz: 2da69ad3d5a308ddc27208fba96417b6156029702f24337a76d43711ed9925cfe62b07cf52f413742aca58d0f01bc73391a3d59409936e904d88ab4b95cfe0a3
7
+ data.tar.gz: 9ed1193e3ba2976446bba4c04092b9af3ec39430a54b75db05a4d0f26466b2de8fef6b6725d30e565ec7a82dde7f428c014cf60d9456922b46a414362b0cac4d
@@ -17,6 +17,7 @@ jobs:
17
17
  rails-version:
18
18
  - "6.1"
19
19
  - "7.0"
20
+ - "7.1"
20
21
  continue-on-error: [true]
21
22
  name: ${{ format('Tests (Ruby {0}, Rails {1})', matrix.ruby-version, matrix.rails-version) }}
22
23
  runs-on: ubuntu-latest
data/.gitignore CHANGED
@@ -12,6 +12,7 @@ coverage/
12
12
  db/*.sqlite3
13
13
  db/cms_fixtures/test-site/
14
14
  db/development_structure.sql
15
+ db/development.sqlite3*
15
16
  db/schema.rb
16
17
  db/test.sqlite3*
17
18
  Gemfile.lock
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## v.1.1.0 13 May 2024
4
+
5
+ - Rails 7.1 compatibility, all tests passing
6
+ - corrected bug in siblings tag to not display links to unpublished pages
7
+ - children lists and sibling navs are updated after page create, update, delete
8
+ - fixed zeitwerk check failures
9
+ - updated README
10
+
3
11
  ## v1.0.8 - 29 December 2023
4
12
 
5
13
  - Updated configs, et al. in pursuit of Rails 7.1 compatibility
data/Gemfile CHANGED
@@ -5,11 +5,11 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
5
5
 
6
6
  gemspec
7
7
 
8
- gem 'rails', '~> 7.0.0'
8
+ gem 'rails', '~> 7.1.2'
9
9
 
10
10
  group :development, :test do
11
11
  gem 'autoprefixer-rails', '~> 8.1.0'
12
- gem 'byebug', '~> 10.0.0', platforms: %i[mri mingw x64_mingw]
12
+ gem 'byebug', '~> 11.1.0', platforms: %i[mri mingw x64_mingw]
13
13
  gem 'image_processing', '>= 1.2'
14
14
  gem 'sqlite3', '~> 1.6.7'
15
15
  # gem 'mysql2', '~> 0.5'
data/README.md CHANGED
@@ -98,8 +98,6 @@ Once you have a layout, you may start creating pages and populating content. It'
98
98
 
99
99
  ## Documentation
100
100
 
101
- [Occams](https://github.com/avonderluft/occams)
102
-
103
101
  For more information on how to use this CMS please refer to the [Wiki](https://github.com/avonderluft/occams/wiki). Section that might be of interest is the entry
104
102
  on [Content Tags](https://github.com/comfy/avonderluft/occams/Content-Tags).
105
103
 
@@ -120,5 +118,5 @@ For more detail see [CONTRIBUTING](CONTRIBUTING.md)
120
118
  - Thanks to [Roman Almeida](https://github.com/nasmorn) for contributing OEM License for [Redactor Text Editor](http://imperavi.com/redactor)
121
119
 
122
120
  ---
123
- - [Occams](https://github.com/avonderluft/occams) Copyright 2023 Andrew vonderLuft, following Comfy, released under the [MIT license](LICENSE)
121
+ - [Occams](https://github.com/avonderluft/occams) Copyright 2023-2024 Andrew vonderLuft, following Comfy, released under the [MIT license](LICENSE)
124
122
  - [ComfortableMexicanSofa](https://github.com/comfy/comfortable-mexican-sofa) Copyright 2010-2019 Oleg Khabarov. Released under the [MIT license](LICENSE)
@@ -12,6 +12,9 @@ module Occams::ReorderAction
12
12
  (params.permit(order: [])[:order] || []).each_with_index do |id, index|
13
13
  resource_class.where(id: id).update_all(position: index)
14
14
  end
15
+ if resource_class == ::Occams::Cms::Page
16
+ Occams::Cms::Page.all.each(&:save!)
17
+ end
15
18
  head :ok
16
19
  end
17
20
  end
@@ -35,8 +35,14 @@ class Occams::Admin::Cms::PagesController < Occams::Admin::Cms::BaseController
35
35
  render
36
36
  end
37
37
 
38
+ def update_family
39
+ @page.siblings.each(&:save!) if @page.siblings
40
+ @page.parent.save! if @page.parent
41
+ end
42
+
38
43
  def create
39
44
  @page.save!
45
+ update_family
40
46
  flash[:success] = I18n.t('occams.admin.cms.pages.created')
41
47
  redirect_to action: :edit, id: @page
42
48
  rescue ActiveRecord::RecordInvalid
@@ -46,6 +52,7 @@ class Occams::Admin::Cms::PagesController < Occams::Admin::Cms::BaseController
46
52
 
47
53
  def update
48
54
  @page.save!
55
+ update_family
49
56
  flash[:success] = I18n.t('occams.admin.cms.pages.updated')
50
57
  redirect_to action: :edit, id: @page
51
58
  rescue ActiveRecord::RecordInvalid
@@ -55,6 +62,7 @@ class Occams::Admin::Cms::PagesController < Occams::Admin::Cms::BaseController
55
62
 
56
63
  def destroy
57
64
  @page.destroy
65
+ update_family
58
66
  flash[:success] = I18n.t('occams.admin.cms.pages.deleted')
59
67
  redirect_to action: :index
60
68
  end
@@ -14,8 +14,6 @@ module Occams
14
14
  config.load_defaults Rails.version.scan(%r{^\d+\.\d+}).first.to_f
15
15
 
16
16
  # Rails 7.1 compatibility - See config/initializers/new_framework_defaults_7_1.rb
17
- config.add_autoload_paths_to_load_path = true
18
-
19
17
  if Gem::Version.new(Rails.version) >= Gem::Version.new('7.1.0')
20
18
  config.active_record.default_column_serializer = YAML
21
19
  config.active_record.before_committed_on_all_records = false
@@ -30,6 +28,7 @@ module Occams
30
28
  # Please, add to the `ignore` list any other `lib` subdirectories that do
31
29
  # not contain `.rb` files, or that should not be reloaded or eager loaded.
32
30
  # Common ones are `templates`, `generators`, or `middleware`, for example.
31
+ config.add_autoload_paths_to_load_path = false
33
32
  config.autoload_lib(ignore: %w[generators])
34
33
  end
35
34
 
@@ -10,6 +10,8 @@ require 'active_support/core_ext/integer/time'
10
10
  defined?(Occams::Application) && Occams::Application.configure do
11
11
  # Settings specified here will take precedence over those in config/application.rb.
12
12
 
13
+ config.active_job.queue_adapter = :test # added for Rails 7.1
14
+
13
15
  # While tests run files are not watched, reloading is not necessary.
14
16
  config.enable_reloading = false
15
17
 
@@ -116,11 +116,11 @@ en:
116
116
  update: Update Layout
117
117
 
118
118
  pages:
119
- created: Page created
119
+ created: Page created, siblings, and parent updated
120
120
  creation_failure: Failed to create page
121
- updated: Page updated
121
+ updated: Page, siblings, and parent updated
122
122
  update_failure: Failed to update page
123
- deleted: Page deleted
123
+ deleted: Page deleted, siblings, and parent updated
124
124
  not_found: Page not found
125
125
  layout_not_found: No Layouts found. Please create one.
126
126
 
@@ -31,6 +31,9 @@ class Occams::Content::Tags::Siblings < Occams::Content::Tag
31
31
  @links = ''
32
32
  # ActiveRecord_Associations_CollectionProxy
33
33
  @sibs = context.self_and_siblings.order(:position).to_ary
34
+ unless Rails.env == 'development'
35
+ @sibs.delete_if { |sib| !sib.is_published }
36
+ end
34
37
  @sibs.delete_if { |sib| @exclude.include? sib.slug }
35
38
  end
36
39
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Occams
4
- VERSION = '1.0.8'
4
+ VERSION = '1.1.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: occams
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew vonderLuft
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-29 00:00:00.000000000 Z
11
+ date: 2024-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_link_to
@@ -737,8 +737,6 @@ files:
737
737
  - lib/occams/extensions/has_revisions.rb
738
738
  - lib/occams/form_builder.rb
739
739
  - lib/occams/render_methods.rb
740
- - lib/occams/routes/cms.rb
741
- - lib/occams/routes/cms_admin.rb
742
740
  - lib/occams/routing.rb
743
741
  - lib/occams/seeds.rb
744
742
  - lib/occams/seeds/file/exporter.rb
@@ -774,7 +772,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
774
772
  - !ruby/object:Gem::Version
775
773
  version: '0'
776
774
  requirements: []
777
- rubygems_version: 3.4.13
775
+ rubygems_version: 3.5.9
778
776
  signing_key:
779
777
  specification_version: 4
780
778
  summary: Rails 6.1-7.1+ CMS Engine
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ActionDispatch::Routing::Mapper
4
- def occams_route_cms(options = {})
5
- Occams.configuration.public_cms_path = options[:path]
6
-
7
- scope module: :occams, as: :occams do
8
- namespace :cms, path: options[:path] do
9
- get 'cms-css/:site_id/:identifier(/:cache_buster)' => 'assets#render_css', as: 'render_css'
10
- get 'cms-js/:site_id/:identifier(/:cache_buster)' => 'assets#render_js', as: 'render_js'
11
-
12
- get '(*cms_path)' => 'content#show', as: 'render_page', action: '/:format'
13
- end
14
- end
15
- end
16
- end
@@ -1,56 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ActionDispatch::Routing::Mapper
4
- def occams_route_cms_admin(path: 'admin')
5
- scope module: :occams, as: :occams do
6
- scope module: :admin do
7
- namespace :cms, as: :admin_cms, path: path, except: :show do
8
- get '/', to: 'base#jump'
9
-
10
- concern :with_revisions do |options|
11
- resources :revisions, options.merge(only: %i[index show]) do
12
- patch :revert, on: :member
13
- end
14
- end
15
-
16
- concern :with_reorder do
17
- put :reorder, on: :collection
18
- end
19
-
20
- concern :with_form_fragments do
21
- get :form_fragments, on: :member
22
- end
23
-
24
- resources :sites do
25
- resources :pages do
26
- concerns :with_reorder
27
- concerns :with_form_fragments
28
- concerns :with_revisions, controller: 'revisions/page'
29
-
30
- get :toggle_branch, on: :member
31
-
32
- resources :translations, except: [:index] do
33
- concerns :with_form_fragments
34
- concerns :with_revisions, controller: 'revisions/translation'
35
- end
36
- end
37
-
38
- resources :files, concerns: [:with_reorder]
39
-
40
- resources :layouts do
41
- concerns :with_reorder
42
- concerns :with_revisions, controller: 'revisions/layout'
43
- end
44
-
45
- resources :snippets do
46
- concerns :with_reorder
47
- concerns :with_revisions, controller: 'revisions/snippet'
48
- end
49
-
50
- resources :categories
51
- end
52
- end
53
- end
54
- end
55
- end
56
- end