0001-forms-don-t-use-label-for-field-title-when-used-in-f.patch
wcs/qommon/form.py | ||
---|---|---|
108 | 108 |
if self.required: |
109 | 109 |
title += htmltext('<span title="%s" class="required">*</span>') % _( |
110 | 110 |
'This field is required.') |
111 |
return htmltext('<div class="title"><label for="form_%s">%s</label></div>') % ( |
|
112 |
self.name, title) |
|
111 |
if getattr(self, 'has_inside_labels', False): |
|
112 |
return htmltext('<div class="title"><span>%s</span></div>') % title |
|
113 |
else: |
|
114 |
return htmltext('<div class="title"><label for="form_%s">%s</label></div>') % ( |
|
115 |
self.name, title) |
|
113 | 116 |
else: |
114 | 117 |
return '' |
115 | 118 | |
... | ... | |
210 | 213 | |
211 | 214 |
class RadiobuttonsWidget(quixote.form.RadiobuttonsWidget): |
212 | 215 |
template_name = 'qommon/forms/widgets/radiobuttons.html' |
216 |
has_inside_labels = True |
|
213 | 217 | |
214 | 218 |
def __init__(self, name, value=None, **kwargs): |
215 | 219 |
self.options_with_attributes = kwargs.pop('options_with_attributes', None) |
... | ... | |
1107 | 1111 |
class CheckboxesWidget(CompositeWidget): |
1108 | 1112 |
readonly = False |
1109 | 1113 |
template_name = 'qommon/forms/widgets/checkboxes.html' |
1114 |
has_inside_labels = True |
|
1110 | 1115 | |
1111 | 1116 |
def __init__(self, name, value=None, options=None, **kwargs): |
1112 | 1117 |
CompositeWidget.__init__(self, name, value, **kwargs) |
... | ... | |
1770 | 1775 | |
1771 | 1776 |
class RankedItemsWidget(CompositeWidget): |
1772 | 1777 |
readonly = False |
1778 |
has_inside_labels = True |
|
1773 | 1779 | |
1774 | 1780 |
def __init__(self, name, value=None, elements=None, **kwargs): |
1775 | 1781 |
CompositeWidget.__init__(self, name, value, **kwargs) |
1776 |
- |