about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--wqflask/wqflask/templates/edit_case_attributes.html4
-rw-r--r--wqflask/wqflask/templates/list_case_attribute_diffs.html60
-rw-r--r--wqflask/wqflask/views.py6
3 files changed, 70 insertions, 0 deletions
diff --git a/wqflask/wqflask/templates/edit_case_attributes.html b/wqflask/wqflask/templates/edit_case_attributes.html
index a05ecd17..3c97b992 100644
--- a/wqflask/wqflask/templates/edit_case_attributes.html
+++ b/wqflask/wqflask/templates/edit_case_attributes.html
@@ -34,6 +34,10 @@
     </li>
   </ul>
 
+  <a href="{{url_for('list_case_attribute_diffs', inbredset_id=inbredset_id)}}"
+     title="List out diffs awaiting review"
+     class="btn btn-info">View Diffs</a>
+
   <form method="POST" action="{{url_for('edit_case_attributes', inbredset_id=inbredset_id)}}">
     <div class="form-group" style="text-align: center; padding: 1em 0 0 0;">
       <input type="submit" value="Submit" class="btn btn-primary" />
diff --git a/wqflask/wqflask/templates/list_case_attribute_diffs.html b/wqflask/wqflask/templates/list_case_attribute_diffs.html
new file mode 100644
index 00000000..391b8c99
--- /dev/null
+++ b/wqflask/wqflask/templates/list_case_attribute_diffs.html
@@ -0,0 +1,60 @@
+{%extends "base.html"%}
+{%block title%}List Case Attribute Diffs{%endblock%}
+
+{%block css%}
+<link rel="stylesheet" type="text/css"
+      href="/css/DataTables/css/jquery.dataTables.css" />
+<link rel="stylesheet" type="text/css"
+      href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" />
+<link rel="stylesheet" type="text/css" href="/static/new/css/show_trait.css" />
+
+<style>
+  .table-fixed-head {overflow-y: auto; height: 32em;}
+  .table-fixed-head thead th {position: sticky; top: 0;}
+</style>
+{%endblock%}
+
+{%block content%}
+<div class="container">
+  <h1>List Diffs</h1>
+
+  {{flash_me()}}
+
+  <p class="text-danger">
+    <span class="glyphicon glyphicon-exclamation-sign">
+    </span>
+    <strong>WORK IN PROGRESS!!!</strong>
+  </p>
+
+  <table class="table-hover table-striped cell-border dataTable no-footer">
+    <thead>
+      <tr>
+	<th>Edit by</th>
+	<th>Edit on</th>
+	<th>Filename</th>
+	<th colspan="2">Actions</th>
+      </tr>
+    </thead>
+
+    <tbody>
+      {%for diff in diffs%}
+      <tr>
+      </tr>
+      {%else%}
+      <tr>
+	<td colspan="5" class="text-info" style="text-align: center;line-height: 2em;">
+	  <span class="glyphicon glyphicon-exclamation-sign">
+	  </span>
+	  There are no diffs pending review
+	</td>
+      </tr>
+      {%endfor%}
+    </tbody>
+  </table>
+{%endblock%}
+
+{%block js%}
+<script language="javascript"
+	type="text/javascript"
+	src="{{url_for('js', filename='DataTables/js/jquery.js')}}"></script>
+{%endblock%}
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 0ce77295..bf9148c7 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -1228,3 +1228,9 @@ def edit_case_attributes(inbredset_id: int) -> Response:
                         lambda err: err, ## TODO: Handle error better
                         lambda values: render_template(
                             "edit_case_attributes.html", inbredset_id=inbredset_id, **values))
+
+@app.route("/case-attribute/<int:inbredset_id>/list-diffs", methods=["GET"])
+def list_case_attribute_diffs(inbredset_id: int) -> Response:
+    """List any diffs awaiting review."""
+    return render_template(
+        "list_case_attribute_diffs.html", inbredset_id=inbredset_id, diffs=[])