alchemy_cms 6.0.0.pre.rc5 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +16 -8
  3. data/.github/workflows/stale.yml +21 -7
  4. data/.gitignore +0 -1
  5. data/.rspec +1 -0
  6. data/CHANGELOG.md +89 -0
  7. data/Gemfile +10 -7
  8. data/Rakefile +5 -1
  9. data/alchemy_cms.gemspec +3 -3
  10. data/app/assets/javascripts/alchemy/admin.js +0 -2
  11. data/app/assets/javascripts/alchemy/alchemy.dialog.js.coffee +6 -1
  12. data/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +2 -0
  13. data/app/assets/javascripts/alchemy/page_select.js +13 -8
  14. data/app/assets/javascripts/alchemy/templates/index.js +1 -0
  15. data/app/assets/javascripts/alchemy/templates/page.hbs +17 -7
  16. data/app/assets/javascripts/alchemy/templates/page_folder.hbs +3 -0
  17. data/app/assets/stylesheets/alchemy/archive.scss +9 -0
  18. data/app/assets/stylesheets/alchemy/elements.scss +4 -0
  19. data/app/assets/stylesheets/alchemy/page-select.scss +29 -4
  20. data/app/assets/stylesheets/alchemy/sitemap.scss +9 -7
  21. data/app/controllers/alchemy/admin/elements_controller.rb +2 -6
  22. data/app/controllers/alchemy/admin/pages_controller.rb +16 -18
  23. data/app/controllers/alchemy/api/contents_controller.rb +1 -5
  24. data/app/controllers/alchemy/api/elements_controller.rb +2 -6
  25. data/app/controllers/alchemy/api/pages_controller.rb +16 -10
  26. data/app/helpers/alchemy/elements_helper.rb +2 -2
  27. data/app/models/alchemy/ingredient.rb +6 -1
  28. data/app/models/alchemy/page.rb +3 -2
  29. data/app/models/alchemy/picture.rb +1 -1
  30. data/app/serializers/alchemy/page_serializer.rb +7 -1
  31. data/app/serializers/alchemy/page_tree_serializer.rb +3 -3
  32. data/app/views/alchemy/admin/pages/_form.html.erb +19 -0
  33. data/app/views/alchemy/admin/pages/_new_page_form.html.erb +16 -5
  34. data/app/views/alchemy/admin/pages/_page.html.erb +111 -133
  35. data/app/views/alchemy/admin/pages/_sitemap.html.erb +10 -16
  36. data/app/views/alchemy/admin/pages/_toolbar.html.erb +0 -12
  37. data/app/views/alchemy/admin/pages/edit.html.erb +1 -1
  38. data/app/views/alchemy/admin/pages/index.html.erb +1 -1
  39. data/app/views/alchemy/admin/pages/update.js.erb +7 -5
  40. data/app/views/alchemy/admin/partials/_routes.html.erb +12 -1
  41. data/app/views/alchemy/admin/resources/_form.html.erb +5 -0
  42. data/app/views/alchemy/essences/_essence_page_editor.html.erb +1 -1
  43. data/config/alchemy/config.yml +1 -0
  44. data/config/locales/alchemy.en.yml +0 -4
  45. data/config/routes.rb +4 -2
  46. data/lib/alchemy/engine.rb +12 -1
  47. data/lib/alchemy/essence.rb +0 -26
  48. data/lib/alchemy/permissions.rb +0 -1
  49. data/lib/alchemy/resource.rb +16 -1
  50. data/lib/alchemy/test_support/essence_shared_examples.rb +0 -12
  51. data/lib/alchemy/test_support/shared_ingredient_examples.rb +4 -2
  52. data/lib/alchemy/upgrader/tasks/ingredients_migrator.rb +1 -1
  53. data/lib/alchemy/version.rb +1 -1
  54. data/lib/generators/alchemy/install/install_generator.rb +6 -1
  55. data/package/admin.js +5 -1
  56. data/package/src/image_loader.js +4 -2
  57. data/package/src/node_tree.js +13 -6
  58. data/package/src/page_publication_fields.js +28 -0
  59. data/package/src/page_sorter.js +62 -0
  60. data/package/src/picture_editors.js +8 -8
  61. data/package/src/sitemap.js +148 -0
  62. data/package/src/utils/__tests__/ajax.spec.js +52 -16
  63. data/package/src/utils/ajax.js +12 -0
  64. data/package.json +1 -1
  65. metadata +43 -43
  66. data/app/assets/javascripts/alchemy/alchemy.page_sorter.js +0 -24
  67. data/app/assets/javascripts/alchemy/alchemy.sitemap.js.coffee +0 -119
  68. data/app/views/alchemy/admin/pages/fold.js.erb +0 -2
  69. data/app/views/alchemy/admin/pages/sort.html.erb +0 -19
  70. data/vendor/assets/javascripts/jquery_plugins/jquery.ui.nestedSortable.js +0 -434
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 380b59193f2297abbf578f48a662afd797a678edd9948b5967a5df870df20b5f
4
- data.tar.gz: e36993e934138b801ce941d7a3b272790b41dde673f1cbded7e874cba637dd8d
3
+ metadata.gz: f1db98328d1be1d96ee705e68f64b757f33d0997e4f622626ca86e4e42511079
4
+ data.tar.gz: 563c9f02b864e170ac88a9d3f405c61b46da38fec41d0f4dfba0ff0c179407ba
5
5
  SHA512:
