From 7728af242595b7deb190080b5874c1ee0c8a9010 Mon Sep 17 00:00:00 2001 From: Jan Mikolajczak Date: Fri, 15 Mar 2019 17:26:39 +0000 Subject: [PATCH] Port over addition of hidden "Error: " to error messages See https://github.com/alphagov/govuk-frontend/pull/1221 --- .../app/views/components/_govuk_error_message.html.slim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shared-web/app/views/components/_govuk_error_message.html.slim b/shared-web/app/views/components/_govuk_error_message.html.slim index cae502776f..e548e013cb 100644 --- a/shared-web/app/views/components/_govuk_error_message.html.slim +++ b/shared-web/app/views/components/_govuk_error_message.html.slim @@ -2,4 +2,8 @@ / https://github.com/alphagov/govuk-frontend/ / blob/943ff14752f0a8a765ee3f90bc3e1ecd9205e36c/src/components/error-message/template.njk span.govuk-error-message *(local_assigns[:attributes] || {}) id=local_assigns[:id] class=local_assigns[:classes] + / Not using `.presence` or `||` here as we want to treat "" and nil differently. + - visually_hidden_text = local_assigns[:visuallyHiddenText].nil? ? "Error" : local_assigns[:visuallyHiddenText] + - if visually_hidden_text.present? + span.govuk-visually-hidden = "#{visually_hidden_text}: " = local_assigns[:html] || local_assigns[:text]