Commit ba2a3b40 authored by Greg Kempe's avatar Greg Kempe

Fix display of form errors for bootstrap 3.

parent c2bb3aca
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
{# ---------------------- Forms -------------------------- #} {# ---------------------- Forms -------------------------- #}
{% macro render_field(form, field, kwargs={}, caller=None) %} {% macro render_field(form, field, kwargs={}, caller=None) %}
{% set direct_error = h.is_field_error(field.errors) %} {% set direct_error = h.is_field_error(field.errors) %}
<div class="form-group{{ ' error' if direct_error else '' }}"> <div class="form-group{{ ' has-error' if direct_error else '' }}">
<label for="{{ field.id }}" class="col-md-2 control-label">{{ field.label.text }} <label for="{{ field.id }}" class="col-md-2 control-label">{{ field.label.text }}
{% if h.is_required_form_field(field) %} {% if h.is_required_form_field(field) %}
<strong style="color: red">&#42;</strong> <strong style="color: red">&#42;</strong>
...@@ -91,14 +91,14 @@ ...@@ -91,14 +91,14 @@
{% if field.description %} {% if field.description %}
<p class="help-block">{{ field.description }}</p> <p class="help-block">{{ field.description }}</p>
{% endif %} {% endif %}
{% if direct_error %}
<ul class="help-block input-errors">
{% for e in field.errors if e is string %}
<li>{{ e }}</li>
{% endfor %}
</ul>
{% endif %}
</div> </div>
{% if direct_error %}
<ul{% if direct_error %} class="input-errors"{% endif %}>
{% for e in field.errors if e is string %}
<li>{{ e }}</li>
{% endfor %}
</ul>
{% endif %}
{% if caller %} {% if caller %}
{{ caller(form, field, direct_error, kwargs) }} {{ caller(form, field, direct_error, kwargs) }}
{% endif %} {% endif %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment