diff --git a/app/helpers/custom_form_helpers.rb b/app/helpers/custom_form_helpers.rb index d0a3f70fe..24792644a 100644 --- a/app/helpers/custom_form_helpers.rb +++ b/app/helpers/custom_form_helpers.rb @@ -21,6 +21,13 @@ def i18n_legend ) end + def i18n_date_hint(lead_text = i18n_lead_text) + safe_join([ + content_tag(:p, lead_text), + I18n.t("helpers/dictionary.date_hint_text").html_safe, + ]) + end + # Used to customise hints when reusing the same view # Hints support markup so ensure locale keys ends with `_html` def i18n_hint diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 72b0a3d10..b73e4730c 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -9,12 +9,6 @@ <%= render partial: 'layouts/gtm_noscript' if analytics_allowed? %> <% end %> -<% content_for(:service_name) do %> - <%= link_to service_name, root_path, - class: 'govuk-header__link govuk-header__service-name ga-pageLink', - data: { ga_category: 'header', ga_label: 'service name' }, id: 'header-service-name' %> -<% end %> - <% content_for(:cookie_banner) do %> <% unless analytics_consent_cookie.present? %> <%= render partial: 'layouts/cookie_banner' %> diff --git a/app/views/layouts/govuk_template.html.erb b/app/views/layouts/govuk_template.html.erb index 776453baa..a9989f8ca 100644 --- a/app/views/layouts/govuk_template.html.erb +++ b/app/views/layouts/govuk_template.html.erb @@ -34,7 +34,7 @@ <%= content_for?(:skip_link_message) ? yield(:skip_link_message) : 'Skip to main content' %> -<%= govuk_header(homepage_url: "https://www.gov.uk", service_name: yield(:service_name), service_url: "#") %> +<%= govuk_header(homepage_url: "https://www.gov.uk", service_name:, service_url: "/") %>
- This will help us to improve the service. + <%= link_to "Get in touch", about_contact_path %> to help us improve the service.
diff --git a/app/views/steps/conviction/compensation_payment_date/edit.html.erb b/app/views/steps/conviction/compensation_payment_date/edit.html.erb index 7ce054cf7..dd04643a9 100644 --- a/app/views/steps/conviction/compensation_payment_date/edit.html.erb +++ b/app/views/steps/conviction/compensation_payment_date/edit.html.erb @@ -8,9 +8,9 @@ <%= step_form @form_object do |f| %> <%= f.govuk_date_field :compensation_payment_date, maxlength_enabled: true, form_group: { class: 'app-util--compact-form-group' }, - caption: { text: f.i18n_caption } do - tag.p t('.lead_text'), class: 'govuk-body-m' - end %> + caption: { text: f.i18n_caption }, + hint: { text: f.i18n_date_hint(t('.lead_text')) } + %> <%= render partial: 'steps/shared/approx_date_checkbox', locals: { form: f, attribute: :approximate_compensation_payment_date diff --git a/app/views/steps/conviction/conviction_date/edit.html.erb b/app/views/steps/conviction/conviction_date/edit.html.erb index 4c652f7ae..b071bc041 100644 --- a/app/views/steps/conviction/conviction_date/edit.html.erb +++ b/app/views/steps/conviction/conviction_date/edit.html.erb @@ -6,9 +6,10 @@ <%= govuk_error_summary %> <%= step_form @form_object do |f| %> - <%= f.govuk_date_field :conviction_date, maxlength_enabled: true, form_group: { class: 'app-util--compact-form-group' } do - tag.p t('.lead_text'), class: 'govuk-body-m' - end %> + <%= f.govuk_date_field :conviction_date, maxlength_enabled: true, + form_group: { class: 'app-util--compact-form-group' }, + hint: { text: f.i18n_date_hint(t('.lead_text')) } + %> <%= render partial: 'steps/shared/approx_date_checkbox', locals: { form: f, attribute: :approximate_conviction_date diff --git a/app/views/steps/conviction/known_date/edit.html.erb b/app/views/steps/conviction/known_date/edit.html.erb index 503973d3f..6490f6ece 100644 --- a/app/views/steps/conviction/known_date/edit.html.erb +++ b/app/views/steps/conviction/known_date/edit.html.erb @@ -8,9 +8,9 @@ <%= step_form @form_object do |f| %> <%= f.govuk_date_field :known_date, maxlength_enabled: true, form_group: { class: 'app-util--compact-form-group' }, + hint: { text: f.i18n_date_hint }, legend: { text: f.i18n_legend }, caption: { text: f.i18n_caption } do - tag.p f.i18n_lead_text, class: 'govuk-body-m' end %> <%= render partial: 'steps/shared/approx_date_checkbox', locals: { diff --git a/config/locales/en/helpers.yml b/config/locales/en/helpers.yml index 35fd3e479..c3eb75b5a 100644 --- a/config/locales/en/helpers.yml +++ b/config/locales/en/helpers.yml @@ -177,14 +177,6 @@ en: steps_check_under_age_form: caution_html: Select your age when you got the caution, not when you committed the offence conviction_html: Select your age when you got convicted, not when you committed the offence - steps_caution_conditional_end_date_form: - conditional_end_date_html: *date_hint_text - steps_conviction_conviction_date_form: - conviction_date_html: *date_hint_text - steps_conviction_known_date_form: - known_date_html: *date_hint_text - steps_conviction_compensation_payment_date_form: - compensation_payment_date_html: *date_hint_text steps_conviction_motoring_endorsement_form: motoring_endorsement: An endorsement means that your conviction is recorded on your driving licence. Endorsements are usually given by courts. steps_conviction_conviction_subtype_form: diff --git a/features/fixtures/files/steps_conviction_known_date.html b/features/fixtures/files/steps_conviction_known_date.html index 69f5e5a35..cfe99410a 100644 --- a/features/fixtures/files/steps_conviction_known_date.html +++ b/features/fixtures/files/steps_conviction_known_date.html @@ -1,13 +1,12 @@