katalyst-content 0.2.1 → 1.0.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6eaf7d4032f6cef16151da4336669dc0cde37f4dbab9baa83f7f0b0b33615ff3
|
4
|
+
data.tar.gz: 239fddb43c620128f8fb3a6d43b2f2b82d87af269582323829ec803032a17cca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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() {
|
@@ -4,17 +4,32 @@ module Katalyst
|
|
4
4
|
module Content
|
5
5
|
module FrontendHelper
|
6
6
|
def render_content(version)
|
7
|
-
|
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
|
-
|
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
|
data/config/locales/en.yml
CHANGED
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.
|
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-
|
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
|