occams 1.0.8 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rubyonrails.yml +1 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +8 -0
- data/Gemfile +2 -2
- data/README.md +1 -3
- data/app/controllers/concerns/occams/reorder_action.rb +3 -0
- data/app/controllers/occams/admin/cms/pages_controller.rb +8 -0
- data/config/application.rb +1 -2
- data/config/environments/test.rb +2 -0
- data/config/locales/en.yml +3 -3
- data/lib/occams/content/tags/siblings.rb +3 -0
- data/lib/occams/version.rb +1 -1
- metadata +3 -5
- data/lib/occams/routes/cms.rb +0 -16
- data/lib/occams/routes/cms_admin.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: 4a97f751e8ded8222b0ef73e6f06b6633bdc5a2cef1858872d0e4ccbcdbc56c8
|
4
|
+
data.tar.gz: 1c1b034bc1599c94a72e99bf67b5eecb45cdffc35d4bccd2aa1c906780e760a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2da69ad3d5a308ddc27208fba96417b6156029702f24337a76d43711ed9925cfe62b07cf52f413742aca58d0f01bc73391a3d59409936e904d88ab4b95cfe0a3
|
7
|
+
data.tar.gz: 9ed1193e3ba2976446bba4c04092b9af3ec39430a54b75db05a4d0f26466b2de8fef6b6725d30e565ec7a82dde7f428c014cf60d9456922b46a414362b0cac4d
|
data/.gitignore
CHANGED
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.
|
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', '~>
|
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
|
data/config/application.rb
CHANGED
@@ -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
|
|
data/config/environments/test.rb
CHANGED
@@ -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
|
|
data/config/locales/en.yml
CHANGED
@@ -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
|
|
data/lib/occams/version.rb
CHANGED
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
|
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:
|
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.
|
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
|
data/lib/occams/routes/cms.rb
DELETED
@@ -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
|