katalyst-content 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d759a4e97d9609138eba1c1d03ad9a081cc1badb65be59b5b200a23665909e7
4
- data.tar.gz: 848034cbe45b3fb9c0550bd452c5424cccdf5c4a7e4e9b819abaef0bed9b24a3
3
+ metadata.gz: 427d77cb72196829474e950c6e3d184aa6d7215b4c01204d033202bb527e4e98
4
+ data.tar.gz: 7f42967dbc39534e2ed23f4380fb7e2161d4d5f6fbddee6abd03e5be2939b070
5
5
  SHA512:
6
- metadata.gz: 64f111753041dd647e73d863e011b23c3507cb930dcac40dd55f991d422802896cc6d515e998adf31be3a07962a38ac8b22e16490b3a56fcb3638441bd8d5d26
7
- data.tar.gz: 24e97c6e52f38944a1947b50cb09347c3e5ebd457bcdb7bff0aff70aeac8412ed0a1ba8cfc85606d26886f30499c3981c4d4de414d2651c38d08f4104b362e79
6
+ metadata.gz: 9bf16bbe915b8f3910b1707be2cf96c47f186de277b66e2f71c5a2abac11f23c2994482245ab99330fb86fa7e11a87b4e8495e2f4133dd7661ce2e8775de0d08
7
+ data.tar.gz: 0c910c64438aa44be0ed04f9f2b666e325a8b5135b9ff307f396c5fe70b40bcc16011ad00400b882f8a30a35bdc9dd8d39c1e3e45726f38cf1ab582b1f9de538
@@ -12,7 +12,7 @@ module Katalyst
12
12
  tag.h2("Errors in content") +
13
13
  tag.ul(class: "errors") do
14
14
  container.errors.each do |error|
15
- concat(tag.li(error.full_message))
15
+ concat(tag.li(error.message))
16
16
  end
17
17
  end
18
18
  end
@@ -4,17 +4,32 @@ module Katalyst
4
4
  module Content
5
5
  module FrontendHelper
6
6
  def render_content(version)
7
- render partial: version.tree.select(&:visible?)
7
+ without_partial_path_prefix do
8
+ render partial: version.tree.select(&:visible?)
9
+ end
8
10
  end
9
11
 
10
12
  def render_content_items(items)
11
13
  items = items.select(&:visible?)
12
- render partial: items if items.any?
14
+ without_partial_path_prefix do
15
+ render partial: items if items.any?
16
+ end
13
17
  end
14
18
 
15
19
  def content_item_tag(item, **options, &block)
16
20
  FrontendBuilder.new(self, item).render(**options, &block)
17
21
  end
22
+
23
+ private
24
+
25
+ def without_partial_path_prefix
26
+ current = prefix_partial_path_with_controller_namespace
27
+
28
+ self.prefix_partial_path_with_controller_namespace = false
29
+ yield
30
+ ensure
31
+ self.prefix_partial_path_with_controller_namespace = current
32
+ end
18
33
  end
19
34
 
20
35
  class FrontendBuilder
@@ -5,7 +5,7 @@ en:
5
5
  heading: "Alternate text"
6
6
  errors:
7
7
  messages:
8
- missing_item: Content items are missing or invalid
8
+ missing_item: Items are missing or invalid
9
9
  models:
10
10
  katalyst/content/item:
11
11
  content_type_invalid: file type not supported
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Katalyst
4
4
  module Content
5
- VERSION = "0.2.1"
5
+ VERSION = "0.2.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katalyst-content
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-02 00:00:00.000000000 Z
11
+ date: 2022-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_storage_validations