diff --git a/server.py b/server.py index 8969d8b..1cb3630 100755 --- a/server.py +++ b/server.py @@ -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(): diff --git a/templates/index.html b/templates/index.html index 8735fb0..d274d68 100644 --- a/templates/index.html +++ b/templates/index.html @@ -20,16 +20,28 @@ Public Images List:
{% for path in paths %}
{% if not "cache" in path %}
-
+ {% if isPictureDict[path] %}
+
+ {% else %}
+
+ ❌
+ {{ path }}
+
+