more manage_users

This commit is contained in:
iou1name 2018-04-15 00:08:18 -04:00
parent 46ade7956f
commit 90f7bf75ed
2 changed files with 20 additions and 4 deletions

View File

@ -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"])

View File

@ -4,7 +4,17 @@
<title>Manage your uploads</title>
</head>
<body>
{% for file, date in uploads %}
{% app_url + file + "\t" + date %}
<table>
<tr>
<th>File</th>
<th>Date Uploaded</th>
</tr>
{% for file, date in uploads %}
<tr>
<td>{{ upload_url + file }}</td>
<td>{{ date|string }}</td>
</tr>
{% endfor %}
</table>
</body>
</html>