Skip to content

Commit

Permalink
Merge pull request #1073 from alphagov/summary_list-allow-borderless
Browse files Browse the repository at this point in the history
Allow summary_list to render without borders
  • Loading branch information
ChrisBAshton authored Aug 30, 2019
2 parents 35adb3f + f455ca6 commit 9f1d4d5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
useful summary for people upgrading their application, not a replication
of the commit log.

## unreleased

* Allow summary_list to render without borders (PR #1073)

## 18.3.1

* Adjust share links column width (PR #1074)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<%
id ||= nil
title ||= nil
borderless ||= false
edit ||= {}
items ||= []
block ||= yield
%>
<% if title || items.any? %>
<%= tag.div class: "gem-c-summary-list", id: id do %>
<%= tag.div class: "gem-c-summary-list #{"govuk-summary-list--no-border" if borderless}", id: id do %>
<% if title %>
<%= tag.h3 title, class: "govuk-heading-m" %>
<% if edit.any? %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ examples:
- field: "Summary"
value: "Find out more about our reviews on the subject of ethical standards for public service providers, including our 2014 report, 2015 guidance and 2018 follow-up publication."

without_borders:
data:
borderless: true
title: "Title, summary and body"
items:
- field: "Title"
value: "Ethical standards for public service providers"
- field: "Summary"
value: "Find out more about our reviews on the subject of ethical standards for public service providers, including our 2014 report, 2015 guidance and 2018 follow-up publication."

with_edit_on_section:
data:
title: "Title, summary and body"
Expand Down
8 changes: 8 additions & 0 deletions spec/components/summary_list_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ def component_name
assert_select '.gem-c-summary__block', text: 'Some HTML'
end

it "renders without borders" do
render_component(
title: 'Title, summary and body',
borderless: true
)
assert_select '.gem-c-summary-list.govuk-summary-list--no-border'
end

it "renders items" do
render_component(
items: [
Expand Down

0 comments on commit 9f1d4d5

Please sign in to comment.