2016-01-11 13:15:10 +00:00
|
|
|
{% macro textbox(field, hint=False, highlight_tags=False) %}
|
|
|
|
|
<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 ''
|
|
|
|
|
}) }}
|
2015-12-20 00:00:01 +00:00
|
|
|
</div>
|
|
|
|
|
{% endmacro %}
|