From 11bef3d7f44901764343eaab05788a9d86294551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana?= Date: Mon, 5 Jun 2023 17:33:20 +0200 Subject: [PATCH] Finish select benchmark --- app/app.db | Bin 28672 -> 28672 bytes app/main.py | 3 +++ app/results/templates/_table_select.html | 2 +- app/results/templates/select.html | 7 +++++ app/templates/_benchmarks.html | 9 +++++++ app/templates/_nav.html | 33 +++++++++++++---------- app/templates/base.html | 9 +++++-- app/templates/index.html | 11 +------- app/templates/login.html | 6 +++-- 9 files changed, 51 insertions(+), 29 deletions(-) create mode 100644 app/templates/_benchmarks.html diff --git a/app/app.db b/app/app.db index 88ad1e0bd71fa4212f80bc486f64f5b36dd0a8e4..9544a8c8d33ec94ce599936ae89f2c0319d333ea 100644 GIT binary patch delta 61 zcmZp8z}WDBae_4Cp@}lijE6QREVSq5FJxfii(=r5;(N7OP{5CmrIDABV{)8dHzV`p RSAOj*3=9nYn@jz>6#!$f63PGo delta 61 zcmZp8z}WDBae_2s_e2?I#_o*?3+=fX7#NuNUNP_&^1a$DDB#D(!e7WRVRD>bHzU*J RSAOj*jXaDTn@jz>6#!hy69WJM 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