mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-15 19:01:04 -04:00
The grouping on this page was weird because these links were two far away from the associated textbox, and too close to the next textbox. This commit adds them as parameters to the textbox macro, which means their relative spacing can be controlled exactly, and thus reduced.
27 lines
867 B
HTML
27 lines
867 B
HTML
{% macro textbox(field, hint=False, highlight_tags=False, help_link=None, help_link_text=None) %}
|
|
<div class="form-group{% if field.errors %} error{% endif %}">
|
|
<label class="form-label" for="{{ field.name }}">
|
|
{{ field.label }}
|
|
{% if hint %}
|
|
<span class="form-hint">
|
|
{{ hint }}
|
|
</span>
|
|
{% endif %}
|
|
{% if field.errors %}
|
|
<span class="error-message">
|
|
{{ field.errors[0] }}
|
|
</span>
|
|
{% endif %}
|
|
</label>
|
|
{{ field(**{
|
|
'class': 'form-control textbox-highlight-textbox' if highlight_tags else 'form-control',
|
|
'data-module': 'highlight-tags' if highlight_tags else ''
|
|
}) }}
|
|
{% if help_link and help_link_text %}
|
|
<p class="textbox-help-link">
|
|
<a href='{{ help_link }}'>{{ help_link_text }}</a>
|
|
</p>
|
|
{% endif %}
|
|
</div>
|
|
{% endmacro %}
|