% if 'csrf_token' in c.form.errors:
${_('Form validation failed due to: %s') % c.form.errors.pop('csrf_token')[0]}
% endif % for field in c.form: % if field.type == 'HiddenField' or field.type == 'CSRFTokenField': ${h.HTML.div(field, style="display: none;")} % else:
${field.label}
\ % if (field.type == 'TextField' and field.name != 'message_size' and field.name != 'port') or field.type == 'PasswordField': ${h.highlight_errors(field, size=50)}\ % elif field.type == 'IntegerField' or field.name == 'message_size' or field.name == 'port': ${h.highlight_errors(field, size=10)}\ % elif field.type == 'FileField': ${h.highlight_errors(field, size=30)}\ % elif field.type == 'TextAreaField': ${h.highlight_errors(field, style='height: 53px; width: 326px;')}\ % else: ${h.highlight_errors(field)}\ % endif
% if field.errors:
${u', '.join([unicode(ferr) for ferr in field.errors])}
% endif
% endif % endfor