forms: always use <label> for field label, for now (#40653)

This commit is contained in:
Frédéric Péters 2020-03-11 15:14:46 +01:00
parent a56ae27bcb
commit f55bcd64ea
1 changed files with 2 additions and 5 deletions

View File

@ -108,11 +108,8 @@ def render_title(self, title):
if self.required:
title += htmltext('<span title="%s" class="required">*</span>') % _(
'This field is required.')
if getattr(self, 'has_inside_labels', False):
return htmltext('<div class="title"><span>%s</span></div>') % title
else:
return htmltext('<div class="title"><label for="form_%s">%s</label></div>') % (
self.name, title)
return htmltext('<div class="title"><label class="field--label" '
'for="form_%s">%s</label></div>') % (self.name, title)
else:
return ''