metadata_presenter 2.17.39 → 2.17.41
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/save_and_return_controller.rb +26 -0
- data/app/models/metadata_presenter/saved_form.rb +11 -0
- data/app/views/layouts/metadata_presenter/application.html.erb +36 -20
- data/app/views/metadata_presenter/page/checkanswers.html.erb +1 -1
- data/app/views/metadata_presenter/page/content.html.erb +1 -1
- 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/save_and_return/show.html.erb +43 -0
- data/app/views/metadata_presenter/session/_timeout_fallback.html.erb +8 -0
- data/app/views/metadata_presenter/session/_timeout_warning_modal.html.erb +33 -0
- data/config/locales/en.yml +25 -1
- data/config/routes.rb +3 -0
- data/lib/metadata_presenter/version.rb +1 -1
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06ef8d829975b8cd62a3060296a02bcc4da086497f6d388f5cd0491c780c886a
|
4
|
+
data.tar.gz: 9ff7ef2b5a8a436a90a196c56f50e5413f608c3dd5245e543420fb908ac73b58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ec97f71e39206385633229ab67537d3a6011a7debcf8d264f6e707e365868b7136d798803f975578a1c8daa659113cdcbc8d75816f8cbaedc28c0ed90fa6cd2
|
7
|
+
data.tar.gz: 3a2ad788127411e12c498534b07b56914082afc3afff90c053ab030735f06dca77ba728b6f6d5efca47b7a38199bc3b82f6fb6be4a723f6c9c8d91e4c06629af
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module MetadataPresenter
|
2
|
+
class SaveAndReturnController < EngineController
|
3
|
+
before_action :check_feature_flag
|
4
|
+
helper_method :secret_questions
|
5
|
+
|
6
|
+
def show
|
7
|
+
@saved_form = SavedForm.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def create; end
|
11
|
+
|
12
|
+
def secret_questions
|
13
|
+
[
|
14
|
+
OpenStruct.new(id: 1, name: I18n.t('presenter.save_and_return.secret_questions.one')),
|
15
|
+
OpenStruct.new(id: 2, name: I18n.t('presenter.save_and_return.secret_questions.two')),
|
16
|
+
OpenStruct.new(id: 3, name: I18n.t('presenter.save_and_return.secret_questions.three'))
|
17
|
+
]
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def check_feature_flag
|
23
|
+
redirect_to '/' and return if ENV['SAVE_AND_RETURN'] != 'enabled'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -1,18 +1,19 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html lang="en">
|
3
3
|
<head>
|
4
|
+
<meta charset="utf-8">
|
4
5
|
<title><%= service.service_name %></title>
|
5
6
|
<%= csrf_meta_tags %>
|
6
7
|
<%= csp_meta_tag %>
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
10
|
+
<meta name="robots" content="noindex">
|
11
|
+
<link rel="shortcut icon" sizes="16x16 32x32 48x48" href="<%= asset_pack_url('media/images/favicon.ico') %>" type="image/x-icon" />
|
12
|
+
<link rel="mask-icon" href="<%= asset_pack_url('media/images/govuk-mask-icon.svg') %>" color="blue">
|
13
|
+
<link rel="apple-touch-icon" sizes="180x180" href="<%= asset_pack_url('media/images/govuk-apple-touch-icon-180x180.png') %>">
|
14
|
+
<link rel="apple-touch-icon" sizes="167x167" href="<%= asset_pack_url('media/images/govuk-apple-touch-icon-167x167.png') %>">
|
15
|
+
<link rel="apple-touch-icon" sizes="152x152" href="<%= asset_pack_url('media/images/govuk-apple-touch-icon-152x152.png') %>">
|
16
|
+
<link rel="apple-touch-icon" href="<%= asset_pack_url('media/images/govuk-apple-touch-icon.png') %>">
|
16
17
|
|
17
18
|
<%= javascript_pack_tag 'runner_application', 'govuk', defer: true %>
|
18
19
|
<%= stylesheet_pack_tag 'govuk', 'runner_application', media: 'all' %>
|
@@ -23,19 +24,34 @@
|
|
23
24
|
</head>
|
24
25
|
|
25
26
|
<body class="govuk-template__body">
|
26
|
-
|
27
|
-
|
28
|
-
|
27
|
+
<script>
|
28
|
+
document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');
|
29
|
+
</script>
|
30
|
+
|
31
|
+
<div class="govuk-modal-dialogue-inert-container">
|
32
|
+
<% if show_cookie_banner? %>
|
33
|
+
<%= render partial: 'metadata_presenter/analytics/cookie_banner' %>
|
34
|
+
<% end %>
|
35
|
+
|
36
|
+
<%= render template: 'metadata_presenter/header/show' %>
|
29
37
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
+
<div class="govuk-width-container govuk-body-m">
|
39
|
+
<main class="govuk-main-wrapper govuk-main-wrapper--auto-spacing" id="main-content" role="main">
|
40
|
+
<% if back_link.present? %>
|
41
|
+
<a class="govuk-back-link" href="<%= back_link %>">Back</a>
|
42
|
+
<% end %>
|
43
|
+
<% if !in_progress? %>
|
44
|
+
<%= render partial: 'metadata_presenter/session/timeout_fallback' %>
|
45
|
+
<% end %>
|
46
|
+
<%= yield %>
|
47
|
+
</main>
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<%= render template: 'metadata_presenter/footer/footer' %>
|
38
51
|
</div>
|
39
|
-
|
52
|
+
|
53
|
+
<% if !in_progress? %>
|
54
|
+
<%= render partial: 'metadata_presenter/session/timeout_warning_modal' %>
|
55
|
+
<% end %>
|
40
56
|
</body>
|
41
57
|
</html>
|
@@ -86,7 +86,7 @@
|
|
86
86
|
|
87
87
|
<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">
|
88
88
|
<%= t('presenter.actions.submit') -%>
|
89
|
-
</button>
|
89
|
+
</button> <% if ENV['SAVE_AND_RETURN'] == 'enabled' %><a href="<%= save_path %>" class="govuk-button" data-module="govuk-button" data-component="save-button"><%= t('presenter.save_and_return.save') %></a><% end %>
|
90
90
|
<% end %>
|
91
91
|
|
92
92
|
</div>
|
@@ -25,7 +25,7 @@
|
|
25
25
|
content_components: @page.supported_content_components
|
26
26
|
} %>
|
27
27
|
|
28
|
-
<%= f.govuk_submit(disabled: editable?) %>
|
28
|
+
<%= f.govuk_submit(disabled: editable?) %> <% if ENV['SAVE_AND_RETURN'] == 'enabled' %><a href="<%= save_path %>" class="govuk-button" data-module="govuk-button" data-component="save-button"><%= t('presenter.save_and_return.save') %></a><% end %>
|
29
29
|
<% end %>
|
30
30
|
</div>
|
31
31
|
</div>
|
@@ -18,7 +18,7 @@
|
|
18
18
|
}
|
19
19
|
%>
|
20
20
|
|
21
|
-
<%= f.govuk_submit(disabled: editable?) %>
|
21
|
+
<%= f.govuk_submit(disabled: editable?) %> <% if ENV['SAVE_AND_RETURN'] == 'enabled' %><a href="<%= save_path %>" class="govuk-button" data-module="govuk-button" data-component="save-button"><%= t('presenter.save_and_return.save') %></a><% end %>
|
22
22
|
<% end %>
|
23
23
|
</div>
|
24
24
|
</div>
|
@@ -20,7 +20,7 @@
|
|
20
20
|
</div>
|
21
21
|
<% end %>
|
22
22
|
|
23
|
-
<%= f.govuk_submit(disabled: editable?) %>
|
23
|
+
<%= f.govuk_submit(disabled: editable?) %> <% if ENV['SAVE_AND_RETURN'] == 'enabled' %><a href="<%= save_path %>" class="govuk-button" data-module="govuk-button" data-component="save-button"><%= t('presenter.save_and_return.save') %></a><% end %>
|
24
24
|
<% end %>
|
25
25
|
</div>
|
26
26
|
</div>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<div class="fb-main-grid-wrapper">
|
2
|
+
<div class="govuk-grid-row">
|
3
|
+
<div class="govuk-grid-column-two-thirds">
|
4
|
+
<h1 id="page-heading" class="govuk-heading-xl"><%= t('presenter.save_and_return.show.heading') %></h1>
|
5
|
+
<p class="mojf-settings-screen__description"><%= t('presenter.save_and_return.show.description') %></p>
|
6
|
+
|
7
|
+
<%= form_for @saved_form do |f| %>
|
8
|
+
<%= f.govuk_error_summary %>
|
9
|
+
<div class="govuk-form-group">
|
10
|
+
<%=
|
11
|
+
f.govuk_email_field :email,
|
12
|
+
label: { text: t('presenter.save_and_return.show.email') },
|
13
|
+
hint: {
|
14
|
+
data: { "fb-default-text" => default_text('hint') },
|
15
|
+
text: t('presenter.save_and_return.show.email_hint')
|
16
|
+
},
|
17
|
+
name: "email",
|
18
|
+
spellcheck: "false",
|
19
|
+
autocomplete: "email"
|
20
|
+
%>
|
21
|
+
<%=
|
22
|
+
f.govuk_collection_radio_buttons :secret_question,
|
23
|
+
secret_questions,
|
24
|
+
:id,
|
25
|
+
:name,
|
26
|
+
legend: { text: t('presenter.save_and_return.show.secret_question') },
|
27
|
+
hint: {
|
28
|
+
data: { "fb-default-text" => default_text('hint') },
|
29
|
+
text: t('presenter.save_and_return.show.secret_question_hint')
|
30
|
+
},
|
31
|
+
bold_labels: false
|
32
|
+
%>
|
33
|
+
<%=
|
34
|
+
f.govuk_text_field :secret_answer,
|
35
|
+
label: { text: t('presenter.save_and_return.show.secret_answer') },
|
36
|
+
name: "secret_answer"
|
37
|
+
%>
|
38
|
+
</div>
|
39
|
+
|
40
|
+
<%= f.govuk_submit t('presenter.save_and_return.show.continue') %><% end %> <%= link_to t('presenter.save_and_return.show.cancel'), :back %>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
</div>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<div class="govuk-warning-text govuk-timeout-warning-fallback">
|
2
|
+
<span class="govuk-warning-text__icon" aria-hidden="true">!</span>
|
3
|
+
<strong class="govuk-warning-text__text">
|
4
|
+
<span class="govuk-warning-text__assistive">Warning</span>
|
5
|
+
<%= t('presenter.session_timeout_warning.timer_fallback') %> <%= session_expiry_time&.strftime('%l:%M %p') %>.
|
6
|
+
<%= t('presenter.session_timeout_warning.timer_extra') %>
|
7
|
+
</strong>
|
8
|
+
</div>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<div class="govuk-timeout-warning"
|
2
|
+
data-module="govuk-timeout-warning"
|
3
|
+
id="js-timeout-warning"
|
4
|
+
data-minutes-idle-timeout="25"
|
5
|
+
data-minutes-modal-visible="5"
|
6
|
+
data-url-redirect="/session/reset"
|
7
|
+
data-timer-text="<%= t('presenter.session_timeout_warning.timer') %>"
|
8
|
+
data-timer-extra-text="<%= t('presenter.session_timeout_warning.timer_extra') %>"
|
9
|
+
data-timer-redirect-text="<%= t('presenter.session_timeout_warning.redirect') %>">
|
10
|
+
|
11
|
+
<div id="timeout-warning-modal"
|
12
|
+
class="govuk-modal-dialogue govuk-timeout-warning__dialog"
|
13
|
+
data-inert-container=".govuk-modal-dialogue-inert-container">
|
14
|
+
<div class="govuk-modal-dialogue__wrapper" >
|
15
|
+
<dialog class="govuk-modal-dialogue__box " aria-labelledby="timeout-warning-modal-title" aria-modal="true" role="modal" tabindex="-1">
|
16
|
+
<div class="govuk-modal-dialogue__header">
|
17
|
+
<button type="button" class="govuk-button govuk-modal-dialogue__close" aria-label="<%= t('presenter.session_timeout_warning.close_button') %>" data-element="govuk-modal-dialogue-close">x</button>
|
18
|
+
</div>
|
19
|
+
<div class="govuk-modal-dialogue__content">
|
20
|
+
<h2 class="govuk-modal-dialogue__heading govuk-heading-l" id="timeout-warning-modal-title">
|
21
|
+
<%= t('presenter.session_timeout_warning.heading') %>
|
22
|
+
</h2>
|
23
|
+
<div class="govuk-modal-dialogue__description govuk-body" id="timeout-warning-modal-description">
|
24
|
+
<div class="govuk-timeout-warning__timer" aria-hidden="true"></div>
|
25
|
+
<div class="govuk-timeout-warning__at-timer govuk-visually-hidden" role="status" id="at-timer"></div>
|
26
|
+
</div>
|
27
|
+
<button class="govuk-button dialog-button govuk" data-module="govuk-button" data-element="govuk-modal-dialogue-close"><%= t('presenter.session_timeout_warning.button') %></button>
|
28
|
+
</div>
|
29
|
+
</dialog>
|
30
|
+
</div>
|
31
|
+
<div class="govuk-modal-dialogue__backdrop"></div>
|
32
|
+
</div>
|
33
|
+
</div>
|
data/config/locales/en.yml
CHANGED
@@ -19,15 +19,39 @@ en:
|
|
19
19
|
maintenance:
|
20
20
|
maintenance_page_heading: 'Sorry, this form is unavailable'
|
21
21
|
maintenance_page_content: "If you were in the middle of completing the form, your data has not been saved.\r\n\r\nThe form will be available again from 9am on Monday 19 November 2018.\r\n\r\n\r\n\r\n### Other ways to apply\r\n\r\nContact us if your application is urgent \r\n\r\nEmail: \r\nTelephone: \r\nMonday to Friday, 9am to 5pm \r\n[Find out about call charges](https://www.gov.uk/call-charges)"
|
22
|
+
session_timeout_warning:
|
23
|
+
heading: Your form will reset soon
|
24
|
+
timer: We will reset your form if you do not continue in
|
25
|
+
timer_fallback: We will reset your form if you do not complete the page and press continue by
|
26
|
+
timer_extra: Any answers you have entered so far will be cleared to protect your information.
|
27
|
+
redirect: You are about to be redirected
|
28
|
+
close_button: Close
|
29
|
+
button: Continue
|
22
30
|
session_expired:
|
23
31
|
title: Your form has been reset
|
24
|
-
content: "To protect your personal information, we have reset the form and cleared your answers.\r\n\r\nThis is because you were inactive for
|
32
|
+
content: "To protect your personal information, we have reset the form and cleared your answers.\r\n\r\nThis is because you were inactive for 30 minutes."
|
25
33
|
restart_link: Start again
|
26
34
|
confirmation:
|
27
35
|
reference_number: 'Your reference number is:'
|
28
36
|
payment_enabled: You still need to pay
|
29
37
|
continue_to_pay_button: Continue to pay
|
30
38
|
application_complete: 'Application complete'
|
39
|
+
save_and_return:
|
40
|
+
save: 'Save for later'
|
41
|
+
show:
|
42
|
+
heading: 'Save for later'
|
43
|
+
description: 'We will send you a one-off link that you can use to resume this form within 28 days.'
|
44
|
+
email: 'Email address'
|
45
|
+
email_hint: 'Where we will send the link'
|
46
|
+
secret_question: 'Pick a security question'
|
47
|
+
secret_question_hint: 'We will use this to verify your identity when you return'
|
48
|
+
secret_answer: 'The answer to your security question'
|
49
|
+
continue: 'Continue with saving'
|
50
|
+
cancel: 'Cancel saving and resume form'
|
51
|
+
secret_questions:
|
52
|
+
one: "What is your mother's maiden name?"
|
53
|
+
two: 'What is the last name of your favourite teacher?'
|
54
|
+
three: 'What is the name of the hospital where you were born?'
|
31
55
|
footer:
|
32
56
|
cookies:
|
33
57
|
heading: "Cookies"
|
data/config/routes.rb
CHANGED
@@ -10,6 +10,9 @@ MetadataPresenter::Engine.routes.draw do
|
|
10
10
|
|
11
11
|
get 'session/expired', to: 'session#expired'
|
12
12
|
|
13
|
+
get 'save', to: 'save_and_return#show'
|
14
|
+
post 'saved_forms', to: 'save_and_return#create'
|
15
|
+
|
13
16
|
post '/', to: 'answers#create'
|
14
17
|
match '*path', to: 'answers#create', via: :post
|
15
18
|
match '*path', to: 'pages#show',
|
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.41
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MoJ Forms
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_design_system_formbuilder
|
@@ -257,6 +257,7 @@ files:
|
|
257
257
|
- app/controllers/metadata_presenter/engine_controller.rb
|
258
258
|
- app/controllers/metadata_presenter/file_controller.rb
|
259
259
|
- app/controllers/metadata_presenter/pages_controller.rb
|
260
|
+
- app/controllers/metadata_presenter/save_and_return_controller.rb
|
260
261
|
- app/controllers/metadata_presenter/service_controller.rb
|
261
262
|
- app/controllers/metadata_presenter/session_controller.rb
|
262
263
|
- app/controllers/metadata_presenter/submissions_controller.rb
|
@@ -287,6 +288,7 @@ files:
|
|
287
288
|
- app/models/metadata_presenter/previous_page.rb
|
288
289
|
- app/models/metadata_presenter/route.rb
|
289
290
|
- app/models/metadata_presenter/row_number.rb
|
291
|
+
- app/models/metadata_presenter/saved_form.rb
|
290
292
|
- app/models/metadata_presenter/service.rb
|
291
293
|
- app/models/metadata_presenter/traversed_pages.rb
|
292
294
|
- app/models/metadata_presenter/uploaded_file.rb
|
@@ -357,6 +359,9 @@ files:
|
|
357
359
|
- app/views/metadata_presenter/page/singlequestion.html.erb
|
358
360
|
- app/views/metadata_presenter/page/standalone.html.erb
|
359
361
|
- app/views/metadata_presenter/page/start.html.erb
|
362
|
+
- app/views/metadata_presenter/save_and_return/show.html.erb
|
363
|
+
- app/views/metadata_presenter/session/_timeout_fallback.html.erb
|
364
|
+
- app/views/metadata_presenter/session/_timeout_warning_modal.html.erb
|
360
365
|
- app/views/metadata_presenter/session/expired.html.erb
|
361
366
|
- config/initializers/default_metadata.rb
|
362
367
|
- config/initializers/default_text.rb
|