openwebrx-clone/owrx/form/gfx.py

18 lines
570 B
Python
Raw Normal View History

2021-02-08 19:30:12 +00:00
from owrx.form import Input
class AvatarInput(Input):
2021-02-08 22:29:24 +00:00
def __init__(self, id, label, infotext=None):
super().__init__(id, label, infotext=infotext)
2021-02-08 19:30:12 +00:00
2021-02-08 22:29:24 +00:00
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
)