2016-02-02 15:31:11 +00:00
|
|
|
{% macro textbox(field, hint=False, highlight_tags=False, help_link=None, help_link_text=None, width='2-3') %}
|
2016-01-11 13:15:10 +00:00
|
|
|
<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(**{
|
2016-02-02 15:31:11 +00:00
|
|
|
'class': 'form-control form-control-{} textbox-highlight-textbox'.format(width) if highlight_tags else 'form-control form-control-{}'.format(width),
|
2016-01-11 13:15:10 +00:00
|
|
|
'data-module': 'highlight-tags' if highlight_tags else ''
|
|
|
|
|
}) }}
|
2016-02-02 15:12:59 +00:00
|
|
|
{% if help_link and help_link_text %}
|
|
|
|
|
<p class="textbox-help-link">
|
|
|
|
|
<a href='{{ help_link }}'>{{ help_link_text }}</a>
|
|
|
|
|
</p>
|
|
|
|
|
{% endif %}
|
2015-12-20 00:00:01 +00:00
|
|
|
</div>
|
|
|
|
|
{% endmacro %}
|