Add field name as wrapper class name

This commit is contained in:
Lance Edgar 2018-01-05 17:12:42 -06:00
parent ec0865b03f
commit e78777f8e1

View file

@ -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)