0001-forms-add-span-to-radiobuttons-checkboxes-widgets-13.patch
wcs/qommon/form.py | ||
---|---|---|
216 | 216 |
options = self.options_with_attributes |
217 | 217 |
include_disabled = True |
218 | 218 | |
219 |
tags = []
|
|
220 |
for option in options:
|
|
219 |
r = TemplateIO(html=True)
|
|
220 |
for i, option in enumerate(options):
|
|
221 | 221 |
object, description, key = option[:3] |
222 |
label_tag = htmltext('<label>')
|
|
222 |
r += htmltext('<label>')
|
|
223 | 223 |
html_attrs = self.attrs.copy() |
224 | 224 |
if self.is_selected(object): |
225 | 225 |
html_attrs['checked'] = 'checked' |
226 | 226 |
if self.options_with_attributes and option[-1].get('disabled'): |
227 | 227 |
html_attrs['disabled'] = 'disabled' |
228 | 228 |
label_tag = htmltext('<label class="disabled">') |
229 |
r = htmltag("input", xml_end=True, |
|
229 |
r += htmltag("input", xml_end=True,
|
|
230 | 230 |
type="radio", |
231 | 231 |
name=self.name, |
232 | 232 |
value=key, |
233 | 233 |
**html_attrs) |
234 |
tags.append(label_tag + r + htmlescape(description) + htmltext('</label>')) |
|
235 |
return htmlescape(self.delim).join(tags) |
|
234 |
r += htmltext('<span>%s</span>') % description |
|
235 |
r += htmltext('</label>') |
|
236 |
if i != len(options) - 1: |
|
237 |
r += htmltext(self.delim) |
|
238 |
return r.getvalue() |
|
236 | 239 | |
237 | 240 |
def checkbox_render_content(self): |
238 | 241 |
attrs = {'id': 'form_' + self.name} |
... | ... | |
1203 | 1206 |
r += htmltext('<input type="hidden" name="%s" value="yes" >') % widget.name |
1204 | 1207 |
widget.name = widget.name + 'xx' |
1205 | 1208 |
r += widget.render_content() |
1206 |
r += widget.title |
|
1209 |
r += htmltext('<span>%s</span>') % widget.title
|
|
1207 | 1210 |
r += htmltext('</label>') |
1208 | 1211 |
r += htmltext('</li>') |
1209 | 1212 |
r += htmltext('</ul>') |
1210 |
- |