Skip to content

Commit

Permalink
Merge pull request #1141 from alphagov/release-2.5.1
Browse files Browse the repository at this point in the history
Release v2.5.1
  • Loading branch information
NickColley authored Jan 16, 2019
2 parents f704053 + 8dcbc85 commit fdf62ac
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 21 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

([PR #N](https://github.com/alphagov/govuk-frontend/pull/N))

## 2.5.1 (Fix release)

🔧 Fixes:

- Update summary list to simplify actions

Only output actions in a list when there's multiple actions.
Expand Down
2 changes: 1 addition & 1 deletion dist/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.0
2.5.1

Large diffs are not rendered by default.

File renamed without changes.

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions package/components/summary-list/_summary-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
margin-bottom: govuk-spacing(3);
@include govuk-media-query($from: tablet) {
padding-right: 0;
text-align: right;
}
}

Expand Down Expand Up @@ -80,10 +81,6 @@
width: 100%;
margin: 0; // Reset default user agent styles
padding: 0; // Reset default user agent styles

@include govuk-media-query($from: tablet) {
text-align: right;
}
}

.govuk-summary-list__actions-list-item {
Expand Down
33 changes: 20 additions & 13 deletions package/components/summary-list/template.njk
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
{%- macro _actionLink(action) %}
<a class="govuk-link" href="{{ action.href }}">
{{ action.html | safe if action.html else action.text }}
{%- if action.visuallyHiddenText -%}
<span class="govuk-visually-hidden"> {{ action.visuallyHiddenText }}</span>
{% endif -%}
</a>
{% endmacro -%}
<dl class="govuk-summary-list {%- if params.classes %} {{ params.classes }}{% endif %}"{% for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
{% for row in params.rows %}
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key {%- if row.key.classes %} {{ row.key.classes }}{% endif %}">
{{ row.key.html | safe if row.key.html else row.key.text }}
</dt>
<dd class="govuk-summary-list__value {%- if row.value.classes %} {{ row.value.classes }}{% endif %}">
{{ row.value.html | safe if row.value.html else row.value.text }}
{{ row.value.html | indent(8) | trim | safe if row.value.html else row.value.text }}
</dd>
{% if row.actions.items %}
<dd class="govuk-summary-list__actions {%- if row.actions.classes %} {{ row.actions.classes }}{% endif %}">
<ul class="govuk-summary-list__actions-list">
{% for action in row.actions.items %}
<li class="govuk-summary-list__actions-list-item">
<a class="govuk-link" href="{{ action.href }}">
{{ action.html | safe if action.html else action.text }}
{%- if action.visuallyHiddenText -%}
<span class="govuk-visually-hidden"> {{ action.visuallyHiddenText }}</span>
{%- endif %}
</a>
</li>
{% endfor %}
</ul>
{% if row.actions.items.length == 1 %}
{{ _actionLink(row.actions.items[0]) | indent(12) | trim }}
{% else %}
<ul class="govuk-summary-list__actions-list">
{% for action in row.actions.items %}
<li class="govuk-summary-list__actions-list-item">
{{ _actionLink(action) | indent(18) | trim }}
</li>
{% endfor %}
</ul>
{% endif %}
</dd>
{% endif %}
</div>
Expand Down
2 changes: 1 addition & 1 deletion package/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "govuk-frontend",
"description": "GOV.UK Frontend contains the code you need to start building a user interface for government platforms and services.",
"version": "2.5.0",
"version": "2.5.1",
"main": "all.js",
"sass": "all.scss",
"engines": {
Expand Down

0 comments on commit fdf62ac

Please sign in to comment.