Fix some problems with password form

This commit is contained in:
2023-06-08 22:26:46 +02:00
parent a3d182d54e
commit ea8d928d42
4 changed files with 20 additions and 18 deletions

View File

@@ -106,11 +106,11 @@ def user_new():
@admin.route( @admin.route(
"/password/<user_id>/<back>", "/password/<int:user_id>/<back>",
methods=["GET", "POST"], methods=["GET", "POST"],
) )
@admin.route( @admin.route(
"/password/<user_id>", "/password/<int:user_id>",
defaults={"back": "None"}, defaults={"back": "None"},
methods=["GET", "POST"], methods=["GET", "POST"],
) )

View File

@@ -35,7 +35,7 @@ def index():
return render_template("index.html", benchmarks=benchmarks) return render_template("index.html", benchmarks=benchmarks)
@main.route("/set_benchmark/<benchmark_id>") @main.route("/set_benchmark/<int:benchmark_id>")
@login_required @login_required
def set_benchmark(benchmark_id): def set_benchmark(benchmark_id):
if int(benchmark_id) == current_user.benchmark_id: if int(benchmark_id) == current_user.benchmark_id:

View File

@@ -1,15 +1,17 @@
<div class="container col-md-4 col-sm-4 col-lg-offset-4"> <div class="container col-md-4 col-sm-4 col-lg-offset-4">
<h5>Benchmarks</h5> <div class="alert alert-primary" role="alert">
<div class="list-group"> <h5>Select Benchmark</h5>
{% for benchmark in benchmarks %} <div class="list-group">
<a href="{{ url_for('main.set_benchmark', benchmark_id=benchmark.id) }}" {% for benchmark in benchmarks %}
class="list-group-item list-group-item-action flex-column align-items-start {% if benchmark == current_user.benchmark %}active{% endif %}"> <a href="{{ url_for('main.set_benchmark', benchmark_id=benchmark.id) }}"
<div class="d-flex w-100 justify-content-between"> class="list-group-item list-group-item-action flex-column align-items-start {% if benchmark == current_user.benchmark %}active{% endif %}">
<h5 class="mb-1">{{ benchmark.name }}</h5> <div class="d-flex w-100 justify-content-between">
<small>{{ benchmark.num_files }} files</small> <h5 class="mb-1">{{ benchmark.name }}</h5>
</div> <small>{{ benchmark.num_files }} files</small>
<p class="mb-1">{{ benchmark.description }}</p> </div>
</a> <p class="mb-1">{{ benchmark.description }}</p>
{% endfor %} </a>
{% endfor %}
</div>
</div> </div>
</div> </div>

View File

@@ -18,10 +18,10 @@
<a href="{{ url_for(config.INDEX) }}" <a href="{{ url_for(config.INDEX) }}"
class="nav-item nav-link nav-benchmark">on {{ current_user.benchmark.name }}</a> class="nav-item nav-link nav-benchmark">on {{ current_user.benchmark.name }}</a>
</li> </li>
<li>{{ render_nav_item('results.select', 'Results') }}</li>
<li>{{ render_nav_item('results.datasets', 'Datasets') }}</li>
<li>{{ render_nav_item('main.config', 'Config') }}</li>
{% endif %} {% endif %}
<li>{{ render_nav_item('results.select', 'Results') }}</li>
<li>{{ render_nav_item('results.datasets', 'Datasets') }}</li>
<li>{{ render_nav_item('main.config', 'Config') }}</li>
</ul> </ul>
<div class="navbar-nav justify-content-end"> <div class="navbar-nav justify-content-end">
{% if current_user.is_authenticated %} {% if current_user.is_authenticated %}