alchemy_cms 4.5.1 → 4.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +11 -14
  3. data/.rubocop.yml +7 -15
  4. data/CHANGELOG.md +18 -8
  5. data/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +5 -5
  6. data/app/assets/javascripts/alchemy/templates/page.hbs +1 -1
  7. data/app/assets/stylesheets/alchemy/_mixins.scss +2 -3
  8. data/app/assets/stylesheets/alchemy/_variables.scss +2 -2
  9. data/app/assets/stylesheets/alchemy/lists.scss +0 -8
  10. data/app/assets/stylesheets/alchemy/nodes.scss +1 -1
  11. data/app/assets/stylesheets/alchemy/sitemap.scss +59 -21
  12. data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +6 -6
  13. data/app/controllers/alchemy/admin/pages_controller.rb +0 -1
  14. data/app/controllers/alchemy/api/pages_controller.rb +2 -0
  15. data/app/decorators/alchemy/content_editor.rb +55 -0
  16. data/app/helpers/alchemy/admin/pages_helper.rb +16 -16
  17. data/app/models/alchemy/attachment.rb +1 -1
  18. data/app/models/alchemy/content.rb +9 -23
  19. data/app/models/alchemy/element.rb +1 -1
  20. data/app/models/alchemy/node.rb +9 -8
  21. data/app/models/alchemy/page/url_path.rb +66 -0
  22. data/app/models/alchemy/page.rb +12 -1
  23. data/app/models/alchemy/picture.rb +1 -1
  24. data/app/serializers/alchemy/page_serializer.rb +2 -1
  25. data/app/serializers/alchemy/page_tree_serializer.rb +4 -3
  26. data/app/views/alchemy/admin/layoutpages/index.html.erb +5 -1
  27. data/app/views/alchemy/admin/nodes/_form.html.erb +2 -2
  28. data/app/views/alchemy/admin/pages/_form.html.erb +1 -1
  29. data/app/views/alchemy/admin/pages/_menu_fields.html.erb +33 -29
  30. data/app/views/alchemy/admin/pages/_page.html.erb +3 -6
  31. data/app/views/alchemy/admin/pages/_sitemap.html.erb +6 -0
  32. data/app/views/alchemy/admin/pages/info.html.erb +1 -1
  33. data/config/alchemy/config.yml +0 -6
  34. data/config/locales/alchemy.en.yml +6 -6
  35. data/lib/alchemy/config.rb +30 -2
  36. data/lib/alchemy/essence.rb +1 -1
  37. data/lib/alchemy/resource.rb +4 -6
  38. data/lib/alchemy/ssl_protection.rb +3 -1
  39. data/lib/alchemy/upgrader/four_point_six.rb +50 -0
  40. data/lib/alchemy/upgrader/four_point_two.rb +0 -1
  41. data/lib/alchemy/upgrader/tasks/cells_migration.rb +1 -2
  42. data/lib/alchemy/upgrader/tasks/cells_upgrader.rb +3 -21
  43. data/lib/alchemy/upgrader/tasks/element_partial_name_variable_updater.rb +4 -8
  44. data/lib/alchemy/userstamp.rb +1 -1
  45. data/lib/alchemy/version.rb +1 -1
  46. data/lib/tasks/alchemy/convert.rake +2 -0
  47. data/lib/tasks/alchemy/upgrade.rake +67 -46
  48. metadata +8 -6
  49. data/lib/alchemy/upgrader/tasks/fixed_element_name_finder.rb +0 -31
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "4.5.1"
4
+ VERSION = "4.6.0"
5
5
 
6
6
  def self.version
7
7
  VERSION
@@ -3,6 +3,7 @@ namespace :alchemy do
3
3
  namespace :urlnames do
4
4
  desc "Converts the urlname of all pages to nested url paths."
5
5
  task to_nested: [:environment] do
6
+ Alchemy::Deprecation.warn('alchemy:convert:urlnames:to_nested task is deprecated and will be removed from Alchemy 5.0')
6
7
  unless Alchemy::Config.get(:url_nesting)
7
8
  raise "\nURL nesting is disabled! Please enable url_nesting in `config/alchemy/config.yml` first.\n\n"
8
9
  end
@@ -18,6 +19,7 @@ namespace :alchemy do
18
19
 
19
20
  desc "Converts the urlname of all pages to contain the slug only."
20
21
  task to_slug: [:environment] do
22
+ Alchemy::Deprecation.warn('alchemy:convert:urlnames:to_slug task is deprecated and will be removed from Alchemy 5.0')
21
23
  if Alchemy::Config.get(:url_nesting)
