alchemy_cms 5.0.0.beta2 → 5.1.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/.github/PULL_REQUEST_TEMPLATE.md +1 -1
  3. data/.github/workflows/stale.yml +1 -1
  4. data/.gitignore +1 -0
  5. data/.travis.yml +48 -0
  6. data/CHANGELOG.md +63 -2
  7. data/CONTRIBUTING.md +2 -2
  8. data/Gemfile +3 -3
  9. data/README.md +4 -4
  10. data/Rakefile +11 -10
  11. data/alchemy_cms.gemspec +2 -2
  12. data/app/assets/images/alchemy/missing-image.svg +1 -0
  13. data/app/assets/stylesheets/alchemy/_variables.scss +1 -0
  14. data/app/assets/stylesheets/alchemy/archive.scss +23 -17
  15. data/app/assets/stylesheets/alchemy/errors.scss +1 -1
  16. data/app/assets/stylesheets/alchemy/navigation.scss +7 -9
  17. data/app/assets/stylesheets/alchemy/pagination.scss +1 -1
  18. data/app/assets/stylesheets/alchemy/search.scss +12 -2
  19. data/app/assets/stylesheets/alchemy/tags.scss +19 -31
  20. data/app/controllers/alchemy/admin/pages_controller.rb +1 -1
  21. data/app/controllers/alchemy/admin/pictures_controller.rb +13 -6
  22. data/app/controllers/alchemy/admin/resources_controller.rb +3 -3
  23. data/app/controllers/alchemy/pages_controller.rb +49 -14
  24. data/app/helpers/alchemy/admin/base_helper.rb +0 -42
  25. data/app/helpers/alchemy/admin/navigation_helper.rb +2 -1
  26. data/app/helpers/alchemy/url_helper.rb +2 -2
  27. data/app/models/alchemy/attachment.rb +21 -1
  28. data/app/models/alchemy/attachment/url.rb +40 -0
  29. data/app/models/alchemy/essence_file.rb +1 -1
  30. data/app/models/alchemy/essence_picture.rb +4 -4
  31. data/app/models/alchemy/essence_picture_view.rb +10 -4
  32. data/app/models/alchemy/page.rb +16 -1
  33. data/app/models/alchemy/page/page_natures.rb +2 -0
  34. data/app/models/alchemy/page/url_path.rb +8 -6
  35. data/app/models/alchemy/picture.rb +58 -2
  36. data/app/models/alchemy/picture/calculations.rb +55 -0
  37. data/app/models/alchemy/picture/transformations.rb +5 -49
  38. data/app/models/alchemy/picture/url.rb +28 -75
  39. data/app/models/alchemy/picture_thumb.rb +57 -0
  40. data/app/models/alchemy/picture_thumb/create.rb +39 -0
  41. data/app/models/alchemy/picture_thumb/signature.rb +23 -0
  42. data/app/models/alchemy/picture_thumb/uid.rb +22 -0
  43. data/app/models/alchemy/picture_variant.rb +114 -0
  44. data/app/views/alchemy/admin/attachments/show.html.erb +8 -8
  45. data/app/views/alchemy/admin/dashboard/index.html.erb +13 -16
  46. data/app/views/alchemy/admin/essence_pictures/crop.html.erb +1 -1
  47. data/app/views/alchemy/admin/essence_pictures/edit.html.erb +2 -2
  48. data/app/views/alchemy/admin/layoutpages/edit.html.erb +4 -6
  49. data/app/views/alchemy/admin/pages/_form.html.erb +4 -6
  50. data/app/views/alchemy/admin/pages/_new_page_form.html.erb +2 -1
  51. data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +14 -13
  52. data/app/views/alchemy/admin/partials/_search_form.html.erb +8 -8
  53. data/app/views/alchemy/admin/pictures/_archive.html.erb +1 -1
  54. data/app/views/alchemy/admin/pictures/_form.html.erb +1 -1
  55. data/app/views/alchemy/admin/pictures/_picture.html.erb +3 -3
  56. data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +1 -1
  57. data/app/views/alchemy/admin/pictures/edit_multiple.html.erb +1 -1
  58. data/app/views/alchemy/admin/pictures/index.html.erb +1 -1
  59. data/app/views/alchemy/admin/pictures/show.html.erb +3 -3
  60. data/app/views/alchemy/admin/resources/_per_page_select.html.erb +3 -3
  61. data/app/views/alchemy/admin/resources/index.html.erb +24 -22
  62. data/app/views/alchemy/admin/sites/_form.html.erb +2 -2
  63. data/app/views/alchemy/admin/tags/index.html.erb +14 -15
  64. data/app/views/alchemy/base/500.html.erb +11 -13
  65. data/app/views/alchemy/essences/_essence_file_view.html.erb +4 -4
  66. data/config/alchemy/config.yml +15 -11
  67. data/config/alchemy/modules.yml +12 -12
  68. data/config/routes.rb +1 -1
  69. data/db/migrate/20200617110713_create_alchemy_picture_thumbs.rb +22 -0
  70. data/db/migrate/20200907111332_remove_tri_state_booleans.rb +33 -0
  71. data/lib/alchemy/auth_accessors.rb +12 -5
  72. data/lib/alchemy/config.rb +2 -2
  73. data/lib/alchemy/deprecation.rb +1 -1
  74. data/lib/alchemy/engine.rb +7 -2
  75. data/lib/alchemy/install/tasks.rb +41 -0
  76. data/lib/alchemy/modules.rb +11 -1
  77. data/lib/alchemy/resource.rb +2 -2
  78. data/lib/alchemy/test_support/factories/picture_factory.rb +0 -1
  79. data/lib/alchemy/test_support/factories/picture_thumb_factory.rb +12 -0
  80. data/lib/alchemy/version.rb +1 -1
  81. data/lib/generators/alchemy/install/files/alchemy.en.yml +2 -2
  82. data/lib/generators/alchemy/install/install_generator.rb +60 -1
  83. data/lib/generators/alchemy/install/templates/dragonfly.rb.tt +5 -5
  84. data/lib/tasks/alchemy/install.rake +5 -49
  85. data/lib/tasks/alchemy/thumbnails.rake +37 -0
  86. metadata +24 -15
  87. data/.github/workflows/ci.yml +0 -134
  88. data/.github/workflows/greetings.yml +0 -13
  89. data/app/controllers/concerns/alchemy/locale_redirects.rb +0 -40
  90. data/app/controllers/concerns/alchemy/page_redirects.rb +0 -68
  91. data/lib/alchemy/userstamp.rb +0 -12
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: 5.0.0.beta2
4
+ version: 5.1.0.beta1
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: 2020-06-25 00:00:00.000000000 Z
16
+ date: 2020-10-30 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: active_model_serializers
@@ -87,22 +87,22 @@ dependencies:
87
87
  name: coffee-rails
