Add points to race table
All checks were successful
Build Formula10 Docker Image / build-docker (push) Successful in 14s
All checks were successful
Build Formula10 Docker Image / build-docker (push) Successful in 14s
This commit is contained in:
@ -3,6 +3,7 @@ from flask import redirect, render_template, request
|
|||||||
from werkzeug import Response
|
from werkzeug import Response
|
||||||
|
|
||||||
from formula10.database.update_queries import delete_race_guess, update_race_guess
|
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.domain.template_model import TemplateModel
|
||||||
from formula10 import app
|
from formula10 import app
|
||||||
|
|
||||||
@ -22,8 +23,9 @@ def race_active_user(user_name: str) -> str:
|
|||||||
user_name = unquote(user_name)
|
user_name = unquote(user_name)
|
||||||
model = TemplateModel(active_user_name=user_name,
|
model = TemplateModel(active_user_name=user_name,
|
||||||
active_result_race_name=None)
|
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"])
|
@app.route("/race-guess/<race_name>/<user_name>", methods=["POST"])
|
||||||
|
@ -35,11 +35,11 @@
|
|||||||
|
|
||||||
{# Link should only be visible if all users are visible #}
|
{# Link should only be visible if all users are visible #}
|
||||||
{% if model.active_user is not none %}
|
{% 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 %}
|
{% else %}
|
||||||
{% for user in model.all_users() %}
|
{% for user in model.all_users() %}
|
||||||
<td class="text-center text-nowrap" style="min-width: 100px;">
|
<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>
|
</td>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Reference in New Issue
Block a user