Add status badges for uploaded files and sent emails on admin request page
This commit is contained in:
parent
30732c0b64
commit
7ef8779eb7
2 changed files with 43 additions and 3 deletions
8
app.py
8
app.py
|
|
@ -191,6 +191,12 @@ def admin_request(rid):
|
|||
if not req:
|
||||
abort(404)
|
||||
|
||||
def file_exists(path):
|
||||
return bool(path and Path(path).exists())
|
||||
|
||||
def basename(path):
|
||||
return Path(path).name if path else ''
|
||||
|
||||
if request.method == 'POST':
|
||||
action = request.form.get('action')
|
||||
|
||||
|
|
@ -255,7 +261,7 @@ def admin_request(rid):
|
|||
|
||||
return redirect(url_for('admin_request', rid=rid))
|
||||
|
||||
return render_template('admin/request.html', req=req, statuses=STATUS_LABELS)
|
||||
return render_template('admin/request.html', req=req, statuses=STATUS_LABELS, file_exists=file_exists, basename=basename)
|
||||
|
||||
# ---------------- init ----------------
|
||||
|
||||
|
|
|
|||
Reference in a new issue