88
88
  requirement: !ruby/object:Gem::Requirement
89
89
  requirements:
90
- - - "~>"
90
+ - - ">="
91
91
  - !ruby/object:Gem::Version
92
92
  version: '4.0'
93
93
  - - "<"
94
94
  - !ruby/object:Gem::Version
95
- version: '5.0'
95
+ version: '6.0'
96
96
  type: :runtime
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - "~>"
100
+ - - ">="
101
101
  - !ruby/object:Gem::Version
102
102
  version: '4.0'
103
103
  - - "<"
104
104
  - !ruby/object:Gem::Version
105
- version: '5.0'
105
+ version: '6.0'
106
106
  - !ruby/object:Gem::Dependency
107
107
  name: dragonfly
108
108
  requirement: !ruby/object:Gem::Requirement
@@ -477,14 +477,14 @@ dependencies:
477
477
  requirements:
478
478
  - - "~>"
479
479
  - !ruby/object:Gem::Version
480
- version: '4.0'
480
+ version: '5.0'
481
481
  type: :development
482
482
  prerelease: false
483
483
  version_requirements: !ruby/object:Gem::Requirement
484
484
  requirements:
485
485
  - - "~>"
486
486
  - !ruby/object:Gem::Version
487
- version: '4.0'
487
+ version: '5.0'
488
488
  - !ruby/object:Gem::Dependency
489
489
  name: rails-controller-testing
490
490
  requirement: !ruby/object:Gem::Requirement
