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.
Files changed (97) 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 +50 -36
  7. data/CONTRIBUTING.md +2 -2
  8. data/Gemfile +2 -2
  9. data/README.md +2 -2
  10. data/alchemy_cms.gemspec +4 -4
  11. data/app/assets/images/alchemy/missing-image.svg +1 -0
  12. data/app/assets/stylesheets/alchemy/_variables.scss +1 -0
  13. data/app/assets/stylesheets/alchemy/archive.scss +23 -17
  14. data/app/assets/stylesheets/alchemy/errors.scss +1 -1
  15. data/app/assets/stylesheets/alchemy/navigation.scss +7 -10
  16. data/app/assets/stylesheets/alchemy/pagination.scss +1 -1
  17. data/app/assets/stylesheets/alchemy/search.scss +12 -2
  18. data/app/assets/stylesheets/alchemy/tags.scss +19 -31
  19. data/app/assets/stylesheets/tinymce/skins/alchemy/content.min.css.scss +3 -3
  20. data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +7 -7
  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 -44
  25. data/app/helpers/alchemy/admin/navigation_helper.rb +2 -1
  26. data/app/helpers/alchemy/pages_helper.rb +1 -1
  27. data/app/models/alchemy/attachment/url.rb +40 -0
  28. data/app/models/alchemy/attachment.rb +21 -4
  29. data/app/models/alchemy/element.rb +1 -1
  30. data/app/models/alchemy/essence_picture.rb +3 -3
  31. data/app/models/alchemy/essence_picture_view.rb +5 -3
  32. data/app/models/alchemy/node.rb +1 -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/page.rb +17 -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 -77
  39. data/app/models/alchemy/picture.rb +59 -3
  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_thumb.rb +57 -0
  44. data/app/models/alchemy/picture_variant.rb +114 -0
  45. data/app/serializers/alchemy/page_tree_serializer.rb +4 -4
  46. data/app/views/alchemy/admin/attachments/show.html.erb +8 -8
  47. data/app/views/alchemy/admin/dashboard/index.html.erb +13 -16
  48. data/app/views/alchemy/admin/elements/_element_toolbar.html.erb +1 -1
  49. data/app/views/alchemy/admin/essence_pictures/crop.html.erb +1 -1
  50. data/app/views/alchemy/admin/essence_pictures/edit.html.erb +2 -2
  51. data/app/views/alchemy/admin/layoutpages/edit.html.erb +4 -6
  52. data/app/views/alchemy/admin/pages/_form.html.erb +4 -6
  53. data/app/views/alchemy/admin/pages/_new_page_form.html.erb +2 -1
  54. data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +14 -13
  55. data/app/views/alchemy/admin/partials/_search_form.html.erb +8 -8
  56. data/app/views/alchemy/admin/pictures/_archive.html.erb +1 -1
  57. data/app/views/alchemy/admin/pictures/_form.html.erb +1 -1
  58. data/app/views/alchemy/admin/pictures/_picture.html.erb +3 -3
  59. data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +1 -1
  60. data/app/views/alchemy/admin/pictures/edit_multiple.html.erb +1 -1
  61. data/app/views/alchemy/admin/pictures/index.html.erb +1 -1
  62. data/app/views/alchemy/admin/pictures/show.html.erb +3 -3
  63. data/app/views/alchemy/admin/resources/_per_page_select.html.erb +3 -3
  64. data/app/views/alchemy/admin/resources/index.html.erb +4 -1
  65. data/app/views/alchemy/admin/tags/index.html.erb +14 -15
  66. data/app/views/alchemy/base/500.html.erb +11 -13
  67. data/app/views/alchemy/essences/_essence_file_view.html.erb +3 -3
  68. data/app/views/alchemy/essences/_essence_picture_view.html.erb +3 -3
  69. data/config/alchemy/config.yml +15 -11
  70. data/config/alchemy/modules.yml +12 -12
  71. data/config/routes.rb +1 -1
  72. data/db/migrate/20200617110713_create_alchemy_picture_thumbs.rb +22 -0
  73. data/db/migrate/20200907111332_remove_tri_state_booleans.rb +33 -0
  74. data/lib/alchemy/auth_accessors.rb +12 -5
  75. data/lib/alchemy/config.rb +1 -3
  76. data/lib/alchemy/engine.rb +7 -2
  77. data/lib/alchemy/modules.rb +11 -1
  78. data/lib/alchemy/resource.rb +3 -5
  79. data/lib/alchemy/test_support/factories/picture_factory.rb +0 -1
  80. data/lib/alchemy/test_support/factories/picture_thumb_factory.rb +12 -0
  81. data/lib/alchemy/upgrader/five_point_zero.rb +0 -32
  82. data/lib/alchemy/version.rb +1 -1
  83. data/lib/generators/alchemy/install/files/alchemy.en.yml +2 -2
  84. data/lib/generators/alchemy/install/install_generator.rb +1 -2
  85. data/lib/generators/alchemy/install/templates/dragonfly.rb.tt +5 -5
  86. data/lib/tasks/alchemy/thumbnails.rake +37 -0
  87. data/lib/tasks/alchemy/upgrade.rake +0 -20
  88. data/package/admin.js +0 -2
  89. data/package/src/__tests__/i18n.spec.js +0 -23
  90. data/package/src/i18n.js +3 -1
  91. data/package.json +1 -1
  92. metadata +26 -24
  93. data/.github/workflows/ci.yml +0 -126
  94. data/.github/workflows/greetings.yml +0 -13
  95. data/app/controllers/concerns/alchemy/locale_redirects.rb +0 -40
  96. data/app/controllers/concerns/alchemy/page_redirects.rb +0 -68
  97. 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
@@ -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