feat: improve display of non-image entities

This commit is contained in:
2023-06-27 16:03:42 +02:00
parent 9d38617dff
commit 77c9a1b6d4
2 changed files with 21 additions and 4 deletions

View File

@@ -140,7 +140,12 @@ def list():
for f in files:
retStringArr += [os.path.join(os.path.basename(root), f)]
return flask.render_template("index.html", paths=retStringArr)
isPictureDict = dict()
for p in retStringArr:
isPicture = any([x in p for x in ["jpg", "png", "wep", "svg"]])
isPictureDict.update({ p : isPicture })
return flask.render_template("index.html", paths=retStringArr, isPictureDict=isPictureDict)
@app.route("/upload", methods = ['GET', 'POST'])
def upload():