CreateSelect() in py called in jinja to neaten up selects

This commit is contained in:
2021-02-02 00:18:52 +11:00
parent 5703664019
commit 96bcada5c5
2 changed files with 13 additions and 0 deletions

View File

@@ -11,3 +11,14 @@ else:
PA_JOB_MANAGER_PORT=55430
THUMBSIZE=256
def CreateSelect(name, selected, list, js=""):
str = f'<select id="{name}" name="{name}" style="color:#5bc0de;border:1px solid #5bc0de;"'
str += f'class="form-control form-conrol-info" onChange="{js};this.form.submit()">'
for el in list:
str += '<option '
if el == selected:
str += 'selected '
str += f'>{el}</option>'
str += '</select>'
return str