Fix form errors and hidden form errors
authorSverre Rabbelier <srabbelier@gmail.com>
Thu, 22 Jan 2009 16:01:51 +0000
changeset 899 91a43d0aa29a
parent 898 adf5b7e98dcf
child 900 0b416bb14970
Fix form errors and hidden form errors The conversion to django left out the 'prettyfying' of form and hidden form errors, as these could occur when running live, restore this behavior. Patch by: Sverre Rabbelier
app/soc/templates/soc/templatetags/_as_table.html
--- a/app/soc/templates/soc/templatetags/_as_table.html	Thu Jan 22 13:50:25 2009 +0000
+++ b/app/soc/templates/soc/templatetags/_as_table.html	Thu Jan 22 16:01:51 2009 +0000
@@ -13,8 +13,18 @@
 {% endcomment %}
 {% load forms_helpers %}
 
-{{ top_errors }}
-{{ hidden_field_errors }}
+{% if hidden_field_errors or top_errors %}
+<ul class="errorlist">
+{% for field, error in hidden_field_errors %}
+<li><span class="formfielderrorlabel">
+(Hidden field {{ field }}) {{ error }}
+</span></li>
+{% endfor %}
+{% for error in top_errors %}
+<li><span class="formfielderrorlabel"> {{ error }} </span></li>
+{% endfor %}
+</ul>
+{% endif %}
 
 {% for field, required, example_text in fields %}
   {% block fields_loop %}