add date to gallery page
This commit is contained in:
parent
8025ce338c
commit
0000cc6540
|
@ -91,7 +91,7 @@ async def gallery(request):
|
|||
|
||||
async with request.app['pool'].acquire() as conn:
|
||||
uploads = await conn.fetch(
|
||||
"SELECT * FROM upload WHERE user_id = $1",
|
||||
"SELECT * FROM upload WHERE user_id = $1 ORDER BY upload_date DESC",
|
||||
user_id)
|
||||
upload_url = config.upload_url
|
||||
return render_template("gallery.html", request, locals())
|
||||
|
@ -201,6 +201,7 @@ def download_file(url, timeout=10, max_file_size=config.client_max_size):
|
|||
r.headers['content-disposition']).group(1)
|
||||
else:
|
||||
fname = os.path.basename(url)
|
||||
fname = re.sub('\?.*$', '', fname)
|
||||
return (fname, temp)
|
||||
|
||||
|
||||
|
|
|
@ -13,8 +13,13 @@
|
|||
<main>
|
||||
<section>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Upload Date</th>
|
||||
<th>Filename</th>
|
||||
</tr>
|
||||
{% for upload in uploads %}
|
||||
<tr>
|
||||
<td>{{ upload['upload_date'].strftime('%Y-%m-%d') }}</td>
|
||||
<td><a href="{{ upload_url + upload['filename'] }}">{{ upload['filename'] }}</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
Loading…
Reference in New Issue
Block a user