metadata_presenter 3.3.15 → 3.3.16
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a56bfee298fe7e9138b1d60ee8c29af5685240ae893a665e6b920ca3ccdf9af
|
4
|
+
data.tar.gz: 62db49deaa88439f4c8e8efe962c6bf544de01b194351374444a487ec6580462
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29bd9a966ac9a90033e9c75d33a508e59608bad99aba8966f1be17f20aa8f8cfcf38c68cc6d5ae5a5022a06a4c4fabfb57bf5cf614cb849e629ce2e588b60bee
|
7
|
+
data.tar.gz: 5da8149a431708bdff1b03317d9903b51815a1d1e505ce473a58d26b9c1f332b61d7e69005d11e21e7913fdf7cf2ccad409aeeb911b98691e8c1f4121ae4a31a
|
@@ -2,6 +2,8 @@ require 'govspeak'
|
|
2
2
|
|
3
3
|
module MetadataPresenter
|
4
4
|
module ApplicationHelper
|
5
|
+
OLD_BODY_DEFAULT_CONTENT = 'Body section'.freeze
|
6
|
+
|
5
7
|
def main_title(component:, tag: :h1, classes: 'govuk-heading-xl')
|
6
8
|
content_tag(tag, class: classes) do
|
7
9
|
component.humanised_title
|
@@ -21,6 +23,15 @@ module MetadataPresenter
|
|
21
23
|
MetadataPresenter::DefaultText[property]
|
22
24
|
end
|
23
25
|
|
26
|
+
# we used to have some placeholder text in the body key, which was always replaced
|
27
|
+
# we since exposed the body key in an optional content area for certain pages, so forms created before that
|
28
|
+
# need to have their old default content ignored
|
29
|
+
def page_body_content
|
30
|
+
if @page.body
|
31
|
+
@page.body == OLD_BODY_DEFAULT_CONTENT ? '' : @page.body
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
24
35
|
def default_title(component_type)
|
25
36
|
MetadataPresenter::DefaultMetadata["component.#{component_type}"]&.[]('label') ||
|
26
37
|
MetadataPresenter::DefaultMetadata["component.#{component_type}"]&.[]('legend')
|
@@ -3,8 +3,8 @@
|
|
3
3
|
class="fb-editable"
|
4
4
|
type="content"
|
5
5
|
default-content="<%= default_text('body') %>"
|
6
|
-
content="<%=
|
6
|
+
content="<%= page_body_content %>"
|
7
7
|
data-fb-content-id="<%= "page[body]" %>">
|
8
|
-
<%= to_html(
|
8
|
+
<%= to_html(page_body_content) %>
|
9
9
|
</editable-content>
|
10
10
|
<%- end %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metadata_presenter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MoJ Forms
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_design_system_formbuilder
|