From 83b399ea4d64f4ec9c04d242ec3d70cded0cbfa1 Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Tue, 26 Apr 2022 17:17:26 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20use=20bullet=20list=20if=20only?= =?UTF-8?q?=20one=20value=20returned?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/details_table_helper.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/helpers/details_table_helper.rb b/app/helpers/details_table_helper.rb index db569102d..b436cab38 100644 --- a/app/helpers/details_table_helper.rb +++ b/app/helpers/details_table_helper.rb @@ -1,10 +1,12 @@ module DetailsTableHelper def details_html(attribute) - if attribute[:format] == :bullet - list = attribute[:value].map { |la| "
  • #{la}
  • " }.join + if attribute[:format] == :bullet && attribute[:value].length > 1 + list = attribute[:value].map { |value| "
  • #{value}
  • " }.join simple_format(list, { class: "govuk-list govuk-list--bullet" }, wrapper_tag: "ul") else - simple_format(attribute[:value].to_s, {}, wrapper_tag: "div") + value = attribute[:value].is_a?(Array) ? attribute[:value].first : attribute[:value] + + simple_format(value.to_s, { class: "govuk-body" }, wrapper_tag: "p") end end end