ability to restore original image

This commit is contained in:
Jakob Ketterl
2021-02-10 21:29:46 +01:00
parent 8cf9b509c1
commit 7097dc1cd8
4 changed files with 25 additions and 12 deletions

View File

@ -3,7 +3,6 @@ from owrx.form import Input
from datetime import datetime
# TODO: ability to restore the original image
class ImageInput(Input, metaclass=ABCMeta):
def render_input(self, value):
return """
@ -12,7 +11,8 @@ class ImageInput(Input, metaclass=ABCMeta):
<div class="image-container">
<img class="{classes}" src="{url}" alt="{label}"/>
</div>
<button class="btn btn-primary">Upload new image...</button>
<button class="btn btn-primary upload">Upload new image...</button>
<button class="btn btn-secondary restore">Restore original image</button>
</div>
""".format(
id=self.id, label=self.label, url=self.cachebuster(self.getUrl()), classes=" ".join(self.getImgClasses())