metadata_presenter 0.25.0 → 0.27.2
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 +4 -4
- data/app/helpers/metadata_presenter/application_helper.rb +3 -4
- data/app/models/metadata_presenter/item.rb +4 -0
- data/app/views/metadata_presenter/attribute/_body.html.erb +1 -1
- data/app/views/metadata_presenter/attribute/_heading.html.erb +5 -7
- data/app/views/metadata_presenter/component/_components.html.erb +0 -20
- data/app/views/metadata_presenter/component/_content.html.erb +1 -1
- data/app/views/metadata_presenter/page/checkanswers.html.erb +5 -7
- data/app/views/metadata_presenter/page/content.html.erb +6 -9
- data/app/views/metadata_presenter/page/form.html.erb +1 -1
- data/app/views/metadata_presenter/page/start.html.erb +1 -1
- data/default_metadata/component/content.json +1 -1
- data/default_text/content.json +4 -2
- data/fixtures/version.json +3 -3
- data/lib/metadata_presenter/version.rb +1 -1
- data/schemas/component/content.json +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 703510699a0cde194daacc8401f1eb0d47205f44b1871bd1c572738ba63e5a47
|
4
|
+
data.tar.gz: 4a2c95289d96323e0de542644fc4dbf1c639076c492fd1a71710e43f6597f991
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ec09f76ec8f500c5ef791beb3d56c71f68b8b313c7cccdf75c6fa85c4615648ed3bc60cce9fa9911a28185efc0d1d78b229458d4a6396ab87e034cef117cbaa
|
7
|
+
data.tar.gz: 110f85a1a60d26168ae1bca025dea41e3bceb9aba509f354187fdd41a3a2ece3eea147dbaf1c58435ded4551144c035df85c2b75c4c89905d3c3916c46aa6175
|
@@ -6,15 +6,14 @@ module MetadataPresenter
|
|
6
6
|
end
|
7
7
|
end
|
8
8
|
|
9
|
-
# Renders
|
9
|
+
# Renders html given markdown.
|
10
10
|
#
|
11
11
|
# @example
|
12
|
-
# <%=
|
12
|
+
# <%=to_html '# Some markdown' %>
|
13
13
|
#
|
14
|
-
def
|
14
|
+
def to_html(text)
|
15
15
|
Kramdown::Document.new(text).to_html.html_safe
|
16
16
|
end
|
17
|
-
alias_method :to_markdown, :m
|
18
17
|
|
19
18
|
def default_text(property)
|
20
19
|
MetadataPresenter::DefaultText[property]
|
@@ -1,7 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
</h1>
|
7
|
-
<%- end %>
|
1
|
+
<h1 class="fb-editable govuk-heading-xl"
|
2
|
+
data-fb-content-id="page[heading]"
|
3
|
+
data-fb-content-type="element">
|
4
|
+
<%= @page.heading %>
|
5
|
+
</h1>
|
@@ -18,23 +18,3 @@
|
|
18
18
|
%>
|
19
19
|
</div>
|
20
20
|
<% end %>
|
21
|
-
|
22
|
-
<% if editable? %>
|
23
|
-
<ul class="component-activated-menu govuk-navigation editor-button govuk-button fb-govuk-button">
|
24
|
-
<% if input_components.present? %>
|
25
|
-
<ul>
|
26
|
-
<% input_components.each do |component| %>
|
27
|
-
<li><a href="#add-input-component" data-component-type="<%= component %>"></a>+ Add <%= component %> component</li>
|
28
|
-
<% end %>
|
29
|
-
</ul>
|
30
|
-
<% end %>
|
31
|
-
|
32
|
-
<% if content_components.present? %>
|
33
|
-
<ul>
|
34
|
-
<% content_components.each do |component| %>
|
35
|
-
<li><a href="#add-content-component" data-component-type="<%= component %>">+ Add <%= component %> component</a></li>
|
36
|
-
<% end %>
|
37
|
-
</ul>
|
38
|
-
<% end %>
|
39
|
-
</ul>
|
40
|
-
<% end %>
|
@@ -1 +1 @@
|
|
1
|
-
<%=
|
1
|
+
<%= to_html(component.content) %>
|
@@ -3,13 +3,11 @@
|
|
3
3
|
|
4
4
|
<%= render partial: 'metadata_presenter/attribute/section_heading' %>
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
</h1>
|
12
|
-
<% end %>
|
6
|
+
<h1 class="fb-editable govuk-heading-xl"
|
7
|
+
data-fb-content-type="element"
|
8
|
+
data-fb-content-id="page[heading]">
|
9
|
+
<%= @page.heading %>
|
10
|
+
</h1>
|
13
11
|
|
14
12
|
<%= form_for @page, url: reserved_submissions_path do |f| %>
|
15
13
|
|
@@ -4,16 +4,13 @@
|
|
4
4
|
|
5
5
|
<%= render 'metadata_presenter/attribute/section_heading' %>
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
<% end %>
|
14
|
-
|
7
|
+
<h1 class="fb-editable govuk-heading-xl"
|
8
|
+
data-fb-content-id="page[heading]"
|
9
|
+
data-fb-content-type="element">
|
10
|
+
<%= @page.heading %>
|
11
|
+
</h1>
|
12
|
+
|
15
13
|
<%= render 'metadata_presenter/attribute/lede' %>
|
16
|
-
|
17
14
|
<%= render 'metadata_presenter/attribute/body' %>
|
18
15
|
|
19
16
|
<%= form_for @page_answers, as: :answers, url: @page.url, method: :post do |f| %>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<div class="govuk-grid-column-two-thirds">
|
4
4
|
<% if @page.body %>
|
5
5
|
<p class="govuk-body-l" data-block-id="<%= @page.id %>" data-block-property="body">
|
6
|
-
<%=
|
6
|
+
<%= to_html(@page.body) %>
|
7
7
|
</p>
|
8
8
|
<%- end %>
|
9
9
|
<%= form_tag(reserved_answers_path, method: :post) do %>
|
data/default_text/content.json
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
"section_heading": "[Optional section heading]",
|
3
3
|
"lede": "[Optional lede paragraph]",
|
4
4
|
"body": "[Optional content]",
|
5
|
-
"
|
6
|
-
"hint": "[Optional hint text]"
|
5
|
+
"content": "[Optional content]",
|
6
|
+
"hint": "[Optional hint text]",
|
7
|
+
"option": "[Required option text]",
|
8
|
+
"option_hint": "[Optional hint text]"
|
7
9
|
}
|
data/fixtures/version.json
CHANGED
@@ -330,7 +330,7 @@
|
|
330
330
|
{
|
331
331
|
"_id": "how-many-lights_content_1",
|
332
332
|
"_type": "content",
|
333
|
-
"
|
333
|
+
"content": "What lights?"
|
334
334
|
}
|
335
335
|
],
|
336
336
|
"url": "how-many-lights"
|
@@ -348,7 +348,7 @@
|
|
348
348
|
{
|
349
349
|
"_id": "check-answers_content_1",
|
350
350
|
"_type": "content",
|
351
|
-
"
|
351
|
+
"content": "Check yourself before you wreck yourself."
|
352
352
|
}
|
353
353
|
],
|
354
354
|
"extra_components": []
|
@@ -365,7 +365,7 @@
|
|
365
365
|
{
|
366
366
|
"_id": "confirmation_content_1",
|
367
367
|
"_type": "content",
|
368
|
-
"
|
368
|
+
"content": "Some day I will be the most powerful Jedi ever!"
|
369
369
|
}
|
370
370
|
]
|
371
371
|
}
|
@@ -11,7 +11,7 @@
|
|
11
11
|
"_type": {
|
12
12
|
"const": "content"
|
13
13
|
},
|
14
|
-
"
|
14
|
+
"content": {
|
15
15
|
"title": "Content",
|
16
16
|
"description": "Content to display - use [markdown](https://www.gov.uk/guidance/how-to-publish-on-gov-uk/markdown) to format text or add hyperlinks",
|
17
17
|
"type": "string",
|
@@ -25,6 +25,6 @@
|
|
25
25
|
}
|
26
26
|
],
|
27
27
|
"required": [
|
28
|
-
"
|
28
|
+
"content"
|
29
29
|
]
|
30
30
|
}
|
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: 0.
|
4
|
+
version: 0.27.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MoJ Online
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_design_system_formbuilder
|