Compare commits
2 Commits
0ea6568082
...
e7d2e960ad
| Author | SHA1 | Date | |
|---|---|---|---|
| e7d2e960ad | |||
| 1bd174e73f |
@ -3,6 +3,7 @@ from flask import redirect, render_template, request
|
||||
from werkzeug import Response
|
||||
|
||||
from formula10.database.update_queries import delete_race_guess, update_race_guess
|
||||
from formula10.domain.points_model import PointsModel
|
||||
from formula10.domain.template_model import TemplateModel
|
||||
from formula10 import app
|
||||
|
||||
@ -22,8 +23,9 @@ def race_active_user(user_name: str) -> str:
|
||||
user_name = unquote(user_name)
|
||||
model = TemplateModel(active_user_name=user_name,
|
||||
active_result_race_name=None)
|
||||
points = PointsModel()
|
||||
|
||||
return render_template("race.jinja", model=model)
|
||||
return render_template("race.jinja", model=model, points=points)
|
||||
|
||||
|
||||
@app.route("/race-guess/<race_name>/<user_name>", methods=["POST"])
|
||||
|
||||
@ -35,11 +35,11 @@
|
||||
|
||||
{# Link should only be visible if all users are visible #}
|
||||
{% if model.active_user is not none %}
|
||||
<td class="text-center text-nowrap" style="min-width: 100px;">{{ model.active_user.name }}</td>
|
||||
<td class="text-center text-nowrap" style="min-width: 100px;">{{ model.active_user.name }} ({{ points.total_points_by(model.active_user.name) }})</td>
|
||||
{% else %}
|
||||
{% for user in model.all_users() %}
|
||||
<td class="text-center text-nowrap" style="min-width: 100px;">
|
||||
<a href="/race/{{ user.name_sanitized }}" class="link-dark">{{ user.name }}</a>
|
||||
<a href="/race/{{ user.name_sanitized }}" class="link-dark">{{ user.name }} ({{ points.total_points_by(user.name) }})</a>
|
||||
</td>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
@ -10,11 +10,20 @@
|
||||
|
||||
{% block body %}
|
||||
|
||||
<div class="card mb-2">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Note</h5>
|
||||
Picks that match the current standings are marked in green,
|
||||
except for the hot-take and overtake picks, as those are not evaluated automatically.
|
||||
Points from sprints and fastest laps are not tracked currently.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid" style="grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));">
|
||||
|
||||
{% for user in model.all_users_or_active_user() %}
|
||||
|
||||
<div class="card mb-2 shadow-sm" style="width: 450px;">
|
||||
<div class="card mb-2 shadow-sm">
|
||||
<div class="card-body">
|
||||
|
||||
{# Link should only be visible if all users are visible #}
|
||||
|
||||
@ -6,6 +6,13 @@
|
||||
|
||||
{% block body %}
|
||||
|
||||
<div class="card mb-2">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Note</h5>
|
||||
Points from sprints and fastest laps are not tracked currently.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid" style="grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));">
|
||||
|
||||
<div class="card mb-2">
|
||||
|
||||
Reference in New Issue
Block a user