<%def name="renderControl(id_name, value, props)" > %if props.html_type == "checkbox": %else: %if getattr(props, 'html_help', False):

${props.html_help}

%endif %endif <%def name="buildform(schema, values, errors)"> <% values = values[schema.form_id] errors = errors[schema.form_id] %>
${caller.header()} %for i, field in enumerate(schema.form_order): <% props = schema.fields[field] field_id_name = "{}.{}".format(schema.form_id, field) %>
${self.renderControl(id_name = field_id_name, value=values.get(field, ""), props = props)} %if field in errors: ${errors[field]} %endif
%endfor
${caller.footer()}
<%def name="buildValidators(root)"> ${root}.find("form").each(function(index, form){ $(form).validate({ errorClass: "help-inline" ,errorElement: "span" ,highlight: function (element, errorClass, validClass) { $(element).closest(".control-group").addClass("error"); } , unhighlight: function (element, errorClass, validClass) { $(element).closest(".control-group").removeClass("error"); } }); });