web/formrenderers.py
branchstable
changeset 1863 9a02979a2c00
parent 1757 fbb9928bf4f1
child 1946 d60ddfc4bb09
equal deleted inserted replaced
1842:c7a22540d6f7 1863:9a02979a2c00
    81         if field.required:
    81         if field.required:
    82             attrs['class'] = 'required'
    82             attrs['class'] = 'required'
    83         return tags.label(label, **attrs)
    83         return tags.label(label, **attrs)
    84 
    84 
    85     def render_help(self, form, field):
    85     def render_help(self, form, field):
    86         help = [ u'<br/>' ]
    86 	help = []
    87         descr = field.help
    87         descr = field.help
    88         if descr:
    88         if descr:
    89             help.append('<span class="helper">%s</span>' % form.req._(descr))
    89             help.append('<div class="helper">%s</div>' % form.req._(descr))
    90         example = field.example_format(form.req)
    90         example = field.example_format(form.req)
    91         if example:
    91         if example:
    92             help.append('<span class="helper">(%s: %s)</span>'
    92             help.append('<div class="helper">(%s: %s)</div>'
    93                         % (form.req._('sample format'), example))
    93                         % (form.req._('sample format'), example))
    94         return u'&nbsp;'.join(help)
    94         return u'&nbsp;'.join(help)
    95 
    95 
    96     # specific methods (mostly to ease overriding) #############################
    96     # specific methods (mostly to ease overriding) #############################
    97 
    97