puzzle.unturf.com/templates/daily_leaderboard.html.j2
Russell Ballestrini de2a836f87 use pyramid tm or have a bad time.
modified:   app.py
	modified:   requirements.txt
	modified:   templates/daily_leaderboard.html.j2
2024-12-31 08:43:42 -05:00

30 lines
1.2 KiB
Django/Jinja

{% extends 'base.html.j2' %}
{% block content %}
<h1>Leaderboard for {{ puzzle.title }} ({{ puzzle.date }})</h1>
<p>
<strong>Sort by:</strong>
<a href="{{ request.route_url('daily_leaderboard', puzzle_id=puzzle.id, _query={'sort': 'time'}) }}">Top Speed</a> |
<a href="{{ request.route_url('daily_leaderboard', puzzle_id=puzzle.id, _query={'sort': 'moves'}) }}">Least Moves</a>
</p>
<p>Players are ranked based on their total time and moves. Faster times and fewer moves result in better rankings.</p>
<table>
<tr>
<th>Rank</th>
<th>Username/Guest</th>
<th>Moves</th>
<th>Rotations</th>
<th>Total Actions</th>
<th>Time (sec)</th>
</tr>
{% for row in attempts %}
<tr>
<td>{{ loop.index }}</td>
<td><a href="{{ request.route_url('view_profile', user_id=row.user_id) }}">{{ row.user_display_name }}</a></td>
<td>{{ row.move_count }}</td>
<td>{{ row.rotation_count }}</td>
<td>{{ row.move_count + row.rotation_count }}</td>
<td>{{ "%.2f"|format((row.time_completed - row.time_started).total_seconds() if row.time_completed else 0) }}</td>
</tr>
{% endfor %}
</table>
{% endblock %}