Paul Robert Lloyd
3 years ago
committed by
GitHub
2 changed files with 23 additions and 5 deletions
@ -1,10 +1,12 @@ |
|||||||
module DetailsTableHelper |
module DetailsTableHelper |
||||||
def details_html(attribute) |
def details_html(attribute) |
||||||
if attribute[:format] == :bullet |
if attribute[:format] == :bullet && attribute[:value].length > 1 |
||||||
list = attribute[:value].map { |la| "<li>#{la}</li>" }.join |
list = attribute[:value].map { |value| "<li>#{value}</li>" }.join |
||||||
simple_format(list, { class: "govuk-list govuk-list--bullet" }, wrapper_tag: "ul") |
simple_format(list, { class: "govuk-list govuk-list--bullet" }, wrapper_tag: "ul") |
||||||
else |
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 |
end |
||||||
end |
end |
||||||
|
Loading…
Reference in new issue