@@ -596,14 +596,13 @@ files:
596
596
  - ".github/ISSUE_TEMPLATE/Bug_report.md"
597
597
  - ".github/ISSUE_TEMPLATE/Feature_request.md"
598
598
  - ".github/PULL_REQUEST_TEMPLATE.md"
599
- - ".github/workflows/ci.yml"
600
- - ".github/workflows/greetings.yml"
601
599
  - ".github/workflows/stale.yml"
602
600
  - ".gitignore"
603
601
  - ".hound.yml"
604
602
  - ".localeapp/config.rb"
605
603
  - ".prettierrc"
606
604
  - ".rubocop.yml"
605
+ - ".travis.yml"
607
606
  - ".yardopts"
608
607
  - CHANGELOG.md
609
608
  - CODE_OF_CONDUCT.md
@@ -620,6 +619,7 @@ files:
620
619
  - app/assets/images/alchemy/icon-white.svg
621
620
  - app/assets/images/alchemy/icon.svg
622
621
  - app/assets/images/alchemy/lupe.cur
622
+ - app/assets/images/alchemy/missing-image.svg
623
623
  - app/assets/javascripts/alchemy/admin.js
624
624
  - app/assets/javascripts/alchemy/alchemy.autocomplete.js.coffee
625
625
  - app/assets/javascripts/alchemy/alchemy.base.js.coffee
@@ -757,8 +757,6 @@ files:
757
757
  - app/controllers/concerns/alchemy/admin/current_language.rb
758
758
  - app/controllers/concerns/alchemy/admin/uploader_responses.rb
759
759
  - app/controllers/concerns/alchemy/legacy_page_redirects.rb
760
- - app/controllers/concerns/alchemy/locale_redirects.rb
761
- - app/controllers/concerns/alchemy/page_redirects.rb
762
760
  - app/controllers/concerns/alchemy/site_redirects.rb
763
761
  - app/decorators/alchemy/content_editor.rb
764
762
  - app/decorators/alchemy/element_editor.rb
@@ -780,6 +778,7 @@ files:
780
778
  - app/mailers/alchemy/base_mailer.rb
781
779
  - app/mailers/alchemy/messages_mailer.rb
782
780
  - app/models/alchemy/attachment.rb
781
+ - app/models/alchemy/attachment/url.rb
783
782
  - app/models/alchemy/base_record.rb
784
783
  - app/models/alchemy/content.rb
785
784
  - app/models/alchemy/content/factory.rb
@@ -815,9 +814,15 @@ files:
815
814
  - app/models/alchemy/page/page_scopes.rb
816
815
  - app/models/alchemy/page/url_path.rb
817
816
  - app/models/alchemy/picture.rb
817
+ - app/models/alchemy/picture/calculations.rb
818
818
  - app/models/alchemy/picture/preprocessor.rb
819
819
  - app/models/alchemy/picture/transformations.rb
820
820
  - app/models/alchemy/picture/url.rb
821
+ - app/models/alchemy/picture_thumb.rb
822
+ - app/models/alchemy/picture_thumb/create.rb
823
+ - app/models/alchemy/picture_thumb/signature.rb
824
+ - app/models/alchemy/picture_thumb/uid.rb
825
+ - app/models/alchemy/picture_variant.rb
821
826
  - app/models/alchemy/site.rb
822
827
  - app/models/alchemy/site/layout.rb
823
828
  - app/models/alchemy/tag.rb
@@ -1070,6 +1075,8 @@ files:
1070
1075
  - db/migrate/20200511113603_add_menu_type_to_alchemy_nodes.rb
1071
1076
  - db/migrate/20200514091507_make_page_layoutpage_null_false.rb
1072
1077
  - db/migrate/20200519073500_remove_visible_from_alchemy_pages.rb
1078
+ - db/migrate/20200617110713_create_alchemy_picture_thumbs.rb
1079
+ - db/migrate/20200907111332_remove_tri_state_booleans.rb
1073
1080
  - lib/alchemy/ability_helper.rb
1074
1081
  - lib/alchemy/admin/locale.rb
1075
1082
  - lib/alchemy/admin/preview_url.rb
@@ -1087,6 +1094,7 @@ files:
1087
1094
  - lib/alchemy/forms/builder.rb
