-
Notifications
You must be signed in to change notification settings - Fork 327
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
Conversation
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.
<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 }} |
There was a problem hiding this comment.
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
There was a problem hiding this 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
Yeh this is great work, thanks @NickColley ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
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