mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-11 13:54:03 -05:00
These have been replaced: https://design-system.service.gov.uk/get-started/updating-your-code/#helper-class-names
50 lines
1.6 KiB
HTML
50 lines
1.6 KiB
HTML
{% macro list_entry(
|
|
field,
|
|
item_name,
|
|
hint='',
|
|
autocomplete=True
|
|
) %}
|
|
|
|
{% if error %}
|
|
<div class="validation-wrapper">
|
|
{% endif %}
|
|
<fieldset class="form-group{% if field.errors %} form-group-error{% endif %}" id="{{ field.name }}">
|
|
<legend>
|
|
<span class="form-label">
|
|
{{ field.label.text }}
|
|
{% if hint %}
|
|
<span class="form-hint">
|
|
{{ hint }}
|
|
</span>
|
|
{% endif %}
|
|
{% if field.errors %}
|
|
<span class="error-message" data-module="track-error" data-error-type="{{ field.errors[0][0] }}" data-error-label="{{ field.name }}">
|
|
{{ field.errors[0][0] }}
|
|
</span>
|
|
{% endif %}
|
|
</label>
|
|
</legend>
|
|
<div class="input-list" data-module="list-entry" data-list-item-name="{{ item_name }}" id="list-entry-{{ field.name }}">
|
|
{% for index in range(0, field.entries|length) %}
|
|
<div class="list-entry">
|
|
<label for="input-{{ field.name }}-{{ index }}" class="text-box-number-label">
|
|
<span class="govuk-visually-hidden">{{ item_name }} number </span>{{ index + 1 }}.
|
|
</label>
|
|
<input
|
|
type="text"
|
|
name="{{ field.name }}-{{ index }}"
|
|
id="input-{{ field.name }}-{{ index }}"
|
|
class="form-control form-control-1-1"
|
|
value="{{ field.data[index] }}"
|
|
{% if not autocomplete %}autocomplete="off"{% endif %}
|
|
/>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</fieldset>
|
|
{% if error %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|