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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a2374c679c6d6962c9bb32d48f8f444def421fb927302b87f705a85e9e21d85
4
- data.tar.gz: d3a682ccdf288d777e87f145b15121fa51d4008d3992ba39abb16e417e2ca1bb
3
+ metadata.gz: ec248084ae4d408eeaaf43ec2aec3779451938672a48c086dcd358005cf31606
4
+ data.tar.gz: 388f282fecad595e37767e8af898967c9e5fb08d274f9b07e6aa6487436bdb56
5
5
  SHA512:
6
- metadata.gz: 1d40a29752e354e66b2186290cb229a2d0b89b77b258258c5488f4b8e6f56ffc7714bd6824e89e05a9075c53a3294c75eb5ebe70148c12d0b3fae84781f70a33
7
- data.tar.gz: 1ddecd199116f699e351384bb460c39bb3203a71fa41a3d6e3319b8ad8107500049f1e37894f9a14f3e955930ae98e2dcc2d1458fff128dac2178b9d94cbeabc
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))
@@ -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(name, scope: hint_translation_scope)
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.present?
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
@@ -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
- YAML.safe_load(ERB.new(File.read(layouts_file_path)).result, YAML_WHITELIST_CLASSES, [], true) || []
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
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "5.3.5"
4
+ VERSION = "5.3.6"
5
5
 
6
6
  def self.version
7
7
  VERSION
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alchemy_cms/admin",
3
- "version": "5.3.4",
3
+ "version": "5.3.6",
4
4
  "description": "AlchemyCMS",
5
5
  "browser": "package/admin.js",
6
6
  "files": [
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.5
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-26 00:00:00.000000000 Z
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