katalyst-content 0.2.1 → 1.0.0

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: 6eaf7d4032f6cef16151da4336669dc0cde37f4dbab9baa83f7f0b0b33615ff3
4
+ data.tar.gz: 239fddb43c620128f8fb3a6d43b2f2b82d87af269582323829ec803032a17cca
5
5
  SHA512:
6
- metadata.gz: 64f111753041dd647e73d863e011b23c3507cb930dcac40dd55f991d422802896cc6d515e998adf31be3a07962a38ac8b22e16490b3a56fcb3638441bd8d5d26
7
- data.tar.gz: 24e97c6e52f38944a1947b50cb09347c3e5ebd457bcdb7bff0aff70aeac8412ed0a1ba8cfc85606d26886f30499c3981c4d4de414d2651c38d08f4104b362e79
6
+ metadata.gz: 3436a0659d9b72d8fc7fab7f74ddb663642172489d745ca2627e533d73ba179a8acbe02439ab892e42317466a465c1fe174ec3c7ed3daa96b9e7e70983842310
7
+ data.tar.gz: 5a8d0f30454e25c30f2dbeb07ff7608de177e0574ac7a6ea71c4b2012e71a88216f010d1a3c9e7a86569da00a57a45ca1b6c43f6408411faec17bc638a7c8d6f
@@ -42,7 +42,7 @@ export default class Item {
42
42
  * @returns {number} logical nesting depth of node in container
43
43
  */
44
44
  get depth() {
45
- return parseInt(this.node.dataset[`contentDepth`]);
45
+ return parseInt(this.node.dataset[`contentDepth`]) || 0;
46
46
  }
47
47
 
48
48
  get #depthInput() {
@@ -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 = "1.0.0"
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: 1.0.0
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