From b355b91f67305c4cb3ebbad994cc0ff2906eb701 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Mon, 26 Jul 2021 13:17:14 +0300 Subject: wqflask: views: Show diff files for the admin * wqflask/wqflask/views.py (display_diffs_admin): New function. * wqflask/wqflask/templates/display_files.html: New template to show the diffs. --- wqflask/wqflask/templates/display_files.html | 21 +++++++++++++++++++++ wqflask/wqflask/views.py | 12 ++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 wqflask/wqflask/templates/display_files.html (limited to 'wqflask') diff --git a/wqflask/wqflask/templates/display_files.html b/wqflask/wqflask/templates/display_files.html new file mode 100644 index 00000000..e7210c1b --- /dev/null +++ b/wqflask/wqflask/templates/display_files.html @@ -0,0 +1,21 @@ +{% extends "base.html" %} +{% block title %}Trait Submission{% endblock %} +{% block content %} + +Show files for approval + +
+ +
+{%endblock%} + +{% block js %} + +{% endblock %} diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 73829bb2..cf7b5552 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -1375,3 +1375,15 @@ def get_sample_data_as_csv(trait_name: int, phenotype_id: int): headers={"Content-disposition": "attachment; filename=myplot.csv"} ) + + +@app.route("/data/approve/") +def display_diffs_admin(): + DIFF_DIR = "/tmp/sample-data/diffs" + files = [] + if os.path.exists(DIFF_DIR): + files = filter(lambda x: not(x.endswith((".approved", ".rejected"))), + os.listdir(DIFF_DIR)) + return render_template("display_files.html", + files=files) + -- cgit v1.2.3