metadata_presenter 0.26.0 → 0.27.3
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/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 +63 -63
- data/app/views/metadata_presenter/page/confirmation.html.erb +16 -14
- data/app/views/metadata_presenter/page/content.html.erb +6 -9
- data/app/views/metadata_presenter/page/form.html.erb +2 -2
- data/app/views/metadata_presenter/page/multiplequestions.html.erb +1 -1
- data/app/views/metadata_presenter/page/singlequestion.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: 027ea2efffbb85068abc14cb2ba4ff016aa92f7d32052a29689e1e5a0f38e315
|
4
|
+
data.tar.gz: 77b4685de4e43230b2c42b716f318d19e0352dea1b9ffa7e13f36f3a55501b54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d19d3e0d29083c44dc3efda1c631b0e949d78e865b112c97601acf71590e6e376b0f9324d92d35dd39dcf0866a9552fd0609025ce344570f344926c0aa4a4ea4
|
7
|
+
data.tar.gz: 18426551b21ebca783e364ad645bfef4b9dcf1a94a868e35d73c549535efbf30e77d571f8ac94919fae4c34804be16c84fe8642f6a6e5fa7514140979845070c
|
@@ -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) %>
|
@@ -1,82 +1,80 @@
|
|
1
|
-
<div class="
|
2
|
-
<div class="govuk-grid-
|
1
|
+
<div class="fb-main-grid-wrapper" data-fb-pagetype="<%= @page.type %>">
|
2
|
+
<div class="govuk-grid-row">
|
3
|
+
<div class="govuk-grid-column-two-thirds">
|
3
4
|
|
4
|
-
|
5
|
+
<%= render partial: 'metadata_presenter/attribute/section_heading' %>
|
5
6
|
|
6
|
-
<% if @page.heading.present? %>
|
7
7
|
<h1 class="fb-editable govuk-heading-xl"
|
8
8
|
data-fb-content-type="element"
|
9
9
|
data-fb-content-id="page[heading]">
|
10
10
|
<%= @page.heading %>
|
11
11
|
</h1>
|
12
|
-
<% end %>
|
13
12
|
|
14
|
-
|
13
|
+
<%= form_for @page, url: reserved_submissions_path do |f| %>
|
15
14
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
15
|
+
<%= render partial: 'metadata_presenter/component/components',
|
16
|
+
locals: {
|
17
|
+
f: f,
|
18
|
+
components: @page.extra_components,
|
19
|
+
tag: nil,
|
20
|
+
classes: nil,
|
21
|
+
input_components: @page.input_components,
|
22
|
+
content_components: @page.content_components
|
23
|
+
} %>
|
25
24
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
<div data-block-id="page.checkanswers.answers" data-block-type="answers">
|
26
|
+
<dl class="fb-block fb-block-answers govuk-summary-list">
|
27
|
+
<% pages_presenters.each do |page_answers_presenters| %>
|
28
|
+
<% page_answers_presenters.each_with_index do |page_answers_presenter, index| %>
|
30
29
|
|
31
|
-
|
32
|
-
|
30
|
+
<% if page_answers_presenter.display_heading?(index) %>
|
31
|
+
</dl>
|
33
32
|
|
34
|
-
|
33
|
+
<h3 class="govuk-heading-m"><%= page_answers_presenter.page.heading %></h3>
|
35
34
|
|
36
|
-
|
37
|
-
|
35
|
+
<dl class="fb-block fb-block-answers govuk-summary-list">
|
36
|
+
<% end %>
|
38
37
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
38
|
+
<div class="govuk-summary-list__row">
|
39
|
+
<dt class="govuk-summary-list__key">
|
40
|
+
<%= page_answers_presenter.humanised_title %>
|
41
|
+
</dt>
|
43
42
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
</
|
55
|
-
</
|
56
|
-
|
43
|
+
<dd class="govuk-summary-list__value">
|
44
|
+
<%= page_answers_presenter.answer %>
|
45
|
+
</dd>
|
46
|
+
<dd class="govuk-summary-list__actions">
|
47
|
+
<%= link_to(
|
48
|
+
change_answer_path(url: page_answers_presenter.url),
|
49
|
+
class: 'govuk-link'
|
50
|
+
) do %>
|
51
|
+
Change<span class="govuk-visually-hidden"> Your answer for <%= page_answers_presenter.humanised_title %></span>
|
52
|
+
<% end %>
|
53
|
+
</dd>
|
54
|
+
</div>
|
55
|
+
<% end %>
|
57
56
|
<% end %>
|
58
|
-
|
59
|
-
</
|
60
|
-
</div>
|
57
|
+
</dl>
|
58
|
+
</div>
|
61
59
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
60
|
+
<% if @page.send_heading.present? %>
|
61
|
+
<h2 class="fb-send-heading fb-editable govuk-heading-m"
|
62
|
+
data-fb-content-type="element"
|
63
|
+
data-fb-content-id="page[send_heading]">
|
64
|
+
<%= @page.send_heading %>
|
65
|
+
</h2>
|
66
|
+
<% end %>
|
69
67
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
68
|
+
<% if @page.send_body.present? %>
|
69
|
+
<div class="fb-send-body fb-editable"
|
70
|
+
data-fb-content-type="content"
|
71
|
+
data-fb-content-id="page[send_body]">
|
72
|
+
<%= @page.send_body %>
|
73
|
+
</div>
|
74
|
+
<% end %>
|
77
75
|
|
78
|
-
|
79
|
-
|
76
|
+
<%= render partial: 'metadata_presenter/component/components',
|
77
|
+
locals: {
|
80
78
|
f: f,
|
81
79
|
components: @page.components,
|
82
80
|
tag: nil,
|
@@ -85,9 +83,11 @@
|
|
85
83
|
content_components: @page.content_components
|
86
84
|
} %>
|
87
85
|
|
88
|
-
|
86
|
+
<button <%= 'disabled' if editable? %> data-prevent-double-click="true" class="fb-block fb-block-actions govuk-button" data-module="govuk-button" data-block-id="actions" data-block-type="actions">
|
89
87
|
Accept and send application
|
90
|
-
|
91
|
-
|
88
|
+
</button>
|
89
|
+
<% end %>
|
90
|
+
|
91
|
+
</div>
|
92
92
|
</div>
|
93
93
|
</div>
|
@@ -1,21 +1,22 @@
|
|
1
|
-
<div class="
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
<div class="fb-main-grid-wrapper" data-fb-pagetype="<%= @page.type %>">
|
2
|
+
<div class="govuk-panel govuk-panel--confirmation">
|
3
|
+
<h1 class="fb-editable govuk-panel__title"
|
4
|
+
data-fb-content-type="element"
|
5
|
+
data-fb-content-id="page[heading]">
|
6
|
+
<%= @page.heading %>
|
7
|
+
</h1>
|
7
8
|
|
8
|
-
|
9
|
-
</div>
|
9
|
+
<%= render 'metadata_presenter/attribute/lede' %>
|
10
|
+
</div>
|
10
11
|
|
11
|
-
<div class="govuk-grid-row">
|
12
|
-
|
13
|
-
|
12
|
+
<div class="govuk-grid-row">
|
13
|
+
<div class="govuk-grid-column-two-thirds">
|
14
|
+
<%= render 'metadata_presenter/attribute/body' %>
|
15
|
+
</div>
|
14
16
|
</div>
|
15
|
-
</div>
|
16
17
|
|
17
|
-
<%= render partial: 'metadata_presenter/component/components',
|
18
|
-
|
18
|
+
<%= render partial: 'metadata_presenter/component/components',
|
19
|
+
locals: {
|
19
20
|
f: nil,
|
20
21
|
components: @page.components,
|
21
22
|
tag: nil,
|
@@ -23,3 +24,4 @@
|
|
23
24
|
input_components: @page.input_components,
|
24
25
|
content_components: @page.content_components
|
25
26
|
} %>
|
27
|
+
</div>
|
@@ -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| %>
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<div class="fb-main-grid-wrapper" data-
|
1
|
+
<div class="fb-main-grid-wrapper" data-fb-pagetype="<%= @page.type %>">
|
2
2
|
<div class="govuk-grid-row">
|
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 %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div class="fb-main-grid-wrapper" data-
|
1
|
+
<div class="fb-main-grid-wrapper" data-fb-pagetype="<%= @page.type %>">
|
2
2
|
<div class="govuk-grid-row">
|
3
3
|
<div class="govuk-grid-column-two-thirds">
|
4
4
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div class="fb-main-grid-wrapper" data-
|
1
|
+
<div class="fb-main-grid-wrapper" data-fb-pagetype="<%= @page.type %>">
|
2
2
|
<div class="govuk-grid-row">
|
3
3
|
<div class="govuk-grid-column-two-thirds">
|
4
4
|
<%= form_for @page_answers, as: :answers, url: @page.url, method: :post do |f| %>
|
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.3
|
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-04-
|
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
|