implement dynamic file upload

This commit is contained in:
Jakob Ketterl
2021-02-08 23:29:24 +01:00
parent 2d72055070
commit a1c024bfe2
7 changed files with 95 additions and 5 deletions

View File

@ -2,6 +2,16 @@ from owrx.form import Input
class AvatarInput(Input):
def render_input(self, value):
pass
def __init__(self, id, label, infotext=None):
super().__init__(id, label, infotext=infotext)
def render_input(self, value):
return """
<div class="imageupload">
<input type="hidden" id="{id}" name="{id}">
<img class="webrx-rx-avatar" src="static/gfx/openwebrx-avatar.png" alt="Receiver avatar"/>
<button class="btn btn-primary">Upload new image...</button>
</div>
""".format(
id=self.id
)