22
24
  raise "\nURL nesting is enabled! Please disable url_nesting in `config/alchemy/config.yml` first.\n\n"
23
25
  end
@@ -1,29 +1,32 @@
1
- require 'alchemy/upgrader'
2
- require 'alchemy/version'
1
+ # frozen_string_literal: true
2
+
3
+ require "alchemy/upgrader"
4
+ require "alchemy/version"
3
5
 
4
6
  namespace :alchemy do
5
7
  desc "Upgrades your app to AlchemyCMS v#{Alchemy::VERSION}."
6
8
  task upgrade: [
7
- 'alchemy:upgrade:prepare',
8
- 'alchemy:upgrade:4.1:run', 'alchemy:upgrade:4.1:todo',
9
- 'alchemy:upgrade:4.2:run', 'alchemy:upgrade:4.2:todo',
10
- 'alchemy:upgrade:4.4:run', 'alchemy:upgrade:4.4:todo'
9
+ "alchemy:upgrade:prepare",
10
+ "alchemy:upgrade:4.1:run", "alchemy:upgrade:4.1:todo",
11
+ "alchemy:upgrade:4.2:run", "alchemy:upgrade:4.2:todo",
12
+ "alchemy:upgrade:4.4:run", "alchemy:upgrade:4.4:todo",
13
+ "alchemy:upgrade:4.6:run", "alchemy:upgrade:4.6:todo",
11
14
  ] do
12
15
  Alchemy::Upgrader.display_todos
13
16
  end
14
17
 
15
18
  namespace :upgrade do
16
- desc 'Alchemy Upgrader: Prepares the database and updates Alchemys configuration file.'
19
+ desc "Alchemy Upgrader: Prepares the database and updates Alchemys configuration file."
17
20
  task prepare: [
18
- 'alchemy:upgrade:database',
19
- 'alchemy:upgrade:config'
21
+ "alchemy:upgrade:database",
22
+ "alchemy:upgrade:config",
20
23
  ]
21
24
 
22
25
  desc "Alchemy Upgrader: Prepares the database."
23
26
  task database: [
24
- 'alchemy:install:migrations',
25
- 'db:migrate',
26
- 'alchemy:db:seed'
27
+ "alchemy:install:migrations",
28
+ "db:migrate",
29
+ "alchemy:db:seed",
27
30
  ]
28
31
 
29
32
  desc "Alchemy Upgrader: Copy configuration file."
@@ -37,19 +40,19 @@ namespace :alchemy do
37
40
  end
38
41
  end
39
42
 
