aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/templates/display_files.html21
-rw-r--r--wqflask/wqflask/views.py12
2 files changed, 33 insertions, 0 deletions
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 %}
+<!-- Start of body -->
+Show files for approval
+
+<div>
+ <ul>
+ {% for file in files %}
+ <li><a href="/display-file/{{ file }}" target="_blank">{{ file }}</a><br/> <button>Approve</button> <button>Reject</button></li>
+ {% endfor %}
+ </ul>
+</div>
+{%endblock%}
+
+{% block js %}
+<script>
+ gn_server_url = "{{ gn_server_url }}";
+
+</script>
+{% 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)
+