alchemy_cms 5.3.5 → 5.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +1 -1
- data/app/assets/stylesheets/alchemy/selects.scss +0 -4
- data/app/controllers/alchemy/api/pages_controller.rb +3 -8
- data/app/models/alchemy/page.rb +6 -0
- data/app/views/alchemy/admin/pages/update.js.erb +1 -1
- data/lib/alchemy/hints.rb +7 -3
- data/lib/alchemy/page_layout.rb +6 -2
- data/lib/alchemy/permissions.rb +21 -19
- data/lib/alchemy/version.rb +1 -1
- data/package.json +1 -1
- data/vendor/assets/stylesheets/alchemy_admin/select2.scss +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9df1280121647518564fa377e3d89b039f1661d0a02dc1cdd695c992e99d19e9
|
4
|
+
data.tar.gz: a53fdd7e2eba3ec9c71a19668e30671308ca0f2d021bdb518114163cd0b742cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c6ac637ddf39da330066dca6907715b194298b2f4d07331c33b87615631ac05e41d766a8ce32a4d2ab5764799642a3f90a1e6baad2f78eaca4f861d120372ae
|
7
|
+
data.tar.gz: f669e22a899f8f4f0db6454b987cf9454bf167833f8c5081e9b25d05914b9c18ca2c6f8781a643e1d2934116ac3317fdc31a9372a58b3670fc3bba5463440ad8
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
## 5.3.8 (2022-09-02)
|
2
|
+
|
3
|
+
- Fix author edit_content permissions [#2364](https://github.com/AlchemyCMS/alchemy_cms/pull/2364) ([tvdeyen](https://github.com/tvdeyen))
|
4
|
+
|
5
|
+
## 5.3.7 (2022-06-10)
|
6
|
+
|
7
|
+
- Fix admin page tree links after update [#2348](https://github.com/AlchemyCMS/alchemy_cms/pull/2348) ([tvdeyen](https://github.com/tvdeyen))
|
8
|
+
- Fix initial selection of internal page link select [#2346](https://github.com/AlchemyCMS/alchemy_cms/pull/2346) ([tvdeyen](https://github.com/tvdeyen))
|
9
|
+
|
10
|
+
## 5.3.6 (2022-06-04)
|
11
|
+
|
12
|
+
- Use HashWithIndifferentAccess for Page definition. Key hint translation by page_layout [#2343](https://github.com/AlchemyCMS/alchemy_cms/pull/2343) ([dbwinger](https://github.com/dbwinger))
|
13
|
+
|
1
14
|
## 5.3.5 (2022-04-26)
|
2
15
|
|
3
16
|
- Add thumbnail processor to support resizing on animated GIFs [#2316](https://github.com/AlchemyCMS/alchemy_cms/pull/2316) ([kulturbande](https://github.com/kulturbande))
|
@@ -87,7 +87,7 @@ class window.Alchemy.LinkDialog extends Alchemy.Dialog
|
|
87
87
|
urlname = $element.val()
|
88
88
|
$.get Alchemy.routes.api_pages_path,
|
89
89
|
q:
|
90
|
-
urlname_eq: urlname.replace(/^\/([a-z]{2}(-[A-Z]{2})?\/)
|
90
|
+
urlname_eq: urlname.replace(/^\/([a-z]{2}(-[A-Z]{2})?\/)?(.+?)\/?$/, '$3')
|
91
91
|
page: 1
|
92
92
|
per_page: 1,
|
93
93
|
(data) =>
|
@@ -8,14 +8,9 @@ module Alchemy
|
|
8
8
|
# Returns all pages as json object
|
9
9
|
#
|
10
10
|
def index
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
else
|
15
|
-
language = Alchemy::Language.find_by(id: params[:language_id]) || Alchemy::Language.current
|
16
|
-
@pages = Alchemy::Page.accessible_by(current_ability, :index)
|
17
|
-
@pages = @pages.where(language: language)
|
18
|
-
end
|
11
|
+
language = Alchemy::Language.find_by(id: params[:language_id]) || Alchemy::Language.current
|
12
|
+
@pages = Alchemy::Page.accessible_by(current_ability, :index)
|
13
|
+
@pages = @pages.where(language: language)
|
19
14
|
@pages = @pages.includes(*page_includes)
|
20
15
|
@pages = @pages.ransack(params[:q]).result
|
21
16
|
|
data/app/models/alchemy/page.rb
CHANGED
@@ -523,6 +523,12 @@ module Alchemy
|
|
523
523
|
locker.try(:name) || Alchemy.t("unknown")
|
524
524
|
end
|
525
525
|
|
526
|
+
# Key hint translations by page layout, rather than the default name.
|
527
|
+
#
|
528
|
+
def hint_translation_attribute
|
529
|
+
page_layout
|
530
|
+
end
|
531
|
+
|
526
532
|
# Menus (aka. root nodes) this page is attached to
|
527
533
|
#
|
528
534
|
def menus
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<% else -%>
|
24
24
|
|
25
25
|
if (page) {
|
26
|
-
var page_html = "<%= j render('page', page: @page) %>"
|
26
|
+
var page_html = "<%= j render('page', page: @page) %>".replace(/__ID__/g, "<%= @page.id %>");;
|
27
27
|
var compiler = Handlebars.compile(page_html);
|
28
28
|
var tree = <%== @tree.to_json %>;
|
29
29
|
page.outerHTML = compiler(tree.pages[0]);
|
data/lib/alchemy/hints.rb
CHANGED
@@ -37,19 +37,23 @@ module Alchemy
|
|
37
37
|
def hint
|
38
38
|
hint = definition["hint"]
|
39
39
|
if hint == true
|
40
|
-
Alchemy.t(
|
40
|
+
Alchemy.t(hint_translation_attribute, scope: hint_translation_scope)
|
41
41
|
else
|
42
42
|
hint
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
# Returns true if the element has a hint
|
46
|
+
# Returns true if the element has a hint defined
|
47
47
|
def has_hint?
|
48
|
-
hint
|
48
|
+
!!definition[:hint]
|
49
49
|
end
|
50
50
|
|
51
51
|
private
|
52
52
|
|
53
|
+
def hint_translation_attribute
|
54
|
+
name
|
55
|
+
end
|
56
|
+
|
53
57
|
def hint_translation_scope
|
54
58
|
"#{self.class.model_name.to_s.demodulize.downcase}_hints"
|
55
59
|
end
|
data/lib/alchemy/page_layout.rb
CHANGED
@@ -8,7 +8,7 @@ module Alchemy
|
|
8
8
|
# They are defined in +config/alchemy/page_layout.yml+ file.
|
9
9
|
#
|
10
10
|
def all
|
11
|
-
@definitions ||= read_definitions_file
|
11
|
+
@definitions ||= read_definitions_file.map(&:with_indifferent_access)
|
12
12
|
end
|
13
13
|
|
14
14
|
# Add additional page definitions to collection.
|
@@ -164,7 +164,11 @@ module Alchemy
|
|
164
164
|
#
|
165
165
|
def read_definitions_file
|
166
166
|
if File.exist?(layouts_file_path)
|
167
|
-
|
167
|
+
Array.wrap(
|
168
|
+
YAML.safe_load(
|
169
|
+
ERB.new(File.read(layouts_file_path)).result, YAML_WHITELIST_CLASSES, [], true
|
170
|
+
) || []
|
171
|
+
)
|
168
172
|
else
|
169
173
|
raise LoadError, "Could not find page_layouts.yml file! Please run `rails generate alchemy:install`"
|
170
174
|
end
|
data/lib/alchemy/permissions.rb
CHANGED
@@ -103,24 +103,26 @@ module Alchemy
|
|
103
103
|
]
|
104
104
|
|
105
105
|
# Controller actions
|
106
|
-
can :leave,
|
107
|
-
can [:info, :help],
|
108
|
-
can :manage,
|
109
|
-
can :index,
|
110
|
-
can :edit,
|
111
|
-
can :tree,
|
106
|
+
can :leave, :alchemy_admin
|
107
|
+
can [:info, :help], :alchemy_admin_dashboard
|
108
|
+
can :manage, :alchemy_admin_clipboard
|
109
|
+
can :index, :trash
|
110
|
+
can :edit, :alchemy_admin_layoutpages
|
111
|
+
can :tree, :alchemy_admin_pages
|
112
112
|
|
113
113
|
# Resources
|
114
|
-
can [:read, :download],
|
115
|
-
can :manage,
|
116
|
-
can :manage,
|
117
|
-
can :manage,
|
118
|
-
can :manage,
|
119
|
-
can :manage,
|
120
|
-
can :manage,
|
121
|
-
can :read,
|
114
|
+
can [:read, :download], Alchemy::Attachment
|
115
|
+
can :manage, Alchemy::Content
|
116
|
+
can :manage, Alchemy::Element
|
117
|
+
can :manage, Alchemy::EssenceFile
|
118
|
+
can :manage, Alchemy::EssencePicture
|
119
|
+
can :manage, Alchemy::LegacyPageUrl
|
120
|
+
can :manage, Alchemy::Node
|
121
|
+
can :read, Alchemy::Picture
|
122
122
|
can [:read, :autocomplete], Alchemy::Tag
|
123
|
-
can
|
123
|
+
can :edit_content, Alchemy::Page, Alchemy::Page.all do |page|
|
124
|
+
page.editable_by?(@user)
|
125
|
+
end
|
124
126
|
end
|
125
127
|
end
|
126
128
|
|
@@ -169,7 +171,7 @@ module Alchemy
|
|
169
171
|
can :manage, Alchemy::Picture
|
170
172
|
can :manage, Alchemy::Attachment
|
171
173
|
can :manage, Alchemy::Tag
|
172
|
-
can :index,
|
174
|
+
can :index, Alchemy::Language
|
173
175
|
end
|
174
176
|
end
|
175
177
|
|
@@ -184,14 +186,14 @@ module Alchemy
|
|
184
186
|
alchemy_editor_rules
|
185
187
|
|
186
188
|
# Navigation
|
187
|
-
can :index,
|
189
|
+
can :index, [:alchemy_admin_sites, :alchemy_admin_styleguide]
|
188
190
|
|
189
191
|
# Controller actions
|
190
192
|
can [:info, :update_check], :alchemy_admin_dashboard
|
191
193
|
|
192
194
|
# Resources
|
193
|
-
can :manage,
|
194
|
-
can :manage,
|
195
|
+
can :manage, Alchemy::Language
|
196
|
+
can :manage, Alchemy::Site
|
195
197
|
end
|
196
198
|
end
|
197
199
|
|
data/lib/alchemy/version.rb
CHANGED
data/package.json
CHANGED
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.3.
|
4
|
+
version: 5.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas von Deyen
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2022-
|
16
|
+
date: 2022-09-02 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: active_model_serializers
|
@@ -1278,7 +1278,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1278
1278
|
version: '0'
|
1279
1279
|
requirements:
|
1280
1280
|
- ImageMagick (libmagick), v6.6 or greater.
|
1281
|
-
rubygems_version: 3.
|
1281
|
+
rubygems_version: 3.3.7
|
1282
1282
|
signing_key:
|
1283
1283
|
specification_version: 4
|
1284
1284
|
summary: A powerful, userfriendly and flexible CMS for Rails
|