compass-core/compass/templates/macros.jinja
grace.yu 4c69d120cd Add initial code for user authentication
Change-Id: Ie0c439244f1ae3af707b73ef64b1a411c2aede20
2014-04-14 18:13:04 -07:00

14 lines
386 B
Django/Jinja

{% macro with_errors(field) -%}
<div class="control-group{% if field.errors %} error{% endif %}">
{{ field.label(class_='control-label') }}
<div class=controls>
{{ field(**kwargs) }}
{% if field.errors %}
{% for error in field.errors %}
<span class=text-error>{{ error }}</span>
{% endfor %}
{% endif %}
</div>
</div>
{%- endmacro %}