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:
Florian Festi 2016-11-30 21:44:22 +01:00
parent f133e2aa12
commit 3a4c0cd49c
1 changed files with 2 additions and 2 deletions

View File

@ -93,8 +93,8 @@ class BServer:
input = """<textarea name="%s" cols="%s" rows="%s">%s</textarea>""" % \
(name, max((len(l) for l in val))+10, len(val)+1, a.default)
elif a.type is bool:
input = """<input name="%s" type="checkbox">""" % \
(name, )
input = """<input name="%s" type="checkbox" value="1"%s>""" % \
(name, ' checked="checked"' if a.default else "")
elif a.choices:
options = "\n".join(
("""<option value="%s"%s>%s</option>""" %