diff --git a/fileHost.py b/fileHost.py index 25c10e7..0adce35 100755 --- a/fileHost.py +++ b/fileHost.py @@ -3,6 +3,7 @@ Simple file host using Flask. """ import os +import time import string import secrets import sqlite3 @@ -261,9 +262,14 @@ def manage_uploads(): "SELECT filename, uploaded_date FROM uploads WHERE uploaded_by = ?", (username,)).fetchall() + new_uploads = [] + for file, date in uploads: + file = app.config.get("UPLOAD_URL") + file + date = time.strftime("%Y-%m-%d %H:%M", date) + new_uploads.append((file, date)) + if request.method == "GET": - return render_template("manage_uploads.html", uploads=uploads, - app_url=app.config.get("APP_URL")) + return render_template("manage_uploads.html", uploads=new_uploads) @app.route("/", methods=["POST", "GET"]) diff --git a/templates/manage_uploads.html b/templates/manage_uploads.html index f346337..aaabd44 100644 --- a/templates/manage_uploads.html +++ b/templates/manage_uploads.html @@ -4,7 +4,17 @@ Manage your uploads -{% for file, date in uploads %} -{% app_url + file + "\t" + date %} + + + + + + {% for file, date in uploads %} + + + + + {% endfor %} +
FileDate Uploaded
{{ upload_url + file }}{{ date|string }}