metadata_presenter 0.13.2 → 0.13.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/metadata_presenter/engine_controller.rb +3 -1
- data/app/presenters/metadata_presenter/page_answers_presenter.rb +1 -1
- data/app/validators/metadata_presenter/base_validator.rb +1 -6
- data/app/views/metadata_presenter/component/_checkboxes.html.erb +2 -1
- data/app/views/metadata_presenter/component/_text.html.erb +8 -6
- data/app/views/metadata_presenter/header/show.html.erb +1 -1
- data/app/views/metadata_presenter/page/singlequestion.html.erb +2 -1
- data/app/views/metadata_presenter/page/start.html.erb +22 -12
- data/lib/metadata_presenter/version.rb +1 -1
- 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: 1a03324e5fcda2cc6e240abf9de25153de6d3420df67c756616e28f3ae1d645b
|
4
|
+
data.tar.gz: 865b8c040daa4e3d80a83a64131b1e5e57c3a720d99c94dc325b121453ca33df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de3122090686c934774b46f29b0db345984681d282c0be662ccf3bd8f8ccb6a8f38dcd5d7660e8b11221b6d617176339aa825eadde59bcf8396e2de8ef8787d9
|
7
|
+
data.tar.gz: ced8509a65f415a2c0e65378ad3ca880d142e526f8c1ab44e2af6e2f45a2f497ee26d09e6a8037e556b724f8adc6589f1a06a2fdb11a163b25ad706d1f821955
|
@@ -8,7 +8,9 @@ module MetadataPresenter
|
|
8
8
|
def back_link
|
9
9
|
return if @page.blank?
|
10
10
|
|
11
|
-
|
11
|
+
previous_page = service.previous_page(current_page: @page)&.url
|
12
|
+
|
13
|
+
@back_link ||= File.join(request.script_name, previous_page) if previous_page
|
12
14
|
end
|
13
15
|
helper_method :back_link
|
14
16
|
|
@@ -63,12 +63,7 @@ module MetadataPresenter
|
|
63
63
|
# @return [String] user answer for the specific component
|
64
64
|
#
|
65
65
|
def user_answer
|
66
|
-
|
67
|
-
if component.type == 'checkboxes'
|
68
|
-
Array(value).reject(&:blank?)
|
69
|
-
else
|
70
|
-
value
|
71
|
-
end
|
66
|
+
page_answers.send(component.name)
|
72
67
|
end
|
73
68
|
|
74
69
|
# The default error message will be look using the schema key.
|
@@ -1,6 +1,8 @@
|
|
1
|
-
<%=
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
<div class="fb-editable" data-fb-content-type="<%= component._type %>" data-fb-content-id="<%= component_id %>" data-fb-content-data="<%= component.to_json %>">
|
2
|
+
<%=
|
3
|
+
f.govuk_text_field component.id.to_sym,
|
4
|
+
label: { text: input_title },
|
5
|
+
hint: { text: component.hint },
|
6
|
+
name: "answers[#{component.name}]"
|
7
|
+
%>
|
8
|
+
</div>
|
@@ -26,7 +26,7 @@
|
|
26
26
|
</div>
|
27
27
|
<% if service.service_name.present? %>
|
28
28
|
<div class="govuk-header__content">
|
29
|
-
<a href="
|
29
|
+
<a href="<%= root_path %>" class="govuk-header__link govuk-header__link--service-name">
|
30
30
|
<%= service.service_name %>
|
31
31
|
</a>
|
32
32
|
<% end %>
|
@@ -3,9 +3,10 @@
|
|
3
3
|
<div class="govuk-grid-column-two-thirds">
|
4
4
|
<%= form_for @page_answers, as: :answers, url: @page.url, method: :post do |f| %>
|
5
5
|
<%= f.govuk_error_summary %>
|
6
|
-
<% @page.components.
|
6
|
+
<% @page.components.each_with_index do |component, index| %>
|
7
7
|
<%= render partial: component, locals: {
|
8
8
|
component: component,
|
9
|
+
component_id: "page[components[#{index}]]",
|
9
10
|
f: f,
|
10
11
|
input_title: main_h1(component) }
|
11
12
|
%>
|
@@ -1,33 +1,41 @@
|
|
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.section_heading -%>
|
5
|
-
<p class="govuk-caption-l fb-section_heading"
|
5
|
+
<p class="fb-editable govuk-caption-l fb-section_heading"
|
6
|
+
data-fb-content-type="element"
|
7
|
+
data-fb-content-id="page[section_heading]">
|
6
8
|
<%= @page.section_heading.html_safe %>
|
7
9
|
</p>
|
8
10
|
<%- end %>
|
9
11
|
|
10
12
|
<% if @page.heading %>
|
11
|
-
<h1 class="<%= @page.heading_class %>"
|
13
|
+
<h1 class="fb-editable <%= @page.heading_class %>"
|
14
|
+
data-fb-content-id="page[heading]"
|
15
|
+
data-fb-content-type="element">
|
12
16
|
<%= @page.heading.html_safe %>
|
13
17
|
</h1>
|
14
18
|
<% end %>
|
15
19
|
|
16
20
|
<% if @page.lede %>
|
17
|
-
<
|
21
|
+
<div class="fb-editable"
|
22
|
+
data-fb-content-id="page[lede]"
|
23
|
+
data-fb-content-type="content">
|
18
24
|
<%= @page.lede.html_safe %>
|
19
|
-
</
|
25
|
+
</div>
|
20
26
|
<%- end %>
|
21
27
|
|
22
28
|
<% if @page.body %>
|
23
|
-
<
|
24
|
-
|
25
|
-
|
29
|
+
<div class="fb-editable"
|
30
|
+
data-fb-content-id="page[body]"
|
31
|
+
data-fb-content-type="content">
|
32
|
+
<%= to_markdown(@page.body) %>
|
33
|
+
</div>
|
26
34
|
<%- end %>
|
27
35
|
|
28
36
|
<%= form_tag(root_path, method: :post) do %>
|
29
37
|
<button <%= 'disabled' if editable? %> class='govuk-button govuk-button--start govuk-!-margin-top-2'>
|
30
|
-
|
38
|
+
Start now
|
31
39
|
<svg class="govuk-button__start-icon" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40" aria-hidden="true" focusable="false">
|
32
40
|
<path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z" />
|
33
41
|
</svg>
|
@@ -35,9 +43,11 @@
|
|
35
43
|
<% end %>
|
36
44
|
|
37
45
|
<% if @page.before_you_start %>
|
38
|
-
<
|
39
|
-
|
40
|
-
|
46
|
+
<div class="fb-editable"
|
47
|
+
data-fb-content-id="page[before_you_start]"
|
48
|
+
data-fb-content-type="content">
|
49
|
+
<%= to_markdown(@page.before_you_start) %>
|
50
|
+
</div>
|
41
51
|
<%- end %>
|
42
52
|
</div>
|
43
53
|
</div>
|
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.13.
|
4
|
+
version: 0.13.7
|
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-02-
|
11
|
+
date: 2021-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|