Sha256: 48782e59fba477e47793a71998b149c711b6e74c0e3e2ee24a36e6074cf9617b
Contents?: true
Size: 1.87 KB
Versions: 39
Compression:
Stored size: 1.87 KB
Contents
{% from "../error-message/macro.njk" import govukErrorMessage -%} {% from "../hint/macro.njk" import govukHint %} {% from "../label/macro.njk" import govukLabel %} {#- a record of other elements that we need to associate with the input using aria-describedby – for example hints or error messages -#} {% set describedBy = "" %} <div class="govuk-form-group {%- if params.errorMessage %} govuk-form-group--error{% endif %}"> {{ govukLabel({ html: params.label.html, text: params.label.text, classes: params.label.classes, isPageHeading: params.label.isPageHeading, attributes: params.label.attributes, for: params.id }) | indent(2) | trim }} {% if params.hint %} {% set hintId = params.id + '-hint' %} {% set describedBy = describedBy + ' ' + hintId if describedBy else hintId %} {{ govukHint({ id: hintId, classes: params.hint.classes, attributes: params.hint.attributes, html: params.hint.html, text: params.hint.text }) | indent(2) | trim }} {% endif %} {% if params.errorMessage %} {% set errorId = params.id + '-error' %} {% set describedBy = describedBy + ' ' + errorId if describedBy else errorId %} {{ govukErrorMessage({ id: errorId, classes: params.errorMessage.classes, html: params.errorMessage.html, text: params.errorMessage.text }) | indent(2) | trim }} {% endif %} <select class="govuk-select {%- if params.classes %} {{ params.classes }}{% endif %}{%- if params.errorMessage %} govuk-select--error{% endif %}" id="{{ params.id }}" name="{{ params.name }}" {%- if describedBy %} aria-describedby="{{ describedBy }}"{% endif %} {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}> {% for item in params.items %} <option value="{{ item.value }}"{{" selected" if item.selected}}{{" disabled" if item.disabled}}>{{ item.text }}</option> {% endfor %} </select> </div>
Version data entries
39 entries across 39 versions & 2 rubygems