alchemy_cms 5.0.9 → 5.1.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/PULL_REQUEST_TEMPLATE.md +1 -1
- data/.github/workflows/stale.yml +1 -1
- data/.gitignore +1 -0
- data/.travis.yml +48 -0
- data/CHANGELOG.md +50 -36
- data/CONTRIBUTING.md +2 -2
- data/Gemfile +2 -2
- data/README.md +2 -2
- data/alchemy_cms.gemspec +4 -4
- data/app/assets/images/alchemy/missing-image.svg +1 -0
- data/app/assets/stylesheets/alchemy/_variables.scss +1 -0
- data/app/assets/stylesheets/alchemy/archive.scss +23 -17
- data/app/assets/stylesheets/alchemy/errors.scss +1 -1
- data/app/assets/stylesheets/alchemy/navigation.scss +7 -10
- data/app/assets/stylesheets/alchemy/pagination.scss +1 -1
- data/app/assets/stylesheets/alchemy/search.scss +12 -2
- data/app/assets/stylesheets/alchemy/tags.scss +19 -31
- data/app/assets/stylesheets/tinymce/skins/alchemy/content.min.css.scss +3 -3
- data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +7 -7
- data/app/controllers/alchemy/admin/pictures_controller.rb +13 -6
- data/app/controllers/alchemy/admin/resources_controller.rb +3 -3
- data/app/controllers/alchemy/pages_controller.rb +49 -14
- data/app/helpers/alchemy/admin/base_helper.rb +0 -44
- data/app/helpers/alchemy/admin/navigation_helper.rb +2 -1
- data/app/helpers/alchemy/pages_helper.rb +1 -1
- data/app/models/alchemy/attachment/url.rb +40 -0
- data/app/models/alchemy/attachment.rb +21 -4
- data/app/models/alchemy/element.rb +1 -1
- data/app/models/alchemy/essence_picture.rb +3 -3
- data/app/models/alchemy/essence_picture_view.rb +5 -3
- data/app/models/alchemy/node.rb +1 -1
- data/app/models/alchemy/page/page_natures.rb +2 -0
- data/app/models/alchemy/page/url_path.rb +8 -6
- data/app/models/alchemy/page.rb +17 -2
- data/app/models/alchemy/picture/calculations.rb +55 -0
- data/app/models/alchemy/picture/transformations.rb +5 -49
- data/app/models/alchemy/picture/url.rb +28 -77
- data/app/models/alchemy/picture.rb +59 -3
- data/app/models/alchemy/picture_thumb/create.rb +39 -0
- data/app/models/alchemy/picture_thumb/signature.rb +23 -0
- data/app/models/alchemy/picture_thumb/uid.rb +22 -0
- data/app/models/alchemy/picture_thumb.rb +57 -0
- data/app/models/alchemy/picture_variant.rb +114 -0
- data/app/serializers/alchemy/page_tree_serializer.rb +4 -4
- data/app/views/alchemy/admin/attachments/show.html.erb +8 -8
- data/app/views/alchemy/admin/dashboard/index.html.erb +13 -16
- data/app/views/alchemy/admin/elements/_element_toolbar.html.erb +1 -1
- data/app/views/alchemy/admin/essence_pictures/crop.html.erb +1 -1
- data/app/views/alchemy/admin/essence_pictures/edit.html.erb +2 -2
- data/app/views/alchemy/admin/layoutpages/edit.html.erb +4 -6
- data/app/views/alchemy/admin/pages/_form.html.erb +4 -6
- data/app/views/alchemy/admin/pages/_new_page_form.html.erb +2 -1
- data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +14 -13
- data/app/views/alchemy/admin/partials/_search_form.html.erb +8 -8
- data/app/views/alchemy/admin/pictures/_archive.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_form.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_picture.html.erb +3 -3
- data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/edit_multiple.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/index.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/show.html.erb +3 -3
- data/app/views/alchemy/admin/resources/_per_page_select.html.erb +3 -3
- data/app/views/alchemy/admin/resources/index.html.erb +4 -1
- data/app/views/alchemy/admin/tags/index.html.erb +14 -15
- data/app/views/alchemy/base/500.html.erb +11 -13
- data/app/views/alchemy/essences/_essence_file_view.html.erb +3 -3
- data/app/views/alchemy/essences/_essence_picture_view.html.erb +3 -3
- data/config/alchemy/config.yml +15 -11
- data/config/alchemy/modules.yml +12 -12
- data/config/routes.rb +1 -1
- data/db/migrate/20200617110713_create_alchemy_picture_thumbs.rb +22 -0
- data/db/migrate/20200907111332_remove_tri_state_booleans.rb +33 -0
- data/lib/alchemy/auth_accessors.rb +12 -5
- data/lib/alchemy/config.rb +1 -3
- data/lib/alchemy/engine.rb +7 -2
- data/lib/alchemy/modules.rb +11 -1
- data/lib/alchemy/resource.rb +3 -5
- data/lib/alchemy/test_support/factories/picture_factory.rb +0 -1
- data/lib/alchemy/test_support/factories/picture_thumb_factory.rb +12 -0
- data/lib/alchemy/upgrader/five_point_zero.rb +0 -32
- data/lib/alchemy/version.rb +1 -1
- data/lib/generators/alchemy/install/files/alchemy.en.yml +2 -2
- data/lib/generators/alchemy/install/install_generator.rb +1 -2
- data/lib/generators/alchemy/install/templates/dragonfly.rb.tt +5 -5
- data/lib/tasks/alchemy/thumbnails.rake +37 -0
- data/lib/tasks/alchemy/upgrade.rake +0 -20
- data/package/admin.js +0 -2
- data/package/src/__tests__/i18n.spec.js +0 -23
- data/package/src/i18n.js +3 -1
- data/package.json +1 -1
- metadata +26 -24
- data/.github/workflows/ci.yml +0 -126
- data/.github/workflows/greetings.yml +0 -13
- data/app/controllers/concerns/alchemy/locale_redirects.rb +0 -40
- data/app/controllers/concerns/alchemy/page_redirects.rb +0 -68
- data/lib/alchemy/userstamp.rb +0 -12
@@ -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
|
data/lib/alchemy/userstamp.rb
DELETED
@@ -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
|