40
- desc 'Upgrade Alchemy to v4.1'
41
- task '4.1' => [
42
- 'alchemy:upgrade:prepare',
43
- 'alchemy:upgrade:4.1:run',
44
- 'alchemy:upgrade:4.1:todo'
43
+ desc "Upgrade Alchemy to v4.1"
44
+ task "4.1" => [
45
+ "alchemy:upgrade:prepare",
46
+ "alchemy:upgrade:4.1:run",
47
+ "alchemy:upgrade:4.1:todo",
45
48
  ] do
46
49
  Alchemy::Upgrader.display_todos
47
50
  end
48
51
 
49
- namespace '4.1' do
50
- task run: ['alchemy:upgrade:4.1:harden_acts_as_taggable_on_migrations']
52
+ namespace "4.1" do
53
+ task run: ["alchemy:upgrade:4.1:harden_acts_as_taggable_on_migrations"]
51
54
 
52
- desc 'Harden acts_as_taggable_on migrations'
55
+ desc "Harden acts_as_taggable_on migrations"
53
56
  task harden_acts_as_taggable_on_migrations: [:environment] do
54
57
  Alchemy::Upgrader::FourPointOne.harden_acts_as_taggable_on_migrations
55
58
  end
@@ -59,45 +62,45 @@ namespace :alchemy do
59
62
  end
60
63
  end
61
64
 
62
- desc 'Upgrade Alchemy to v4.2'
63
- task '4.2' => [
64
- 'alchemy:upgrade:prepare',
65
- 'alchemy:upgrade:4.2:run',
66
- 'alchemy:upgrade:4.2:todo'
65
+ desc "Upgrade Alchemy to v4.2"
66
+ task "4.2" => [
67
+ "alchemy:upgrade:prepare",
68
+ "alchemy:upgrade:4.2:run",
69
+ "alchemy:upgrade:4.2:todo",
67
70
  ] do
68
71
  Alchemy::Upgrader.display_todos
69
72
  end
70
73
 
71
- namespace '4.2' do
74
+ namespace "4.2" do
72
75
  task run: [
73
- 'alchemy:upgrade:4.2:convert_picture_galleries',
74
- 'alchemy:upgrade:4.2:migrate_picture_galleries',
75
- 'alchemy:upgrade:4.2:convert_cells',
76
- 'alchemy:upgrade:4.2:migrate_cells',
77
- 'alchemy:upgrade:4.2:update_element_partial_name_variable'
76
+ "alchemy:upgrade:4.2:convert_picture_galleries",
77
+ "alchemy:upgrade:4.2:migrate_picture_galleries",
78
+ "alchemy:upgrade:4.2:convert_cells",
79
+ "alchemy:upgrade:4.2:migrate_cells",
80
+ "alchemy:upgrade:4.2:update_element_partial_name_variable",
78
81
  ]
79
82
 
80
- desc 'Convert `picture_gallery` element definitions to `nestable_elements`.'
83
+ desc "Convert `picture_gallery` element definitions to `nestable_elements`."
81
84
  task convert_picture_galleries: [:environment] do
82
85
  Alchemy::Upgrader::FourPointTwo.convert_picture_galleries
83
86
  end
84
87
 
85
- desc 'Migrate `picture_gallery` elements to `nestable_elements`.'
88
+ desc "Migrate `picture_gallery` elements to `nestable_elements`."
86
89
  task migrate_picture_galleries: [:environment] do
87
90
  Alchemy::Upgrader::FourPointTwo.migrate_picture_galleries
88
91
  end
89
92
 
90
- desc 'Convert cells config to fixed nestable elements.'
93
+ desc "Convert cells config to fixed nestable elements."
91
94
  task convert_cells: [:environment] do
92
95
  Alchemy::Upgrader::FourPointTwo.convert_cells
93
96
  end
94
97
 
95
- desc 'Migrate existing cells to fixed nestable elements.'
96
- task migrate_cells: ['alchemy:install:migrations', 'db:migrate'] do
98
+ desc "Migrate existing cells to fixed nestable elements."
99
+ task migrate_cells: ["alchemy:install:migrations", "db:migrate"] do
97
100
  Alchemy::Upgrader::FourPointTwo.migrate_cells
98
101
  end
99
102
 
100
- desc 'Update element views to use element partial name variable.'
103
+ desc "Update element views to use element partial name variable."
101
104
  task :update_element_partial_name_variable do
102
105
  Alchemy::Upgrader::FourPointTwo.update_element_views_variable_name
103
106
  end
@@ -107,19 +110,19 @@ namespace :alchemy do
107
110
  end
108
111
  end
109
112
 
110
- desc 'Upgrade Alchemy to v4.4'
111
- task '4.4' => [
112
- 'alchemy:upgrade:prepare',
113
- 'alchemy:upgrade:4.4:run',
114
- 'alchemy:upgrade:4.4:todo'
113
+ desc "Upgrade Alchemy to v4.4"
114
+ task "4.4" => [
115
+ "alchemy:upgrade:prepare",
116
+ "alchemy:upgrade:4.4:run",
117
+ "alchemy:upgrade:4.4:todo",
115
118
  ] do
116
119
  Alchemy::Upgrader.display_todos
117
120
  end
118
121
 
119
- namespace '4.4' do
122
+ namespace "4.4" do
120
123
  task run: [
121
- 'alchemy:upgrade:4.4:rename_element_views',
122
- 'alchemy:upgrade:4.4:update_local_variable'
124
+ "alchemy:upgrade:4.4:rename_element_views",
125
+ "alchemy:upgrade:4.4:update_local_variable",
123
126
  ]
124
127
 
125
128
  desc "Remove '_view' suffix from element views."
@@ -127,7 +130,7 @@ namespace :alchemy do
127
130
  Alchemy::Upgrader::FourPointFour.rename_element_views
128
131
  end
129
132
 
130
- desc 'Update element views local variable to element name.'
133
+ desc "Update element views local variable to element name."
131
134
  task update_local_variable: [:environment] do
132
135
  Alchemy::Upgrader::FourPointFour.update_local_variable
133
136
  end
@@ -136,5 +139,23 @@ namespace :alchemy do
136
139
  Alchemy::Upgrader::FourPointFour.alchemy_4_4_todos
137
140
  end
138
141
  end
142
+
143
+ desc "Upgrade Alchemy to v4.6"
144
+ task "4.6" => [
145
+ "alchemy:upgrade:prepare",
146
+ ]
147
+
148
+ namespace "4.6" do
149
+ task run: []
150
+
151
+ desc "Move child pages of invisible pages to visible parent."
152
+ task restructure_page_tree: [:environment] do
153
+ Alchemy::Upgrader::FourPointSix.restructure_page_tree
154
+ end
155
+
156
+ task :todo do
157
+ Alchemy::Upgrader::FourPointSix.todos
158
+ end
159
+ end
139
160
  end
140
161
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.5.1
4
+ version: 4.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
@@ -10,10 +10,10 @@ authors:
10
10
  - Hendrik Mans
11
11
  - Carsten Fregin
12
12
  - Martin Meyerhoff
13
- autorequire:
13
+ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2021-11-17 00:00:00.000000000 Z
16
+ date: 2020-06-04 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: active_model_serializers
@@ -739,6 +739,7 @@ files:
739
739
  - app/controllers/concerns/alchemy/locale_redirects.rb
740
740
  - app/controllers/concerns/alchemy/page_redirects.rb
741
741
  - app/controllers/concerns/alchemy/site_redirects.rb
742
+ - app/decorators/alchemy/content_editor.rb
742
743
  - app/helpers/alchemy/admin/attachments_helper.rb
743
744
  - app/helpers/alchemy/admin/base_helper.rb
744
745
  - app/helpers/alchemy/admin/contents_helper.rb
@@ -790,6 +791,7 @@ files:
790
791
  - app/models/alchemy/page/page_naming.rb
791
792
  - app/models/alchemy/page/page_natures.rb
792
793
  - app/models/alchemy/page/page_scopes.rb
794
+ - app/models/alchemy/page/url_path.rb
793
795
  - app/models/alchemy/picture.rb
794
796
  - app/models/alchemy/picture/transformations.rb
795
797
  - app/models/alchemy/picture/url.rb
@@ -1102,12 +1104,12 @@ files:
1102
1104
  - lib/alchemy/upgrader.rb
1103
1105
  - lib/alchemy/upgrader/four_point_four.rb
1104
1106
  - lib/alchemy/upgrader/four_point_one.rb
1107
+ - lib/alchemy/upgrader/four_point_six.rb
1105
1108
  - lib/alchemy/upgrader/four_point_two.rb
1106
1109
  - lib/alchemy/upgrader/tasks/cells_migration.rb
1107
1110
  - lib/alchemy/upgrader/tasks/cells_upgrader.rb
1108
1111
  - lib/alchemy/upgrader/tasks/element_partial_name_variable_updater.rb
1109
1112
  - lib/alchemy/upgrader/tasks/element_views_updater.rb
1110
- - lib/alchemy/upgrader/tasks/fixed_element_name_finder.rb
1111
1113
  - lib/alchemy/upgrader/tasks/harden_acts_as_taggable_on_migrations.rb
1112
1114
  - lib/alchemy/upgrader/tasks/picture_gallery_migration.rb
1113
1115
  - lib/alchemy/upgrader/tasks/picture_gallery_upgrader.rb
@@ -1242,8 +1244,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1242
1244
  version: '0'
1243
1245
  requirements:
1244
1246
  - ImageMagick (libmagick), v6.6 or greater.
1245
- rubygems_version: 3.1.6
1246
- signing_key:
1247
+ rubygems_version: 3.0.3
1248
+ signing_key:
1247
1249
  specification_version: 4
1248
1250
  summary: A powerful, userfriendly and flexible CMS for Rails 5
1249
1251
  test_files: []
@@ -1,31 +0,0 @@
1
- module Alchemy::Upgrader::Tasks
2
- class FixedElementNameFinder
3
-
4
- def call(cell_name)
5
- return cell_name if fixed_elements.include?(cell_name)
6
- return "#{cell_name}_elements" if unfixed_elements.include?(cell_name)
7
- cell_name
8
- end
9
-
10
- private
11
-
12
- def fixed_elements
13
- @_fixed_element_names ||= begin
14
- definitions.select { |element| element['fixed'] }.map { |element| element['name'] }
15
- end
16
- end
17
-
18
- def unfixed_elements
19
- @_unfixed_elements ||= begin
20
- definitions.reject { |element| element['fixed'] }.map { |element| element['name'] }
21
- end
22
- end
23
-
24
- def definitions
25
- @_definitions ||= begin
26
- elements_file_path = Rails.root.join('config', 'alchemy', 'elements.yml')
27
- YAML.load_file(elements_file_path)
28
- end
29
- end
30
- end
31
- end