Add field name as wrapper class name
This commit is contained in:
parent
ec0865b03f
commit
e78777f8e1
|
@ -72,7 +72,7 @@ class FormRenderer(renderers.FormRenderer):
|
||||||
label = HTML.tag('label', for_=name, c=label or prettify(name))
|
label = HTML.tag('label', for_=name, c=label or prettify(name))
|
||||||
inner = HTML.tag('div', class_='field', c=field)
|
inner = HTML.tag('div', class_='field', c=field)
|
||||||
|
|
||||||
outer_class = 'field-wrapper'
|
outer_class = 'field-wrapper {}'.format(name)
|
||||||
if errors:
|
if errors:
|
||||||
outer_class += ' error'
|
outer_class += ' error'
|
||||||
outer = HTML.tag('div', class_=outer_class, c=(errors or '') + label + inner)
|
outer = HTML.tag('div', class_=outer_class, c=(errors or '') + label + inner)
|
||||||
|
|
Loading…
Reference in a new issue