metadata_presenter 2.17.28 → 2.17.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/app/controllers/metadata_presenter/engine_controller.rb +8 -0
- data/app/views/metadata_presenter/footer/_meta.html.erb +1 -1
- data/app/views/metadata_presenter/page/confirmation.html.erb +5 -1
- data/config/locales/en.yml +1 -0
- 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: 378303acb1d79cfa54b47568adc4a71e7ebf962afeb93f15e843fd9185f94314
|
4
|
+
data.tar.gz: df2d1f7bef49a5f2555dac0092394498a2ed6de7e7f793978eb27a9d735c6a5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bb5db0c1fd70e1a9b3a463e8338ec73f5dbe389d872569e23f6862271b9e5a9064586f02ce1191cc534f5926b9bd887eb02f32230b54789178e47590d71cd93
|
7
|
+
data.tar.gz: 63bb8ce4122db2bb72366336a8ad838abf55733e50782d8b9a40cf3f7ee8388e66c6a83cff40895e22cb866c345a7c43572e28b335e472413e35cce5a9734765
|
data/README.md
CHANGED
@@ -52,6 +52,8 @@ that you need to write the following methods in your controller:
|
|
52
52
|
5. assign_autocomplete_items
|
53
53
|
6. reference_number_enabled?
|
54
54
|
7. show_reference_number
|
55
|
+
8. payment_link_enabled?
|
56
|
+
9. payment_link_url
|
55
57
|
|
56
58
|
The user answers can be accessed via `params[:answers]`.
|
57
59
|
|
@@ -89,6 +91,10 @@ The `autocomplete_items` takes the components on a page and retrieves any items
|
|
89
91
|
|
90
92
|
`show_reference_number` method will present the placeholder reference number if viewing in the Editor/Preview or will present a generated reference number if in the Runner.
|
91
93
|
|
94
|
+
`payment_link_enabled?` method checks whether payment link is enabled in the Runner or Editor app. For the Runner app payment link is enabled when the `ENV['PAYMENT_LINK']` variable is present. In the Editor, payment link enabled is checked by checking the `ServiceConfiguration` table.
|
95
|
+
|
96
|
+
`payment_link_url` method will present the payment link url. For the Runner this is the value of the `ENV['PAYMENT_LINK']` variable. In the Editor the value comes from the `ServiceConfiguration` table.
|
97
|
+
|
92
98
|
## Generate documentation
|
93
99
|
|
94
100
|
Run `rake doc` and open the doc/index.html
|
@@ -70,6 +70,14 @@ module MetadataPresenter
|
|
70
70
|
ENV['MAINTENANCE_MODE'].present? && ENV['MAINTENANCE_MODE'] == '1'
|
71
71
|
end
|
72
72
|
|
73
|
+
def external_or_relative_link(link)
|
74
|
+
uri = URI.parse(link)
|
75
|
+
return link if uri.scheme.present? && uri.host.present?
|
76
|
+
|
77
|
+
link.starts_with?('/') ? link : link.prepend('/')
|
78
|
+
end
|
79
|
+
helper_method :external_or_relative_link
|
80
|
+
|
73
81
|
private
|
74
82
|
|
75
83
|
def not_found
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<ul class="govuk-footer__inline-list">
|
3
3
|
<% service.meta.items.each do |item| %>
|
4
4
|
<li class="govuk-footer__inline-list-item">
|
5
|
-
<a class="govuk-footer__link" href=<%=
|
5
|
+
<a class="govuk-footer__link" href=<%= external_or_relative_link(item.href) %>><%= item.text %></a>
|
6
6
|
</li>
|
7
7
|
<% end %>
|
8
8
|
</ul>
|
@@ -48,5 +48,9 @@
|
|
48
48
|
classes: nil,
|
49
49
|
input_components: @page.supported_input_components,
|
50
50
|
content_components: @page.supported_content_components
|
51
|
-
|
51
|
+
} %>
|
52
|
+
|
53
|
+
<% if payment_link_enabled? %>
|
54
|
+
<a href="<%= payment_link_url %>" class="govuk-button" data-module="govuk-button" data-component="pay-button"><%= t('presenter.confirmation.continue_to_pay_button') %></a>
|
55
|
+
<% end %>
|
52
56
|
</div>
|
data/config/locales/en.yml
CHANGED
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: 2.17.
|
4
|
+
version: 2.17.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MoJ Forms
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_design_system_formbuilder
|