separate tables and images
diff --git a/web_app/__init__.py b/web_app/__init__.py
index ada3f17..7aa6312 100644
--- a/web_app/__init__.py
+++ b/web_app/__init__.py
@@ -74,7 +74,34 @@
table.append(row)
- return render_template("table.html", headers=header_keys, table=table, urls=urls)
+ return render_template("test.html", urls=urls, table_url=url_for('render_table', test_name=test_name))
+
+
+@app.route("/tests/table/<test_name>/")
+def render_table(test_name):
+ tests = load_test(test_name)
+ header_keys = ['build_id', 'iso_md5', 'type']
+ table = [[]]
+
+ if len(tests) > 0:
+ sorted_keys = sorted(tests[0].keys())
+
+ for key in sorted_keys:
+ if key not in header_keys:
+ header_keys.append(key)
+
+ for test in tests:
+ row = []
+
+ for header in header_keys:
+ if isinstance(test[header], list):
+ row.append(str(test[header][0]) + unichr(0x00B1) + str(test[header][1]))
+ else:
+ row.append(test[header])
+
+ table.append(row)
+
+ return render_template("table.html", headers=header_keys, table=table, back_url=url_for('render_test', test_name=test_name))
@app.route("/tests/<test_name>", methods=['POST'])
diff --git a/web_app/templates/table.html b/web_app/templates/table.html
index dedb38b..75cef20 100644
--- a/web_app/templates/table.html
+++ b/web_app/templates/table.html
@@ -9,29 +9,21 @@
<body>
{% block body %}
<h1 align="center">Lab name goes here:-)</h1>
- <div class="table-responsive">
<table class="table" width="600">
- <div id="images">
- {% for url in urls %}
- <img src="{{ url }}">
+ {% for row in table %}
+ <tr>
+ {% for data in row %}
+ <td>
+ {{ data }}
+ </td>
+ {% endfor %}
+ </tr>
{% endfor %}
- </div>
- {% for header in headers %}
- <th>
- <h2>{{ header }}</h2>
- </th>
- {% endfor %}
- {% for row in table %}
- <tr>
- {% for data in row %}
- <td>
- {{ data }}
- </td>
- {% endfor %}
- </tr>
- {% endfor %}
</table>
</div>
+ <h2 align="center">
+ <a href="{{ back_url }}">Back</a>
+ </h2>
{% endblock %}
</body>
</html>
\ No newline at end of file
diff --git a/web_app/templates/test.html b/web_app/templates/test.html
new file mode 100644
index 0000000..eb4df3d
--- /dev/null
+++ b/web_app/templates/test.html
@@ -0,0 +1,40 @@
+{% extends "base.html" %}
+<html>
+<head>
+ {% block head %}
+ {{ super() }}
+ <title>Table of results</title>
+ {% endblock %}
+</head>
+<body>
+ {% block body %}
+ <h1 align="center">Lab name goes here:-)</h1>
+ <div class="table-responsive">
+ <table class="table" width="600">
+ <div id="images">
+ {% for url in urls %}
+ <img src="{{ url }}">
+ {% endfor %}
+ </div>
+ {% for header in headers %}
+ <th>
+ <h2>{{ header }}</h2>
+ </th>
+ {% endfor %}
+ {% for row in table %}
+ <tr>
+ {% for data in row %}
+ <td>
+ {{ data }}
+ </td>
+ {% endfor %}
+ </tr>
+ {% endfor %}
+ </table>
+ </div>
+ <h2 align="center">
+ <a href="{{ table_url }}">Details</a>
+ </h2>
+ {% endblock %}
+</body>
+</html>
\ No newline at end of file