Use default value for checkboxes in the web UI.
There are still issues with the boolean params when default is True
This commit is contained in:
parent
f133e2aa12
commit
3a4c0cd49c
|
@ -93,8 +93,8 @@ class BServer:
|
||||||
input = """<textarea name="%s" cols="%s" rows="%s">%s</textarea>""" % \
|
input = """<textarea name="%s" cols="%s" rows="%s">%s</textarea>""" % \
|
||||||
(name, max((len(l) for l in val))+10, len(val)+1, a.default)
|
(name, max((len(l) for l in val))+10, len(val)+1, a.default)
|
||||||
elif a.type is bool:
|
elif a.type is bool:
|
||||||
input = """<input name="%s" type="checkbox">""" % \
|
input = """<input name="%s" type="checkbox" value="1"%s>""" % \
|
||||||
(name, )
|
(name, ' checked="checked"' if a.default else "")
|
||||||
elif a.choices:
|
elif a.choices:
|
||||||
options = "\n".join(
|
options = "\n".join(
|
||||||
("""<option value="%s"%s>%s</option>""" %
|
("""<option value="%s"%s>%s</option>""" %
|
||||||
|
|
Loading…
Reference in New Issue