relaton-render 3.0.0.pre.alpha.40 → 3.0.0.pre.alpha.41
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: eaa53e917eda4357ec51973bf0c8898c8d25fec15918eb2647874e8493c56152
|
|
4
|
+
data.tar.gz: 304753e30cd5897dfc6ce7b95da61cf0d018309fab1fae709cc8d3a7e0533de4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6cbf5815eb1d846403a2a094a7a51723642f26014ed6a4329f82635a52feaca62599768c47cb05d58a5eaec9d6c553fba2e64cea6463cf6c641fc1f9a1ea6d45
|
|
7
|
+
data.tar.gz: c233dc2b8c49a57d13fa8bbc18d4fbd1c8b51b84add8da005a547406b5a609b0214bd14ca07c019abf35dee6e9736a40d755db0f2e345e62ff972ef6dd10af3d
|
|
@@ -13,9 +13,22 @@ module Relaton
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def render
|
|
16
|
+
if (form = authorizer_form) && !form.empty?
|
|
17
|
+
return Template.new(form).evaluate(
|
|
18
|
+
"authorizer" => Template::Field[true, authorizer_name],
|
|
19
|
+
)
|
|
20
|
+
end
|
|
21
|
+
|
|
16
22
|
authorizer_name
|
|
17
23
|
end
|
|
18
24
|
|
|
25
|
+
# The kind's declared form for this slot
|
|
26
|
+
def authorizer_form
|
|
27
|
+
variant = @style.per_type
|
|
28
|
+
.find { |t| t.type == @style.kind_for(@model.type) }
|
|
29
|
+
variant&.authorizer
|
|
30
|
+
end
|
|
31
|
+
|
|
19
32
|
private
|
|
20
33
|
|
|
21
34
|
def authorizer_name
|
|
@@ -13,6 +13,16 @@ module Relaton
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def render
|
|
16
|
+
if (form = production_form) && !form.empty?
|
|
17
|
+
return Template.new(form).evaluate(
|
|
18
|
+
"production" => Template::Field[true, render_production],
|
|
19
|
+
)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
render_production
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def render_production
|
|
16
26
|
if publisher_first?
|
|
17
27
|
return no_place_production_publisher_first if places.empty? &&
|
|
18
28
|
no_place_declared?
|
|
@@ -34,6 +44,13 @@ module Relaton
|
|
|
34
44
|
sep.empty? ? place : place.gsub(", ", sep)
|
|
35
45
|
end
|
|
36
46
|
|
|
47
|
+
# The kind's declared form for this slot
|
|
48
|
+
def production_form
|
|
49
|
+
variant = @style.per_type
|
|
50
|
+
.find { |t| t.type == @style.kind_for(@model.type) }
|
|
51
|
+
variant&.production
|
|
52
|
+
end
|
|
53
|
+
|
|
37
54
|
def publisher_first?
|
|
38
55
|
@i18n.punct_fetch("production_order", "") == "publisher_first"
|
|
39
56
|
end
|
|
@@ -11,6 +11,12 @@ module Relaton
|
|
|
11
11
|
attribute :template, :string
|
|
12
12
|
attribute :series, :string
|
|
13
13
|
attribute :title, :string
|
|
14
|
+
# Per-slot form overrides for the production and the
|
|
15
|
+
# authorizer: wrappers over the element's own render, so a
|
|
16
|
+
# kind can carry its slot's separator in the form
|
|
17
|
+
# (", {{production}}" over the engine's ". " glue)
|
|
18
|
+
attribute :production, :string
|
|
19
|
+
attribute :authorizer, :string
|
|
14
20
|
attribute :home, :boolean
|
|
15
21
|
attribute :fallbacks, :hash, default: -> { {} }
|
|
16
22
|
# The short-cite template for this kind; absent falls back to
|
|
@@ -25,6 +31,8 @@ module Relaton
|
|
|
25
31
|
map "template", to: :template
|
|
26
32
|
map "series", to: :series
|
|
27
33
|
map "title", to: :title
|
|
34
|
+
map "production", to: :production
|
|
35
|
+
map "authorizer", to: :authorizer
|
|
28
36
|
map "home", to: :home
|
|
29
37
|
map "fallbacks", to: :fallbacks
|
|
30
38
|
map "short", to: :short
|