alchemy_cms 5.3.5 → 5.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/app/models/alchemy/page.rb +6 -0
- data/lib/alchemy/hints.rb +7 -3
- data/lib/alchemy/page_layout.rb +6 -2
- data/lib/alchemy/version.rb +1 -1
- data/package.json +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ec248084ae4d408eeaaf43ec2aec3779451938672a48c086dcd358005cf31606
|
|
4
|
+
data.tar.gz: 388f282fecad595e37767e8af898967c9e5fb08d274f9b07e6aa6487436bdb56
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: af624870c78c567a063610b1dd15bd81cc33e760856abe4d18b4459d43cad582d559d5b83bcdd29a5e55a19cf978fe93113307eb816bc3c746961b20aa1a22e1
|
|
7
|
+
data.tar.gz: ae840910731a7e361cbb95b8947e00f2e6fb9f45166a0010ef37421dfc8cc2d71fc031fbdfc3a2ef5dc5473d03bb6a735b1f985bdeb27ec3d03cad3e8d58ddea
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## 5.3.6 (2022-06-04)
|
|
2
|
+
|
|
3
|
+
- 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))
|
|
4
|
+
|
|
1
5
|
## 5.3.5 (2022-04-26)
|
|
2
6
|
|
|
3
7
|
- Add thumbnail processor to support resizing on animated GIFs [#2316](https://github.com/AlchemyCMS/alchemy_cms/pull/2316) ([kulturbande](https://github.com/kulturbande))
|
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
|
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/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.6
|
|
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-04
|
|
16
|
+
date: 2022-06-04 00:00:00.000000000 Z
|
|
17
17
|
dependencies:
|
|
18
18
|
- !ruby/object:Gem::Dependency
|
|
19
19
|
name: active_model_serializers
|