-
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 remaining component Nunjucks templates and READMEs
Tidied up code in Nunjucks templates and READMEs. For the radio component, removed the conditional parameter as this has not yet been implemented. Components amended: - error-message - promo - radios - review-review - select - skip-link - tables - textarea - warning-callout
- Loading branch information
1 parent
5550791
commit 9d711fe
Showing
10 changed files
with
88 additions
and
86 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
<span {%- if params.id %} id="{{ params.id }}"{% endif %} class="nhsuk-error-message | ||
<span class="nhsuk-error-message | ||
{%- if params.classes %} {{ params.classes }}{% endif %}" | ||
{%- if params.id %} id="{{ params.id }}"{% 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,14 +1,15 @@ | ||
<div class="nhsuk-promo {%- if params.classes %} {{ params.classes }}{% endif %}" | ||
<div class="nhsuk-promo | ||
{%- if params.classes %} {{ params.classes }}{% endif %}" | ||
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}> | ||
<a class="nhsuk-promo__link-wrapper" href="{{ params.href }}"> | ||
{% if params.imgURL %} | ||
<img class="nhsuk-promo__img" src="{{ params.imgURL }}" alt="{{ params.imgALT }}"/> | ||
{% endif %} | ||
{%- if params.imgURL %} | ||
<img class="nhsuk-promo__img" src="{{ params.imgURL }}" alt="{{ params.imgALT }}"> | ||
{%- endif %} | ||
<div class="nhsuk-promo__content"> | ||
<h3 class="nhsuk-promo__heading">{{ params.heading | safe }}</h3> | ||
{% if params.description %} | ||
{%- if params.description %} | ||
<p class="nhsuk-promo__description">{{ params.description | safe }}</p> | ||
{% endif %} | ||
{%- endif %} | ||
</div> | ||
</a> | ||
</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,8 +1,10 @@ | ||
{% if params.lastReview or params.nextReview %} | ||
<div class="nhsuk-review-date{%- if params.classes %} {{ params.classes }}{% endif %}"{% for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}> | ||
<div class="nhsuk-review-date | ||
{%- if params.classes %} {{ params.classes }}{% endif %}" | ||
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}> | ||
<p class="nhsuk-body-s"> | ||
{% if params.lastReview %}Page last reviewed: <time>{{ params.lastReview }}</time><br>{% endif %} | ||
{% if params.nextReview %}Next review due: <time>{{ params.nextReview }}</time>{% endif %} | ||
</p> | ||
</div> | ||
{% endif %} | ||
{%- endif %} |
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 +1,5 @@ | ||
<a class="nhsuk-skip-link{%- if params.classes %} {{ params.classes }}{% endif -%}" href="{% if params.href %}{{ params.href }}{% else %}#maincontent{% endif %}"{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>{% if params.text %}{{ params.text }}{% else %}Skip to main content{% endif %}</a> | ||
<a class="nhsuk-skip-link | ||
{%- if params.classes %} {{ params.classes }}{% endif %}" href=" | ||
{%- if params.href %}{{ params.href }}{% else %}#maincontent{% endif %}" | ||
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}> | ||
{%- if params.text %}{{ params.text }}{% else %}Skip to main content{% endif %}</a> |
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,51 +1,53 @@ | ||
{% set headingLevel = params.headingLevel if params.headingLevel else 3 %} | ||
{%- set headingLevel = params.headingLevel if params.headingLevel else 3 -%} | ||
{% if params.panel%} | ||
<div class="nhsuk-table__panel-with-heading-tab {%- if params.panelClasses %} {{ params.panelClasses }}{% endif %}"> | ||
{% if params.heading %} | ||
<div class="nhsuk-table__panel-with-heading-tab | ||
{%- if params.panelClasses %} {{ params.panelClasses }}{% endif %}"> | ||
{%- if params.heading %} | ||
<h{{ headingLevel }} class="nhsuk-table__heading-tab">{{ params.heading | safe }}</h{{ headingLevel }}> | ||
{% endif %} | ||
{% endif %} | ||
{%- endif %} | ||
{%- endif %} | ||
<div class="nhsuk-table-responsive"> | ||
<table class="nhsuk-table | ||
{%- if params.tableClasses %} {{ params.tableClasses }}{% endif %}"{% for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}> | ||
{% if params.caption %} | ||
{%- if params.tableClasses %} {{ params.tableClasses }}{% endif %}" | ||
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}> | ||
{%- if params.caption %} | ||
<caption class="nhsuk-table__caption | ||
{%- if params.captionClasses %} {{ params.captionClasses }}{% endif %}">{{ params.caption }}</caption> | ||
{% endif %} | ||
{% if params.head %} | ||
{%- endif %} | ||
{%- if params.head %} | ||
<thead class="nhsuk-table__head"> | ||
<tr class="nhsuk-table__row"> | ||
{% for item in params.head %} | ||
{%- for item in params.head %} | ||
<th class="nhsuk-table__header | ||
{%- if item.format %} nhsuk-table__header--{{ item.format }}{% endif %}" | ||
{%- if item.colspan %} colspan="{{ item.colspan }}"{% endif %} | ||
{%- if item.rowspan %} rowspan="{{ item.rowspan }}"{% endif %} scope="col">{{ item.html |safe if item.html else item.text }}</th> | ||
{% endfor %} | ||
{%- endfor %} | ||
</tr> | ||
</thead> | ||
{% endif %} | ||
{%- endif %} | ||
<tbody class="nhsuk-table__body"> | ||
{% for row in params.rows %} | ||
{%- for row in params.rows %} | ||
<tr class="nhsuk-table__row"> | ||
{% for cell in row %} | ||
{% if loop.first and params.firstCellIsHeader %} | ||
{%- for cell in row %} | ||
{%- if loop.first and params.firstCellIsHeader %} | ||
<th class="nhsuk-table__header" scope="row">{{ cell.html | safe if cell.html else cell.text }}</th> | ||
{% elseif loop.first %} | ||
{%- elseif loop.first %} | ||
<td class="nhsuk-table__cell | ||
{%- if cell.format %} nhsuk-table__cell--{{ cell.format }}{% endif %}" | ||
{%- if cell.colspan %} colspan="{{ cell.colspan }}"{% endif %} | ||
{%- if cell.rowspan %} rowspan="{{ cell.rowspan }}"{% endif %}>{{ cell.html | safe if cell.html else cell.text }}</td> | ||
{% else %} | ||
{%- else %} | ||
<td class="nhsuk-table__cell {% if cell.format %}nhsuk-table__cell--{{ cell.format }}{% endif %}" | ||
{%- if cell.colspan %} colspan="{{ cell.colspan }}"{% endif %} | ||
{%- if cell.rowspan %} rowspan="{{ cell.rowspan }}"{% endif %}>{{ cell.html | safe if cell.html else cell.text }}</td> | ||
{% endif %} | ||
{% endfor %} | ||
{%- endif %} | ||
{%- endfor %} | ||
</tr> | ||
{% endfor %} | ||
{%- endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
{% if params.panel%} | ||
{%- if params.panel %} | ||
</div> | ||
{% endif %} | ||
{%- endif %} |
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