Reorganize macros into separate component files

Replace a few old UI Module instances with  macros
This commit is contained in:
Andrew Croce
2018-08-03 10:35:04 -04:00
parent a7eb915771
commit 5e8183aaf1
29 changed files with 198 additions and 298 deletions

View File

@@ -0,0 +1,27 @@
{% macro OptionsInput(field, inline=False) -%}
<div class='usa-input {% if errors %}usa-input--error{% endif %}'>
<fieldset class="usa-input__choices {% if inline %}usa-input__choices--inline{% endif %}">
<legend>
{{ field.label }}
{% if field.description %}
<span class='usa-input__help'>{{ field.description | safe }}</span>
{% endif %}
{% if field.errors %}
{{ Icon('alert') }}
{% endif %}
</legend>
{{ field() }}
{% if field.errors %}
{% for error in field.errors %}
<span class='usa-input__message'>{{ error }}</span>
{% endfor %}
{% endif %}
</fieldset>
</div>
{%- endmacro %}