6
- metadata.gz: '01489e9bf191e8ba5f42d19dfc93336d318744c41ccf6764625ebf787b8f2f030d219829be4b3b5830db93699e681883217909d8239ca023323469c95b7aab28'
7
- data.tar.gz: 33599581bdff5315660e260562179f7e9b12ef9269dd50aeba7e5e52cdcb8bf5db5188bb86cb8cc60b53a0346d6c0bf8fe336c5eef234aec54a6110f7d5386b8
6
+ metadata.gz: 524ab50512e3a7c377f3619f20c6ec812e1c12a933b94fb56d8bbc5b94b843cd9708451b77b96af8be7776bb0c733c90af549da76820109a0163a0338b8599dc
7
+ data.tar.gz: 7c8346e5b07d35e2ef471cb90aff4fe8e62e2050ef13d03436cb2492e0cb5a6d9a2003eefa0f4f55d0a61cfdcbda48596788956908964c71333ca0ebdfa1565d
@@ -9,20 +9,28 @@ jobs:
9
9
  fail-fast: false
10
10
  matrix:
11
11
  rails:
12
- - '6.0'
13
- - '6.1'
12
+ - "6.0"
13
+ - "6.1"
14
+ - "7.0"
14
15
  ruby:
15
- - '2.6.8'
16
- - '2.7.4'
17
- - '3.0.2'
16
+ - "2.6"
17
+ - "2.7"
18
+ - "3.0"
18
19
  database:
19
20
  - mysql
20
21
  - postgresql
22
+ exclude:
23
+ - rails: "7.0"
24
+ ruby: "2.6"
25
+ database: mysql
26
+ - rails: "7.0"
27
+ ruby: "2.6"
28
+ database: postgresql
21
29
  env:
22
30
  DB: ${{ matrix.database }}
23
31
  DB_USER: alchemy_user
24
32
  DB_PASSWORD: password
25
- DB_HOST: '127.0.0.1'
33
+ DB_HOST: "127.0.0.1"
26
34
  RAILS_ENV: test
27
35
  RAILS_VERSION: ${{ matrix.rails }}
28
36
  services:
@@ -32,11 +40,11 @@ jobs:
32
40
  POSTGRES_USER: alchemy_user
33
41
  POSTGRES_PASSWORD: password
34
42
  POSTGRES_DB: alchemy_cms_dummy_test
35
- ports: ['5432:5432']
43
+ ports: ["5432:5432"]
36
44
  options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
37
45
  mysql:
38
46
  image: mysql:latest
39
- ports: ['3306:3306']
47
+ ports: ["3306:3306"]
40
48
  env:
41
49
  MYSQL_USER: alchemy_user
42
50
  MYSQL_PASSWORD: password
@@ -2,16 +2,30 @@ name: Mark stale issues and pull requests
2
2
 
3
3
  on:
4
4
  schedule:
5
- - cron: "0 0 * * *"
5
+ - cron: "0 0 * * *"
6
6
 
7
7
  jobs:
8
8
  stale:
9
-
10
9
  runs-on: ubuntu-latest
11
10
 
12
11
  steps:
13
- - uses: actions/stale@v1
14
- with:
15
- repo-token: ${{ secrets.GITHUB_TOKEN }}
16
- stale-issue-message: 'This issue has not seen any activity in a long time. If the issue described still exists in recent versions of Alchemy, please open a new issue or preferably open a PR with a fix. Thanks for reporting.'
17
- stale-pr-message: 'This pull request has not seen any activiy in a long time. Probably because of missing tests or a necessary rebase. Please open a new PR to latest main if you want to continue working on this. Thanks for the contribution.'
12
+ - uses: actions/stale@v5
13
+ with:
14
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
15
+ stale-issue-message: |
16
+ This issue has not seen any activity in a long time.
17
+ Please create a pull request with a fix or ask someone of the community if they can help.
18
+ This issue will be closed in 7 days if no further activity happens.
19
+ close-issue-message: |
20
+ This issue has not seen any activity in a long time.
21
+ If the issue described still exists in recent versions of Alchemy,
22
+ please open a new issue with. Thanks for reporting.
23
+ stale-pr-message: |
24
+ This pull request has not seen any activiy in a long time.
25
+ Probably because of missing tests or a necessary rebase.
26
+ This PR will be closed in 7 days if no further activity happens.
27
+ close-pr-message: |
28
+ This pull request has not seen any activiy in a long time.
29
+ Probably because of missing tests or a necessary rebase.
30
+ Please open a new PR to latest main if you want to continue working on this.
31
+ Thanks for the contribution.
data/.gitignore CHANGED
@@ -33,7 +33,6 @@ spec/dummy/uploads/
33
33
  .ruby-gemset
