From 2363e7a517668725f84dcd29692fb39305dec7db Mon Sep 17 00:00:00 2001 From: Mark Carlson Date: Wed, 10 Jan 2024 06:09:34 +1100 Subject: [PATCH] Add priority group dividers (#183) --- OpenBench/static/style.css | 6 ++++++ OpenBench/views.py | 12 ++++++++++-- Templates/OpenBench/index.html | 11 +++++++---- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/OpenBench/static/style.css b/OpenBench/static/style.css index 8147914..fcf74d3 100644 --- a/OpenBench/static/style.css +++ b/OpenBench/static/style.css @@ -161,6 +161,12 @@ body, html, main{ background-color: #171717; } +#content .table-small-header th { + color: var(--color-font3); + font-size: small; + background-color: #171717; +} + /* Table Spacer for chaining Tables as a hack */ #content .table-spacer th, #content .table-spacer tr { diff --git a/OpenBench/views.py b/OpenBench/views.py index fa2c94e..a26e2f8 100644 --- a/OpenBench/views.py +++ b/OpenBench/views.py @@ -251,6 +251,14 @@ def profile_config(request): # TEST LIST VIEWS # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +def priority_grouped(active): + active_grouped = [] + for t in active: + if len(active_grouped) == 0 or active_grouped[-1]["priority"] != t.priority: + active_grouped.append({"priority": t.priority, "tests": []}) + active_grouped[-1]["tests"].append(t) + return active_grouped + def index(request, page=1): pending = OpenBench.utils.get_pending_tests() @@ -262,7 +270,7 @@ def index(request, page=1): data = { 'pending' : pending, - 'active' : active, + 'active' : priority_grouped(active), 'completed' : completed[start:end], 'awaiting' : awaiting, 'paging' : paging, @@ -282,7 +290,7 @@ def user(request, username, page=1): data = { 'pending' : pending, - 'active' : active, + 'active' : priority_grouped(active), 'completed' : completed[start:end], 'awaiting' : awaiting, 'paging' : paging, diff --git a/Templates/OpenBench/index.html b/Templates/OpenBench/index.html index 6a5b86e..8d9dade 100644 --- a/Templates/OpenBench/index.html +++ b/Templates/OpenBench/index.html @@ -32,10 +32,13 @@ {% if active %} Active {{status}} - {% for test in active %} - - {% include "OpenBench/Blocks/testsummary.html" %} - + {% for group in active %} + Priority {{group.priority}} + {% for test in group.tests %} + + {% include "OpenBench/Blocks/testsummary.html" %} + + {% endfor %} {% endfor %} {% endif %}