Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Correctly render form errors in formset

Roland Geiderb2811168548d
diff --git a/wger/manager/templates/set/formset.html b/wger/manager/templates/set/formset.html
index ba8b2e2b9..c36b0c13f 100644
--- a/wger/manager/templates/set/formset.html
+++ b/wger/manager/templates/set/formset.html
@@ -17,7 +17,7 @@
{% endif %}
{% if forloop.parentloop.first %}
- <div class="col-xs-4">
+ <div class="col-xs-3">
{{ i.label }}
{% if not i.field.required %}
<br>
@@ -39,7 +39,7 @@
{% endif %}
{% if not i.is_hidden %}
- <div class="col-xs-4">
+ <div class="col-xs-3 {% if i.errors %}has-error{% endif %}">
{% endif %}
{# Field elements #}
@@ -49,6 +49,14 @@
{{i|form_field_add_css:'form-control'}}
{% endif %}
+ {% for error in i.errors %}
+ <div {% if i.errors %}class="has-error has-feedback"{% endif %}>
+ <span class="help-block">
+ <p>{% trans error %}</p>
+ </span>
+ </div>
+ {% endfor %}
+
{% if not i.is_hidden %}
</div>
{% endif %}