1088
1095
  - lib/alchemy/hints.rb
1089
1096
  - lib/alchemy/i18n.rb
1097
+ - lib/alchemy/install/tasks.rb
1090
1098
  - lib/alchemy/logger.rb
1091
1099
  - lib/alchemy/modules.rb
1092
1100
  - lib/alchemy/name_conversions.rb
@@ -1117,6 +1125,7 @@ files:
1117
1125
  - lib/alchemy/test_support/factories/node_factory.rb
1118
1126
  - lib/alchemy/test_support/factories/page_factory.rb
1119
1127
  - lib/alchemy/test_support/factories/picture_factory.rb
1128
+ - lib/alchemy/test_support/factories/picture_thumb_factory.rb
1120
1129
  - lib/alchemy/test_support/factories/site_factory.rb
1121
1130
  - lib/alchemy/test_support/fixtures/image.png
1122
1131
  - lib/alchemy/test_support/integration_helpers.rb
@@ -1127,7 +1136,6 @@ files:
1127
1136
  - lib/alchemy/upgrader/five_point_zero.rb
1128
1137
  - lib/alchemy/upgrader/tasks/element_views_updater.rb
1129
1138
  - lib/alchemy/upgrader/tasks/harden_gutentag_migrations.rb
1130
- - lib/alchemy/userstamp.rb
1131
1139
  - lib/alchemy/version.rb
1132
1140
  - lib/alchemy_cms.rb
1133
1141
  - lib/generators/alchemy/base.rb
@@ -1174,6 +1182,7 @@ files:
1174
1182
  - lib/kaminari/scoped_pagination_url_helper.rb
1175
1183
  - lib/tasks/alchemy/db.rake
1176
1184
  - lib/tasks/alchemy/install.rake
1185
+ - lib/tasks/alchemy/thumbnails.rake
1177
1186
  - lib/tasks/alchemy/tidy.rake
1178
1187
  - lib/tasks/alchemy/upgrade.rake
1179
1188
  - package.json
@@ -1268,7 +1277,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1268
1277
  requirements:
1269
1278
  - ImageMagick (libmagick), v6.6 or greater.
1270
1279
  rubygems_version: 3.0.3
1271
- signing_key:
1280
+ signing_key:
1272
1281
  specification_version: 4
1273
1282
  summary: A powerful, userfriendly and flexible CMS for Rails
1274
1283
  test_files: []
