-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[refs #318] Update Nunjucks templates and READMEs
Added Nunjucks options for emergency alert and feedback banner components. Tidied up code for the other components. Components amended: - details - do-dont-lists - emergency alert - error message - error summary - feedback banner
- Loading branch information
1 parent
8a40a7d
commit c523ea5
Showing
10 changed files
with
80 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
<details class="nhsuk-details{%- if params.classes %} {{ params.classes }}{% endif %}" | ||
<details class="nhsuk-details | ||
{%- if params.classes %} {{ params.classes }}{% endif %}" | ||
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}> | ||
<summary class="nhsuk-details__summary"> | ||
<span class="nhsuk-details__summary-text"> | ||
{{ params.text }} | ||
</span> | ||
</summary> | ||
<div class="nhsuk-details__text"> | ||
{{ params.HTML | safe }} | ||
{{- params.HTML | safe }} | ||
</div> | ||
</details> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
{% set headingLevel = params.headingLevel if params.headingLevel else 3 %} | ||
<div class="nhsuk-do-dont-list{% if params.classes %} {{ params.classes }}{% endif %}"{% for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}> | ||
<div class="nhsuk-do-dont-list | ||
{%- if params.classes %} {{ params.classes }}{% endif %}" | ||
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}> | ||
<h{{ headingLevel }} class="nhsuk-do-dont-list__label">{{ params.title }}</h{{ headingLevel }}> | ||
<ul class="nhsuk-list {% if params.type == 'tick' %}nhsuk-list--tick{% else %}nhsuk-list--cross{% endif %}"> | ||
{% for data in params.items %} | ||
<li> | ||
{% if params.type == 'cross' %} | ||
<svg class="nhsuk-icon nhsuk-icon__cross" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true"> | ||
<path d="M17 18.5c-.4 0-.8-.1-1.1-.4l-10-10c-.6-.6-.6-1.6 0-2.1.6-.6 1.5-.6 2.1 0l10 10c.6.6.6 1.5 0 2.1-.3.3-.6.4-1 .4z"></path> | ||
<path d="M7 18.5c-.4 0-.8-.1-1.1-.4-.6-.6-.6-1.5 0-2.1l10-10c.6-.6 1.5-.6 2.1 0 .6.6.6 1.5 0 2.1l-10 10c-.3.3-.6.4-1 .4z"></path> | ||
</svg> | ||
{% else %} | ||
<svg class="nhsuk-icon nhsuk-icon__tick" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" aria-hidden="true" > | ||
<path stroke-width="4" stroke-linecap="round" d="M18.4 7.8l-8.5 8.4L5.6 12"></path> | ||
</svg> | ||
{% endif %} | ||
<ul class="nhsuk-list {% if params.type == 'tick' %}nhsuk-list--tick{% else %}nhsuk-list--cross{% endif %}"> | ||
{%- for data in params.items %} | ||
<li> | ||
{%- if params.type == 'cross' %} | ||
<svg class="nhsuk-icon nhsuk-icon__cross" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true"> | ||
<path d="M17 18.5c-.4 0-.8-.1-1.1-.4l-10-10c-.6-.6-.6-1.6 0-2.1.6-.6 1.5-.6 2.1 0l10 10c.6.6.6 1.5 0 2.1-.3.3-.6.4-1 .4z"></path> | ||
<path d="M7 18.5c-.4 0-.8-.1-1.1-.4-.6-.6-.6-1.5 0-2.1l10-10c.6-.6 1.5-.6 2.1 0 .6.6.6 1.5 0 2.1l-10 10c-.3.3-.6.4-1 .4z"></path> | ||
</svg> | ||
{%- else %} | ||
<svg class="nhsuk-icon nhsuk-icon__tick" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" aria-hidden="true" > | ||
<path stroke-width="4" stroke-linecap="round" d="M18.4 7.8l-8.5 8.4L5.6 12"></path> | ||
</svg> | ||
{%- endif %} | ||
{% if params.type == 'cross' %}do not {% endif %}{{ data.item | safe}} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</li> | ||
{%- endfor %} | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
<span {%- if params.id %} id="{{ params.id }}"{% endif %} class="nhsuk-error-message{%- if params.classes %} {{ params.classes }}{% endif %}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}> | ||
<span {%- if params.id %} id="{{ params.id }}"{% endif %} class="nhsuk-error-message | ||
{%- if params.classes %} {{ params.classes }}{% endif %}" | ||
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}> | ||
{{ params.html | safe if params.html else params.text }} | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
<div class="nhsuk-error-summary{%- if params.classes %} {{ params.classes }}{% endif %}" aria-labelledby="error-summary-title" role="alert" tabindex="-1" | ||
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %} data-module="error-summary"> | ||
<div class="nhsuk-error-summary | ||
{%- if params.classes %} {{ params.classes }}{% endif %}" aria-labelledby="error-summary-title" role="alert" tabindex="-1" | ||
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}> | ||
<h2 class="nhsuk-error-summary__title" id="error-summary-title"> | ||
{{ params.titleHtml | safe if params.titleHtml else params.titleText }} | ||
</h2> | ||
<div class="nhsuk-error-summary__body"> | ||
{% if params.descriptionHtml or params.descriptionText %} | ||
{%- if params.descriptionHtml or params.descriptionText %} | ||
<p> | ||
{{ params.descriptionHtml | safe if params.descriptionHtml else params.descriptionText }} | ||
</p> | ||
{% endif %} | ||
{% endif -%} | ||
<ul class="nhsuk-list nhsuk-error-summary__list"> | ||
{% for item in params.errorList %} | ||
{%- for item in params.errorList %} | ||
<li> | ||
{% if item.href %} | ||
{%- if item.href %} | ||
<a href="{{ item.href }}"{% for attribute, value in item.attributes %} {{attribute}}="{{value}}"{% endfor %}>{{ item.html | safe if item.html else item.text }}</a> | ||
{% else %} | ||
{{ item.html | safe if item.html else item.text }} | ||
{% endif %} | ||
{%- endif -%} | ||
</li> | ||
{% endfor %} | ||
{%- endfor %} | ||
</ul> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters