Files
notifications-admin/app/templates/components/list-entry.html
Jonathan Bobel e0d2d74067 Update dashboard and template flow (#514)
* Updated header and footer
* Moved files around and updated gulpfile to correct the build process when it goes to production
* Updated fonts
* Adjusted grid templating
* Adding images to assets
* Updated account pages, dashboard, and pages in message sending flow
* Updated the styling for the landing pages in the account section once logged in
2023-06-08 13:12:00 -04:00

61 lines
1.9 KiB
HTML

{% from "components/uk_components/fieldset/macro.njk" import govukFieldset %}
{% from "components/uk_components/error-message/macro.njk" import govukErrorMessage %}
{% macro list_entry(
field,
item_name,
hint='',
autocomplete=True
) %}
<div class="govuk-form-group">
{% if hint %}
{% set attributes = {"aria-describedby": field.name + '-hint'} %}
{% else %}
{% set attributes = {} %}
{% endif %}
{% call govukFieldset({
"legend": {
"text": field.label.text,
"isPageHeading": False
},
"attributes": attributes
})
%}
{% if hint %}
<div id="{{ field.name }}-hint" class="usa-hint">
{{ hint }}
</div>
{% endif %}
<div class="input-list" data-module="list-entry" data-list-item-name="{{ item_name }}" id="list-entry-{{ field.name }}">
{% for entry in field.entries %}
<div class="list-entry">
{% if not autocomplete %}
{% set autocomplete = "off" %}
{% else %}
{% set autocomplete = "" %}
{% endif %}
{% if entry.errors %}
{% set label_classes = "govuk-input--numbered__label govuk-input--numbered__label--error" %}
{% else %}
{% set label_classes = "govuk-input--numbered__label" %}
{% endif %}
{% set field_name = field.name + "-" + loop.index|string %}
{{ entry(param_extensions={
"id": "input-" + field_name,
"name": field_name,
"label": {
"html": '<span class="govuk-visually-hidden">' + item_name + ' number </span>' + loop.index|string + '.',
"classes": label_classes
},
"classes": "govuk-input--numbered govuk-!-width-full",
"value": field.data[loop.index0],
"autocomplete": autocomplete
}) }}
</div>
{% endfor %}
</div>
{% endcall %}
{% endmacro %}