@@ -1,134 +0,0 @@
1
- name: CI
2
-
3
- on: [push, pull_request]
4
-
5
- jobs:
6
- RSpec:
7
- runs-on: ubuntu-latest
8
- strategy:
9
- fail-fast: false
10
- matrix:
11
- rails:
12
- - '5.2'
13
- - '6.0'
14
- ruby:
15
- - '2.5.x'
16
- - '2.6.x'
17
- database:
18
- - mysql
19
- - postgresql
20
- env:
21
- DB: ${{ matrix.database }}
22
- DB_USER: alchemy_user
23
- DB_PASSWORD: password
24
- DB_HOST: '127.0.0.1'
25
- RAILS_ENV: test
26
- RAILS_VERSION: ${{ matrix.rails }}
27
- services:
28
- postgres:
29
- image: postgres:11
30
- env:
31
- POSTGRES_USER: alchemy_user
32
- POSTGRES_PASSWORD: password
33
- POSTGRES_DB: alchemy_cms_dummy_test
34
- ports: ['5432:5432']
35
- options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
36
- mysql:
37
- image: mysql:latest
38
- ports: ['3306:3306']
39
- env:
40
- MYSQL_USER: alchemy_user
41
- MYSQL_PASSWORD: password
42
- MYSQL_DATABASE: alchemy_cms_dummy_test
43
- MYSQL_ROOT_PASSWORD: password
44
- options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
45
- steps:
46
- - uses: actions/checkout@v1
47
- - name: Set up Ruby
48
- uses: actions/setup-ruby@v1
49
- with:
50
- ruby-version: ${{ matrix.ruby }}
51
- - name: Restore apt cache
52
- id: apt-cache
53
- uses: actions/cache@preview
54
- with:
55
- path: /home/runner/apt/cache
56
- key: ${{ runner.os }}-apt-${{ matrix.database }}
57
- restore-keys: |
58
- ${{ runner.os }}-apt-
59
- - name: Install Postgres headers
60
- if: matrix.database == 'postgresql'
61
- run: |
62
- mkdir -p /home/runner/apt/cache
63
- sudo apt update -qq
64
- sudo apt install -qq --fix-missing libpq-dev -o dir::cache::archives="/home/runner/apt/cache"
65
- sudo chown -R runner /home/runner/apt/cache
66
- - name: Install MySQL headers
67
- if: matrix.database == 'mysql'
68
- run: |
69
- mkdir -p /home/runner/apt/cache
70
- sudo apt update -qq
71
- sudo apt install -qq --fix-missing libmysqlclient-dev -o dir::cache::archives="/home/runner/apt/cache"
72
- sudo chown -R runner /home/runner/apt/cache
73
- - name: Install bundler
74
- run: |
75
- gem install bundler
76
- - name: Restore Ruby Gems cache
77
- id: cache
78
- uses: actions/cache@preview
79
- with:
80
- path: vendor/bundle
81
- key: ${{ runner.os }}-bundle-${{ matrix.ruby }}-${{ matrix.rails }}-${{ matrix.database }}-${{ hashFiles('**/Gemfile') }}
82
- restore-keys: |
83
- ${{ runner.os }}-bundle-
84
- - name: Install bundle
85
- timeout-minutes: 10
86
- run: |
87
- bundle install --jobs 4 --retry 3 --path vendor/bundle
88
- - name: Restore node modules cache
89
- id: yarn-cache
90
- uses: actions/cache@preview
91
- with:
92
- path: spec/dummy/node_modules
93
- key: ${{ runner.os }}-yarn-dummy-${{ hashFiles('./package.json') }}
94
- restore-keys: |
95
- ${{ runner.os }}-yarn-dummy-
96
- - name: Prepare database
97
- run: |
98
- bundle exec rake alchemy:spec:prepare
99
- - name: Run tests & publish code coverage
100
- uses: paambaati/codeclimate-action@v2.5.7
101
- env:
102
- CC_TEST_REPORTER_ID: bca4349e32f97919210ac8a450b04904b90683fcdd57d65a22c0f5065482bc22
103
- with:
104
- coverageCommand: bundle exec rspec
105
- - uses: actions/upload-artifact@master
106
- if: failure()
107
- with:
108
- name: Screenshots
109
- path: spec/dummy/tmp/screenshots
110
- Jest:
111
- runs-on: ubuntu-latest
112
- env:
113
- NODE_ENV: test
114
- steps:
115
- - uses: actions/checkout@v1
116
- - name: Restore node modules cache
117
- uses: actions/cache@preview
118
- with:
119
- path: node_modules
120
- key: ${{ runner.os }}-yarn-${{ hashFiles('./package.json') }}
121
- restore-keys: |
122
- ${{ runner.os }}-yarn-
123
- - name: Install yarn
124
- run: yarn install
125
- - name: Run jest
126
- run: yarn jest
127
- - name: Run jest & publish code coverage
128
- uses: paambaati/codeclimate-action@v2.5.7
129
- env:
130
- CC_TEST_REPORTER_ID: bca4349e32f97919210ac8a450b04904b90683fcdd57d65a22c0f5065482bc22
131
- with:
132
- coverageLocations:
133
- ./coverage/lcov.info:lcov
134
- coverageCommand: yarn jest --collectCoverage --coverageDirectory=coverage
@@ -1,13 +0,0 @@
1
- name: Greetings
2
-
3
- on: [pull_request, issues]
4
-
5
- jobs:
6
- greeting:
7
- runs-on: ubuntu-latest
8
- steps:
9
- - uses: actions/first-interaction@v1
10
- with:
11
- repo-token: ${{ secrets.GITHUB_TOKEN }}
12
- issue-message: 'Hey. Thanks for reporting this issue and welcome to AlchemyCMS. The maintainer have been notified. Please be patient while waiting for an answer. Open Source is done by volunteers, so give them some time to react. Meanwhile please think about sending a PR that fixes this issue. It is way more likely that it will be accepted than this bug fixed for you. Remember OpenSource is done by all of us. Again, thanks for reporting.'
13
- pr-message: 'Hey. Thanks for sending this PR. It is very much appreciated. Please be patient and give the maintainers some time to review your work. Meanwhile make sure that the PR meets our [contributing guidelines](https://github.com/AlchemyCMS/alchemy_cms/blob/master/CONTRIBUTING.md). This mostly means [great commit messages](https://chris.beams.io/posts/git-commit/) and adding tests. Thanks again for your contribution. Your help makes Alchemy better.'
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Alchemy
4
- # Handles locale redirects
5
- #
6
- # If the current URL has a locale prefix, but should not have one it redirects
7
- # to url without locale prefix.
8
- #
9
- # Situations we don't want a locale prefix:
10
- #
11
- # 1. If only one language is published
12
- # 2. If the requested locale is the current default locale
13
- #
14
- module LocaleRedirects
15
- extend ActiveSupport::Concern
16
-
17
- included do
18
- before_action :enforce_no_locale,
19
- if: :locale_prefix_not_allowed?,
20
- only: [:index, :show]
21
- end
22
-
23
- private
24
-
25
- # Redirects to requested action without locale prefixed
26
- def enforce_no_locale
27
- redirect_permanently_to additional_params.merge(locale: nil)
28
- end
29
-
30
- # Is the requested locale allowed?
31
- #
32
- # If Alchemy is not in multi language mode or the requested locale is the default locale,
33
- # then we want to redirect to a non prefixed url.
34
- #
35
- def locale_prefix_not_allowed?
36
- params[:locale].present? && !multi_language? ||
37
- params[:locale].presence == ::I18n.default_locale.to_s
38
- end
39
- end
40
- end
@@ -1,68 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Alchemy
4
- # Handles page redirect urls
5
- #
6
- # Lots of reasons exist to redirect to another URL than the requested one.
7
- # These module holds the logic behind these needs.
8
- #
9
- module PageRedirects
10
- extend ActiveSupport::Concern
11
-
12
- private
13
-
14
- # Returns an URL to redirect the request to.
15
- #
16
- # == Lookup:
17
- #
18
- # 1. If the page is not published and we have a published child,
19
- # we return the url top that page. (Configurable through +redirect_to_public_child+).
20
- # 2. If the page layout of the page found has a controller and action configured,
21
- # we return the url to that route. (Configure controller and action in `page_layouts.yml`).
22
- # 3. If the current page URL has no locale prefixed, but we should have one,
23
- # we return the prefixed URL.
24
- # 4. If no redirection is needed returns nil.
25
- #
26
- # @return String
27
- # @return NilClass
28
- #
29
- def redirect_url
30
- @_redirect_url ||= public_child_redirect_url || locale_prefixed_url || nil
31
- end
32
-
33
- def locale_prefixed_url
34
- return unless locale_prefix_missing?
35
-
36
- page_redirect_url(locale: Language.current.code)
37
- end
38
-
39
- def public_child_redirect_url
40
- return if @page.public?
41
-
42
- if configuration(:redirect_to_public_child)
43
- @page = @page.descendants.published.not_restricted.first
44
- @page ? page_redirect_url : page_not_found!
45
- else
46
- page_not_found!
47
- end
48
- end
49
-
50
- # Page url with or without locale while keeping all additional params
51
- def page_redirect_url(options = {})
52
- options = {
53
- locale: prefix_locale? ? @page.language_code : nil,
54
- urlname: @page.urlname,
55
- }.merge(options)
56
-
57
- alchemy.show_page_path additional_params.merge(options)
58
- end
59
-
60
- def default_locale?
61
- Language.current.code.to_sym == ::I18n.default_locale.to_sym
62
- end
63
-
64
- def locale_prefix_missing?
65
- multi_language? && params[:locale].blank? && !default_locale?
66
- end
67
- end
68
- end
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Adds the model stamper ability to the provided user class
4
- #
5
- # It only adds it, if the user model is a active_record model.
6
- #
7
- if Alchemy.user_class < ActiveRecord::Base
8
- Alchemy.user_class.class_eval do
9
- model_stamper
10
- stampable stamper_class_name: Alchemy.user_class_name
11
- end
12
- end