Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update summary list to simplify actions #1131

Merged
merged 4 commits into from
Jan 15, 2019

Conversation

NickColley
Copy link
Contributor

While my head is still in this component I thought I'd see if we can only output actions in a list when there's multiple actions.

This means in the most common case of a single action the markup is simpler.

Closes #1128

Only render a list when there are more than one action.
Since links wont always be in a list, move the right alignment to the parent.
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-1131 January 14, 2019 11:30 Inactive
<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 }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent and trim filters is just to make the output markup easier to read

Copy link

@dashouse dashouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great addition

@joelanman
Copy link
Contributor

Yeh this is great work, thanks @NickColley !

Copy link
Contributor

@36degrees 36degrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@NickColley NickColley merged commit f704053 into master Jan 15, 2019
@NickColley NickColley deleted the update-summary-list-to-simplify-actions branch January 15, 2019 17:25
@NickColley NickColley mentioned this pull request Jan 16, 2019
@NickColley NickColley added this to the 2.5.1 milestone Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

5 participants