[forms] Fix HTableFormRenderer _render_fields method behavior when display_label is False.
Indeed, now the extra <tr><th>...</th></tr> are not inserted anymore unless
display_label is True.
Closes #3811325.
--- a/cubicweb/web/views/formrenderers.py Tue Mar 17 15:21:29 2015 +0100
+++ b/cubicweb/web/views/formrenderers.py Tue May 06 17:45:37 2014 +0200
@@ -312,15 +312,15 @@
display_help = False
def _render_fields(self, fields, w, form):
w(u'<table border="0" class="htableForm">')
- w(u'<tr>')
- for field in fields:
- if self.display_label:
+ if self.display_label:
+ w(u'<tr>')
+ for field in fields:
w(u'<th class="labelCol">%s</th>' % self.render_label(form, field))
- if self.display_help:
- w(self.render_help(form, field))
- # empty slot for buttons
- w(u'<th class="labelCol"> </th>')
- w(u'</tr>')
+ if self.display_help:
+ w(self.render_help(form, field))
+ # empty slot for buttons
+ w(u'<th class="labelCol"> </th>')
+ w(u'</tr>')
w(u'<tr>')
for field in fields:
error = form.field_error(field)