Opened 18 years ago
Closed 18 years ago
#4785 closed (duplicate)
Widgets have nonconfigurable hardcoded HTML
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Forms | Version: | dev |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Design decision needed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Widgets CheckboxSelectMultiple and RadioFieldRenderer have hardcoded <ul><li>...</li></ul> tags which makes them hard to use in a design that expects different style of output, for instance wrapping things in <div></div> tags.
Attached patch takes these <ul> and <li> tags out of the code to a class variable that can be easily overwritten in subclasses. Creating a widget DivCheckboxSelectMultiple is then as simple as:
class DivCheckboxSelectMultiple(forms.widgets.CheckboxSelectMultiple):
tags = { 'block' : u'<div>%s</div>', 'item' : u'<div><label>%(label)s %(input)s</label></div>' }
Attachments (1)
Change History (4)
by , 18 years ago
| Attachment: | div-widgets.diff added |
|---|
comment:2 by , 18 years ago
| Triage Stage: | Unreviewed → Design decision needed |
|---|
Proposed patch