aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBonfaceKilz2021-11-05 13:05:58 +0300
committerBonfaceKilz2021-11-05 13:05:58 +0300
commit1e3092ced9489c50a18e403c56958694609130f7 (patch)
treeaf2d871fc6d4bb2a3b54957f98d052f984d717ac
parent86a4fccfefb26738aeb054ffec4d9408aaa86ed5 (diff)
downloadgenenetwork2-1e3092ced9489c50a18e403c56958694609130f7.tar.gz
Add template for displaying changed data
-rw-r--r--wqflask/wqflask/templates/display_files.html119
1 files changed, 119 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..d5295fb4
--- /dev/null
+++ b/wqflask/wqflask/templates/display_files.html
@@ -0,0 +1,119 @@
+{% extends "base.html" %}
+{% block title %}Trait Submission{% endblock %}
+{% block content %}
+<!-- Start of body -->
+{% with messages = get_flashed_messages(with_categories=true) %}
+{% if messages %}
+{% for category, message in messages %}
+<div class="container-fluid bg-{{ category }}">
+ <p>{{ message }}</p>
+</div>
+{% endfor %}
+{% endif %}
+{% endwith %}
+
+
+<div class="container">
+
+ {% if waiting %}
+ <div class="row">
+ Files for approval:
+ <div class="table-responsive">
+ <table class="table m-0">
+ <thead>
+ <th scope="col">Resource Id</</th>
+ <th scope="col">Author</th>
+ <th scope="col">TimeStamp</th>
+ <th scope="col"></th>
+ <th scope="col"></th>
+ </thead>
+ <tbody>
+ {% for data in waiting %}
+ <tr>
+ {% set file_url = url_for('metadata_edit.show_diff', name=data.get('file_name')) %}
+ <td><a href="{{ file_url }}" target="_blank">{{ data.get("resource_id") }}</a></td>
+ <td>{{ data.get("author")}}</td>
+ <td>{{ data.get("time_stamp")}}</td>
+ {% if data.get("roles").get("admin") > AdminRole.EDIT_ACCESS %}
+ {% set reject_url = url_for('metadata_edit.reject_data', resource_id=data.get('resource_id'), file_name=data.get('file_name')) %}
+ {% set approve_url = url_for('metadata_edit.approve_data', resource_id=data.get('resource_id'), file_name=data.get('file_name')) %}
+ <td>
+ <button type="button"
+ class="btn btn-secondary btn-sm">
+ <a href="{{ reject_url }}">Reject</a>
+ </button>
+ </td>
+ <td>
+ <button type="button"
+ class="btn btn-warning btn-sm">
+ <a href="{{ approve_url }}">Approve</a>
+ </button>
+ </td>
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ </div>
+ {% endif %}
+
+ {% if rejected %}
+ <div class="row">
+ Rejected Files:
+ <div class="table-responsive">
+ <table class="table m-0">
+ <thead>
+ <th scope="col">Resource Id</</th>
+ <th scope="col">Author</th>
+ <th scope="col">TimeStamp</th>
+ </thead>
+ <tbody>
+ {% for data in rejected %}
+ <tr>
+ {% set file_url = url_for('metadata_edit.show_diff', name=data.get('file_name')) %}
+ <td><a href="{{ file_url }}" target="_blank">{{ data.get("resource_id") }}</a></td>
+ <td>{{ data.get("author")}}</td>
+ <td>{{ data.get("time_stamp")}}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ </div>
+ {% endif %}
+
+ {% if approved %}
+ <div class="row">
+ Approved Data:
+ <div class="table-responsive">
+ <table class="table m-0">
+ <thead>
+ <th scope="col">Resource Id</</th>
+ <th scope="col">Author</th>
+ <th scope="col">TimeStamp</th>
+ </thead>
+ <tbody>
+ {% for data in approved %}
+ <tr>
+ {% set file_url = url_for('metadata_edit.show_diff', name=data.get('file_name')) %}
+ <td><a href="{{ file_url }}" target="_blank">{{ data.get("resource_id") }}</a></td>
+ <td>{{ data.get("author")}}</td>
+ <td>{{ data.get("time_stamp")}}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ </div>
+ {% endif %}
+</div>
+
+{%endblock%}
+
+{% block js %}
+<script>
+ gn_server_url = "{{ gn_server_url }}";
+
+</script>
+{% endblock %}