34
34
  .ruby-version
35
35
  .env
36
- .rspec
37
36
  node_modules
38
37
  yarn-error.log
39
38
  yarn-debug.log*
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/CHANGELOG.md CHANGED
@@ -1,3 +1,46 @@
1
+ ## 6.0.0 (2022-04-11)
2
+
3
+ - [ruby - main] Allow ransack version 3.0.1 [#2287](https://github.com/AlchemyCMS/alchemy_cms/pull/2287) ([depfu](https://github.com/apps/depfu))
4
+ - Fix image loader [#2285](https://github.com/AlchemyCMS/alchemy_cms/pull/2285) ([tvdeyen](https://github.com/tvdeyen))
5
+ - Don't delete locals in render_element so they can be used by all elements in render_elements [#2283](https://github.com/AlchemyCMS/alchemy_cms/pull/2283) ([dbwinger](https://github.com/dbwinger))
6
+ - Don't hardcode URLs in Javascript [#2282](https://github.com/AlchemyCMS/alchemy_cms/pull/2282) ([dssjoblom](https://github.com/dssjoblom))
7
+ - [ruby - main] Allow ransack 3.0.0 [#2278](https://github.com/AlchemyCMS/alchemy_cms/pull/2278) ([depfu](https://github.com/apps/depfu))
8
+ - Show site and language name on page select in Link dialog [#2276](https://github.com/AlchemyCMS/alchemy_cms/pull/2276) ([dbwinger](https://github.com/dbwinger))
9
+ - Allow webp as image file format [#2274](https://github.com/AlchemyCMS/alchemy_cms/pull/2274) ([tvdeyen](https://github.com/tvdeyen))
10
+ - Rails 7 Support [#2225](https://github.com/AlchemyCMS/alchemy_cms/pull/2225) ([tvdeyen](https://github.com/tvdeyen))
11
+ - Support AR enums in resource models [#2210](https://github.com/AlchemyCMS/alchemy_cms/pull/2210) ([robinboening](https://github.com/robinboening))
12
+
13
+ ## 6.0.0-rc7 (2022-03-28)
14
+
15
+ - fix(Sitemap): Use response data [#2272](https://github.com/AlchemyCMS/alchemy_cms/pull/2272) ([tvdeyen](https://github.com/tvdeyen))
16
+ - Revert "Ajax: Send method override" [#2271](https://github.com/AlchemyCMS/alchemy_cms/pull/2271) ([tvdeyen](https://github.com/tvdeyen))
17
+ - ImageLoader: Add error handling [#2270](https://github.com/AlchemyCMS/alchemy_cms/pull/2270) ([tvdeyen](https://github.com/tvdeyen))
18
+ - Check presence of page_public checkbox [#2269](https://github.com/AlchemyCMS/alchemy_cms/pull/2269) ([afdev82](https://github.com/afdev82))
19
+ - Use lodash-es instead of lodash [#2268](https://github.com/AlchemyCMS/alchemy_cms/pull/2268) ([afdev82](https://github.com/afdev82))
20
+ - CI: Update stale workflow [#2267](https://github.com/AlchemyCMS/alchemy_cms/pull/2267) ([tvdeyen](https://github.com/tvdeyen))
21
+ - Allow to skip db:create during install task [#2266](https://github.com/AlchemyCMS/alchemy_cms/pull/2266) ([tvdeyen](https://github.com/tvdeyen))
22
+ - CI: Fix mysql builds [#2263](https://github.com/AlchemyCMS/alchemy_cms/pull/2263) ([tvdeyen](https://github.com/tvdeyen))
23
+ - Fix new Sitemap [#2262](https://github.com/AlchemyCMS/alchemy_cms/pull/2262) ([tvdeyen](https://github.com/tvdeyen))
24
+ - [ruby - main] Allow ransack version 2.6.0 [#2259](https://github.com/AlchemyCMS/alchemy_cms/pull/2259) ([depfu](https://github.com/apps/depfu))
25
+ - Allow all pages in API again [#2258](https://github.com/AlchemyCMS/alchemy_cms/pull/2258) ([tvdeyen](https://github.com/tvdeyen))
26
+ - Fix setting default value of ingredients [#2257](https://github.com/AlchemyCMS/alchemy_cms/pull/2257) ([tvdeyen](https://github.com/tvdeyen))
27
+ - Eager load in PageTree serializer [#2256](https://github.com/AlchemyCMS/alchemy_cms/pull/2256) ([tvdeyen](https://github.com/tvdeyen))
28
+ - Revert "Merge pull request #2203 from tvdeyen/switch-to-cuprite" [#2255](https://github.com/AlchemyCMS/alchemy_cms/pull/2255) ([tvdeyen](https://github.com/tvdeyen))
29
+ - [js] New version of flatpickr (4.6.10) broke the build [#2254](https://github.com/AlchemyCMS/alchemy_cms/pull/2254) ([depfu](https://github.com/apps/depfu))
30
+ - New sortable page tree [#2252](https://github.com/AlchemyCMS/alchemy_cms/pull/2252) ([tvdeyen](https://github.com/tvdeyen))
31
+ - Use minor versions for ruby version matrix [#2251](https://github.com/AlchemyCMS/alchemy_cms/pull/2251) ([tvdeyen](https://github.com/tvdeyen))
32
+ - Precompile packs during test setup [#2250](https://github.com/AlchemyCMS/alchemy_cms/pull/2250) ([tvdeyen](https://github.com/tvdeyen))
33
+ - Allow parent page change [#2246](https://github.com/AlchemyCMS/alchemy_cms/pull/2246) ([tvdeyen](https://github.com/tvdeyen))
34
+ - Send language_id to Api::PagesController#index so Pages can be restricted to the language of the page [#2245](https://github.com/AlchemyCMS/alchemy_cms/pull/2245) ([dbwinger](https://github.com/dbwinger))
35
+
36
+ ## 6.0.0-rc6 (2022-03-05)
37
+
38
+ - Rework sitemap JS [#2249](https://github.com/AlchemyCMS/alchemy_cms/pull/2249) ([tvdeyen](https://github.com/tvdeyen))
39
+ - Remove old page layout change code from update action [#2248](https://github.com/AlchemyCMS/alchemy_cms/pull/2248) ([tvdeyen](https://github.com/tvdeyen))
40
+ - Fix rendering errors in page configure overlay [#2247](https://github.com/AlchemyCMS/alchemy_cms/pull/2247) ([tvdeyen](https://github.com/tvdeyen))
41
+ - Fix copying page with descendants to a different language [#2243](https://github.com/AlchemyCMS/alchemy_cms/pull/2243) ([dbwinger](https://github.com/dbwinger))
42
+ - Handle copying/pasting global pages [#2241](https://github.com/AlchemyCMS/alchemy_cms/pull/2241) ([dbwinger](https://github.com/dbwinger))
43
+
1
44
  ## 6.0.0-rc5 (2022-02-24)
2
45
 
3
46
  ### Changes
@@ -181,6 +224,52 @@
181
224
  - Fix delete element confirm dialog [#2023](https://github.com/AlchemyCMS/alchemy_cms/pull/2023) ([tvdeyen](https://github.com/tvdeyen))
182
225
  - Build for Ruby 3 [#1990](https://github.com/AlchemyCMS/alchemy_cms/pull/1990) ([tvdeyen](https://github.com/tvdeyen))
183
226
 
227
+ ## 5.2.7 (2022-03-01)
228
+
229
+ - Fix copying page with descendants to a different language ([dbwinger](https://github.com/dbwinger))
230
+ - Handle copying/pasting global pages ([dbwinger](https://github.com/dbwinger))
231
+
232
+ ## 5.2.6 (2022-02-28)
233
+
234
+ - Add crop_resize Dragonfly processor ([tvdeyen](https://github.com/tvdeyen))
235
+
236
+ ## 5.2.5 (2021-11-24)
237
+
238
+ - Adjust tinymce skin assets urls again ([tvdeyen](https://github.com/tvdeyen))
239
+
240
+ ## 5.2.4 (2021-11-17)
241
+
242
+ - Set stampable user_class_name without root identifier ([tvdeyen](https://github.com/tvdeyen))
243
+ - Use relative path for tinymce font-face ([tvdeyen](https://github.com/tvdeyen))
244
+
245
+ ## 5.2.3 (2021-10-26)
246
+
247
+ - Make sure to install correct npm package ([tvdeyen](https://github.com/tvdeyen))
248
+
249
+ ## 5.2.2 (2021-09-15)
250
+
251
+ - Return only pages from current site in api [#2169](https://github.com/AlchemyCMS/alchemy_cms/pull/2169) ([afdev82](https://github.com/afdev82))
252
+ - Improve cache key defaults for menus #2138 [#2160](https://github.com/AlchemyCMS/alchemy_cms/pull/2160) ([oneiros](https://github.com/oneiros))
253
+ - generate picture thumbnails only for pictures with convertible format [#2130](https://github.com/AlchemyCMS/alchemy_cms/pull/2130) ([afdev82](https://github.com/afdev82))
254
+ - Backport #2114 to v5.2 [#2116](https://github.com/AlchemyCMS/alchemy_cms/pull/2116) ([afdev82](https://github.com/afdev82))
255
+ - Add webpacker tasks to Alchemy upgrader [#2115](https://github.com/AlchemyCMS/alchemy_cms/pull/2115) ([dbwinger](https://github.com/dbwinger))
256
+
257
+ ## 5.2.1 (2021-05-13)
258
+
259
+ - Fix alchemy:generate:thumbnails task [#2092](https://github.com/AlchemyCMS/alchemy_cms/pull/2092) ([afdev82](https://github.com/afdev82))
260
+ - Do not attempt to generate thumbs for svg files. [#2090](https://github.com/AlchemyCMS/alchemy_cms/pull/2090) ([oneiros](https://github.com/oneiros))
261
+
262
+ ## 5.2.0 (2021-05-06)
263
+
264
+ - Backport #2049 to 5.2 [#2086](https://github.com/AlchemyCMS/alchemy_cms/pull/2086) ([rickythefox](https://github.com/rickythefox))
265
+ - hotfix and deprecate page_active? helper [#2073](https://github.com/AlchemyCMS/alchemy_cms/pull/2073) ([robinboening](https://github.com/robinboening))
266
+
267
+ ## 5.2.0.rc1 (2021-02-17)
268
+
269
+ ### Changes
270
+
271
+ - Change Factory loading mechanism to FactoryBots supported mechanism [#2030](https://github.com/AlchemyCMS/alchemy_cms/pull/2030) ([mamhoff](https://github.com/mamhoff))
272
+
184
273
  ## 5.2.0.b1 (2021-02-11)
185
274
 
186
275
  ### Features
data/Gemfile CHANGED
@@ -3,8 +3,16 @@ source "https://rubygems.org"
3
3
 
4
4
  gemspec
5
5
 
6
- rails_version = ENV.fetch("RAILS_VERSION", 6.1).to_f
7
- gem "rails", "~> #{rails_version}.0"
6
+ rails_version = ENV.fetch("RAILS_VERSION", 7.0).to_f
7
+ # Necessary until a new 6.1.5 version has been released
8
+ # https://github.com/rails/rails/pull/44691
9
+ if rails_version.to_s.match?(/6.1/)
10
+ gem "rails", git: "https://github.com/rails/rails", branch: "6-1-stable"
11
+ elsif rails_version.to_s.match?(/7.0/)
12
+ gem "rails", git: "https://github.com/rails/rails", branch: "7-0-stable"
13
+ else
14
+ gem "rails", "~> #{rails_version}.0"
15
+ end
8
16
 
9
17
  if ENV["DB"].nil? || ENV["DB"] == "sqlite"
10
18
  gem "sqlite3", "~> 1.4.1"
@@ -40,8 +48,3 @@ group :development, :test do
40
48
  gem "brakeman", require: false
41
49
  end
42
50
  end
43
-
44
- # Necessary for system tests in Rails 6.0
45
- if ENV["RAILS_VERSION"] == "6.0"
46
- gem "selenium-webdriver"
47
- end
data/Rakefile CHANGED
@@ -41,12 +41,16 @@ namespace :alchemy do
41
41
  task :prepare do
42
42
  system(
43
43
  <<~BASH
44
+ yarn install && \
45
+ yarn link && \
44
46
  cd spec/dummy && \
45
47
  export RAILS_ENV=test && \
46
48
  bin/rake db:create && \
47
49
  bin/rake db:environment:set && \
48
50
  bin/rake db:migrate:reset && \
49
- bin/rails g alchemy:install --skip --skip-demo-files --auto-accept && \
51
+ bin/rails g alchemy:install --skip --skip-demo-files --auto-accept --skip-db-create && \
52
+ yarn link @alchemy_cms/admin && \
53
+ RAILS_ENV=test bin/webpack && \
50
54
  cd -
51
55
  BASH
52
56
  ) || fail
data/alchemy_cms.gemspec CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |gem|
29
29
  activesupport
30
30
  railties
31
31
  ].each do |rails_gem|
32
- gem.add_runtime_dependency rails_gem, [">= 6.0", "< 6.2"]
32
+ gem.add_runtime_dependency rails_gem, [">= 6.0", "< 7.1"]
33
33
  end
34
34
 
35
35
  gem.add_runtime_dependency "active_model_serializers", ["~> 0.10.0"]
@@ -46,7 +46,7 @@ Gem::Specification.new do |gem|
46
46
  gem.add_runtime_dependency "kaminari", ["~> 1.1"]
47
47
  gem.add_runtime_dependency "originator", ["~> 3.1"]
48
48
  gem.add_runtime_dependency "non-stupid-digest-assets", ["~> 1.0.8"]
49
- gem.add_runtime_dependency "ransack", [">= 1.8", "<= 2.5.0"] # 2.4.2 dropped Ruby 2.5 support in a patch level release
49
+ gem.add_runtime_dependency "ransack", [">= 1.8", "< 4.0"]
50
50
  gem.add_runtime_dependency "request_store", ["~> 1.2"]
51
51
  gem.add_runtime_dependency "responders", [">= 2.0", "< 4.0"]
52
52
  gem.add_runtime_dependency "sassc-rails", ["~> 2.1"]
@@ -57,13 +57,13 @@ Gem::Specification.new do |gem|
57
57
 
58
58
  gem.add_development_dependency "capybara", ["~> 3.0"]
59
59
  gem.add_development_dependency "capybara-screenshot", ["~> 1.0"]
60
- gem.add_development_dependency "cuprite", ["~> 0.13"]
61
60
  gem.add_development_dependency "factory_bot_rails", ["~> 6.0"]
62
61
  gem.add_development_dependency "puma", ["~> 5.0"]
63
62
  gem.add_development_dependency "rails-controller-testing", ["~> 1.0"]
64
63
  gem.add_development_dependency "rspec-activemodel-mocks", ["~> 1.0"]
65
64
  gem.add_development_dependency "rspec-rails", [">= 4.0.0.beta2"]
66
65
  gem.add_development_dependency "simplecov", ["~> 0.20"]
66
+ gem.add_development_dependency "webdrivers", ["~> 5.0"]
67
67
  gem.add_development_dependency "webmock", ["~> 3.3"]
68
68
  gem.add_development_dependency "shoulda-matchers", ["~> 5.0"]
69
69
  gem.add_development_dependency "timecop", ["~> 0.9"]
@@ -35,10 +35,8 @@
35
35
  //= require alchemy/alchemy.link_dialog
36
36
  //= require alchemy/alchemy.list_filter
37
37
  //= require alchemy/alchemy.initializer
38
- //= require alchemy/alchemy.page_sorter
39
38
  //= require alchemy/alchemy.uploader
40
39
  //= require alchemy/alchemy.preview_window
41
- //= require alchemy/alchemy.sitemap
42
40
  //= require alchemy/alchemy.spinner
43
41
  //= require alchemy/alchemy.tinymce
44
42
  //= require alchemy/alchemy.tooltips
@@ -82,7 +82,12 @@ class window.Alchemy.Dialog
82
82
  @dialog_body.hide()
83
83
  @dialog_body.html(data)
84
84
  @init()
85
- @dialog.trigger('DialogReady.Alchemy', @dialog_body)
85
+ @dialog[0].dispatchEvent(new CustomEvent(
86
+ "DialogReady.Alchemy",
87
+ bubbles: true
88
+ detail:
89
+ body: @dialog_body[0]
90
+ ))
86
91
  if @options.ready?
87
92
  @options.ready(@dialog_body)
88
93
  @dialog_body.show('fade', 200)
@@ -87,6 +87,8 @@ class window.Alchemy.LinkDialog extends Alchemy.Dialog
87
87
  name: page.name
88
88
  url_path: page.url_path
89
89
  page_id: page.id
90
+ language: page.language
91
+ site: page.site
90
92
  more: meta.page * meta.per_page < meta.total_count
91
93
  initSelection: ($element, callback) =>
92
94
  urlname = $element.val()
@@ -1,9 +1,11 @@
1
- $.fn.alchemyPageSelect = function(options) {
1
+ $.fn.alchemyPageSelect = function (options) {
2
2
  var pageTemplate = HandlebarsTemplates.page
3
3
 
4
4
  return this.select2({
5
5
  placeholder: options.placeholder,
6
- allowClear: true,
6
+ allowClear: options.hasOwnProperty("allowClear")
7
+ ? options.allowClear
8
+ : true,
7
9
  minimumInputLength: 3,
8
10
  initSelection: function (_$el, callback) {
9
11
  if (options.initialSelection) {
@@ -12,13 +14,16 @@ $.fn.alchemyPageSelect = function(options) {
12
14
  },
13
15
  ajax: {
14
16
  url: options.url,
15
- datatype: 'json',
17
+ datatype: "json",
16
18
  quietMillis: 300,
17
19
  data: function (term, page) {
18
20
  return {
19
- q: $.extend({
20
- name_cont: term
21
- }, options.query_params),
21
+ q: $.extend(
22
+ {
23
+ name_cont: term
24
+ },
25
+ options.query_params
26
+ ),
22
27
  page: page
23
28
  }
24
29
  },
@@ -34,8 +39,8 @@ $.fn.alchemyPageSelect = function(options) {
34
39
  formatSelection: function (page) {
35
40
  return page.text || page.name
36
41
  },
37
- formatResult: function(page) {
38
- return pageTemplate({page: page})
42
+ formatResult: function (page) {
43
+ return pageTemplate({ page: page })
39
44
  }
40
45
  })
41
46
  }
@@ -2,3 +2,4 @@
2
2
  //= require alchemy/templates/page
3
3
  //= require alchemy/templates/node_folder
4
4
  //= require alchemy/templates/node
5
+ //= require alchemy/templates/page_folder
@@ -1,9 +1,19 @@
1
1
  <div class="page-select--page">
2
- <i class="icon far fa-file fa-lg"></i>
3
- <span class="page-select--page-name">
4
- {{ page.name }}
5
- </span>
6
- <span class="page-select--page-urlname">
7
- {{ page.url_path }}
8
- </span>
2
+ <div class="page-select--top">
3
+ <i class="icon far fa-file fa-lg"></i>
4
+ <span class="page-select--page-name">
5
+ {{ page.name }}
6
+ </span>
7
+ <span class="page-select--page-urlname">
8
+ {{ page.url_path }}
9
+ </span>
10
+ </div>
11
+ <div class="page-select--bottom">
12
+ <span class="page-select--site-name">
13
+ {{ page.site.name }}
14
+ </span>
15
+ <span class="page-select--language-code">
16
+ {{ page.language.name }}
17
+ </span>
18
+ </div>
9
19
  </div>
@@ -0,0 +1,3 @@
1
+ <a class="page_folder" data-page-id="{{ page.id }}">
2
+ <i class="far fa-{{#if page.folded }}plus{{else}}minus{{/if}}-square fa-fw"></i>
3
+ </a>
@@ -48,6 +48,10 @@ div#image_assign_filter_and_image_sizing {
48
48
  background-color: $thumbnail-background-color;
49
49
  width: 100%;
50
50
  height: 120px;
51
+
52
+ &:hover {
53
+ text-decoration: none;
54
+ }
51
55
  }
52
56
 
53
57
  .picture_thumbnail {
@@ -61,6 +65,11 @@ div#image_assign_filter_and_image_sizing {
61
65
  width: 100%;
62
66
  height: 100%;
63
67
  object-fit: contain;
68
+
69
+ &[src$=".svg"] {
70
+ width: auto;
71
+ height: auto;
72
+ }
64
73
  }
65
74
 
66
75
  .picture_name {
@@ -545,6 +545,10 @@
545
545
  font-size: 4em;
546
546
  color: $medium-gray;
547
547
  vertical-align: top;
548
+
549
+ &.error {
550
+ font-size: 1.2em;
551
+ }
548
552
  }
549
553
 
550
554
  .essence_picture_css_class {
@@ -8,24 +8,49 @@
8
8
 
9
9
  .page-select--page {
10
10
  display: flex;
11
- align-items: center;
11
+ flex-direction: column;
12
12
 
13
13
  .icon {
14
14
  margin: 0 8px 0 4px;
15
15
 
16
16
  .select2-highlighted & {
17
- color: $white
17
+ color: $white;
18
18
  }
19
19
  }
20
20
  }
21
21
 
22
+ .page-select--top,
23
+ .page-select--bottom {
24
+ display: flex;
25
+ flex-direction: row;
26
+ align-items: center;
27
+ }
28
+
29
+ .page-select--bottom {
30
+ font-size: $small-font-size;
31
+ padding-left: 6 * $default-padding;
32
+ }
33
+
34
+ .page-select--language-code {
35
+ display: inline-block;
36
+ background-color: $medium-gray;
37
+ margin-left: auto;
38
+ border-radius: $default-border-radius;
39
+ padding: $default-padding / 2 $default-padding;
40
+
41
+ .select2-highlighted & {
42
+ color: $select-hover-bg-color;
43
+ background-color: white;
44
+ }
45
+ }
46
+
22
47
  .page-select--page-urlname {
23
48
  margin-left: auto;
24
- padding: $default-padding 2*$default-padding;
49
+ padding: $default-padding 2 * $default-padding;
25
50
  color: $dark-gray;
26
51
  font-size: $small-font-size;
27
52
 
28
53
  .select2-highlighted & {
29
- color: $white
54
+ color: $white;
30
55
  }
31
56
  }
@@ -23,7 +23,7 @@ $sitemap-url-xlarge-width: 350px;
23
23
 
24
24
  #sitemap-wrapper {
25
25
  position: relative;
26
- min-height: calc(100vh - 96px);
26
+ min-height: calc(100vh - 148px);
27
27
  }
28
28
 
29
29
  .sitemap_pagename_link {
@@ -142,18 +142,16 @@ $sitemap-url-xlarge-width: 350px;
142
142
  #sitemap {
143
143
  padding: 0 0 104px 0;
144
144
 
145
- &.sorting {
146
- padding-top: 100px;
147
-
148
- .page_icon {
149
- cursor: move;
150
- }
145
+ .handle {
146
+ cursor: move;
151
147
  }
152
148
 
153
149
  .page_folder {
154
150
  position: absolute;
155
151
  left: -23px;
156
152
  top: 0;
153
+ width: 16px;
154
+ height: $sitemap-line-height;
157
155
  }
158
156
 
159
157
  .placeholder {
@@ -258,3 +256,7 @@ $sitemap-url-xlarge-width: 350px;
258
256
  }
259
257
  }
260
258
  }
259
+
260
+ #search_field_clear {
261
+ cursor: pointer;
262
+ }
@@ -106,18 +106,14 @@ module Alchemy
106
106
  def element_includes
107
107
  [
108
108
  {
109
- contents: {
110
- essence: :ingredient_association,
111
- },
109
+ contents: :essence,
112
110
  ingredients: :related_object,
113
111
  },
114
112
  :tags,
115
113
  {
116
114
  all_nested_elements: [
117
115
  {
118
- contents: {
119
- essence: :ingredient_association,
120
- },
116
+ contents: :essence,
121
117
  ingredients: :related_object,
122
118
  },
123
119
  :tags,
@@ -7,7 +7,7 @@ module Alchemy
7
7
 
8
8
  helper "alchemy/pages"
9
9
 
10
- before_action :load_resource, except: [:index, :flush, :new, :order, :create, :copy_language_tree, :link, :sort]
10
+ before_action :load_resource, except: [:index, :flush, :new, :order, :create, :copy_language_tree, :link]
11
11
 
12
12
  authorize_resource class: Alchemy::Page, except: [:index, :tree]
13
13
 
@@ -21,7 +21,7 @@ module Alchemy
21
21
  except: [:show]
22
22
 
23
23
  before_action :set_root_page,
24
- only: [:index, :show, :sort, :order]
24
+ only: [:index, :show, :order]
25
25
 
26
26
  before_action :run_on_page_layout_callbacks,
27
27
  if: :run_on_page_layout_callbacks?,
@@ -123,8 +123,7 @@ module Alchemy
123
123
  # * fetches page via before filter
124
124
  #
125
125
  def update
126
- # stores old page_layout value, because unfurtunally rails @page.changes does not work here.
127
- @old_page_layout = @page.page_layout
126
+ @old_parent_id = @page.parent_id
128
127
  if @page.update(page_params)
129
128
  @notice = Alchemy.t("Page saved", name: @page.name)
130
129
  @while_page_edit = request.referer.include?("edit")
@@ -133,7 +132,7 @@ module Alchemy
133
132
  @tree = serialized_page_tree
134
133
  end
135
134
  else
136
- configure
135
+ render :configure
137
136
  end
138
137
  end
139
138
 
@@ -169,9 +168,7 @@ module Alchemy
169
168
  def fold
170
169
  # @page is fetched via before filter
171
170
  @page.fold!(current_alchemy_user.id, !@page.folded?(current_alchemy_user.id))
172
- respond_to do |format|
173
- format.js
174
- end
171
+ render json: serialized_page_tree
175
172
  end
176
173
 
177
174
  # Leaves the page editing mode and unlocks the page for other users
@@ -182,9 +179,12 @@ module Alchemy
182
179
  @pages_locked_by_user = Page.from_current_site.locked_by(current_alchemy_user)
183
180
  respond_to do |format|
184
181
  format.js
185
- format.html {
186
- redirect_to params[:redirect_to].blank? ? admin_pages_path : params[:redirect_to]
187
- }
182
+ format.html do
183
+ redirect_to(
184
+ params[:redirect_to].presence || admin_pages_path,
185
+ allow_other_host: true,
186
+ )
187
+ end
188
188
  end
189
189
  end
190
190
 
@@ -204,10 +204,6 @@ module Alchemy
204
204
  redirect_to admin_pages_path
205
205
  end
206
206
 
207
- def sort
208
- @sorting = true
209
- end
210
-
211
207
  # Receives a JSON object representing a language tree to be ordered
212
208
  # and updates all pages in that language structure to their correct indexes
213
209
  def order
@@ -389,9 +385,11 @@ module Alchemy
389
385
  end
390
386
 
391
387
  def serialized_page_tree
392
- PageTreeSerializer.new(@page, ability: current_ability,
393
- user: current_alchemy_user,
394
- full: params[:full] == "true")
388
+ PageTreeSerializer.new(
389
+ @page,
390
+ ability: current_ability,
391
+ user: current_alchemy_user,
392
+ )
395
393
  end
396
394
 
397
395
  def load_languages_and_layouts