diff --git a/app/app.db b/app/app.db index 88ad1e0..9544a8c 100644 Binary files a/app/app.db and b/app/app.db differ diff --git a/app/main.py b/app/main.py index b10d5d6..270f3d4 100644 --- a/app/main.py +++ b/app/main.py @@ -32,6 +32,9 @@ def index(): @main.route("/set_benchmark/") @login_required def set_benchmark(benchmark_id): + if int(benchmark_id) == current_user.benchmark_id: + flash("Benchmark already selected.") + return redirect(url_for(INDEX)) if current_user.admin: benchmark = Benchmark.query.filter_by(id=benchmark_id).first() if benchmark is None: diff --git a/app/results/templates/_table_select.html b/app/results/templates/_table_select.html index 26fa05f..7bfe53e 100644 --- a/app/results/templates/_table_select.html +++ b/app/results/templates/_table_select.html @@ -5,7 +5,7 @@ - + diff --git a/app/results/templates/select.html b/app/results/templates/select.html index 14cf448..b220b69 100644 --- a/app/results/templates/select.html +++ b/app/results/templates/select.html @@ -1,9 +1,16 @@ {% extends "base.html" %} +{% block styles %} + {{ super() }} + +{% endblock %} {% block content %} {% include "_table_select.html" %} {% endblock %} {% block jscript %} {{ super() }} + {% endblock %} diff --git a/app/templates/_benchmarks.html b/app/templates/_benchmarks.html new file mode 100644 index 0000000..7ce43dc --- /dev/null +++ b/app/templates/_benchmarks.html @@ -0,0 +1,9 @@ +
+
Benchmarks
+
+ {% for benchmark in benchmarks %} + {{ benchmark.name + " - " + benchmark.description }} + {% endfor %} +
+
diff --git a/app/templates/_nav.html b/app/templates/_nav.html index a5e6c92..62c081b 100644 --- a/app/templates/_nav.html +++ b/app/templates/_nav.html @@ -1,30 +1,35 @@ {% from 'bootstrap5/nav.html' import render_nav_item %} - diff --git a/app/templates/base.html b/app/templates/base.html index 765ddec..3444773 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -7,6 +7,11 @@ content="width=device-width, initial-scale=1, shrink-to-fit=no"> {% block styles %} {{ bootstrap.load_css() }} + {% endblock %} @@ -14,7 +19,7 @@ {% endblock %} - {% include "_nav.html" %} +
{% include "_nav.html" %}
{% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% for category, message in messages %} @@ -25,7 +30,7 @@ {% endfor %} {% endif %} {% endwith %} -
+
{% block content %}{% endblock %}
diff --git a/app/templates/index.html b/app/templates/index.html index ec42095..a79ade0 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -1,16 +1,7 @@ {% extends "base.html" %} {% block content %} {% if benchmarks %} -
Benchmarks
- + {% include "_benchmarks.html" %} {% else %} Login - {{ render_form(form) }} +
+

Login

+ {{ render_form(form) }} +
{% endblock content %}
Model Metric Platform