AACResults/templates/index.html

60 lines
2.1 KiB
HTML
Raw Normal View History

2018-08-14 08:55:34 +00:00
{% set ns = namespace() -%}
2018-08-14 08:54:02 +00:00
2018-08-14 08:55:34 +00:00
{% include 'head.html' with context %}
2018-08-14 08:54:02 +00:00
<article>
2018-08-14 08:55:34 +00:00
<h1>AAC Statistics {% if title %}: {{ title }}{% endif %}{% if year %} {{ year }}{% endif %}</h1>
{% if results -%}
{%- set ns.total = 0 -%}
{%- if 'count' in results -%}
{%- set ns.total = results['count'] -%}
{%- endif -%}
2018-08-14 08:54:02 +00:00
<table>
<thead>
<tr>
<th>Position</th>
{% if ltype != 'person' %}
<th>Name</th>
<th>Licence</th>
{% endif %}
<th>Time</th>
<th>Average Pace</th>
{% if ltype != 'event' %}
<th>Event</th>
{% endif %}
<th>Date</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
2018-08-14 08:55:34 +00:00
{%- for row in results['rows'] -%}
2018-08-14 08:54:02 +00:00
{%- set person='{} {}'.format(row.name, row.surname) -%}
{%- if distance %}{# set total_km += row.distance #}{% endif -%}
<tr>
<td>{{ row.position }}</td>
{%- if ltype != 'person' -%}
<td><a href="{{ url_for('person', title=person, start=None) }}">{{ person }}</a></td>
<td><a href="{{ url_for('licence', title=row.licence, year=row.date|year, start=None, limit=ns.limit) }}">{{ row.licence }}</a></td>
{%- endif -%}
<td>{{ row.time }}</td>
<td class="nowrap">{% if row.distance is number %}{{ (row.time / row.distance) | pace }} min/KM{% endif %}</td>
{%- if ltype != 'event' -%}
<td><a href="{{ url_for('race', title=row.event, year=row.date|year, start=None, limit=ns.limit) }}">{{ row.event }} ({{ row.distance }} KM)</a></td>
{%- endif -%}
2018-08-14 08:55:34 +00:00
<td>{{ row.date | cleandate }}</td>
2018-08-14 08:54:02 +00:00
<td>
2018-08-14 08:57:55 +00:00
{%- if row.sex and row.sexposition and row.sexposition | int <= 100 %}{{ row.sexposition | ordinal }} {{ row.sex.lower() }}{% endif -%}
{%- if row.sexposition and row.sexposition | int <= 100 and row.catposition and row.catposition | int <= 100 %} and {% endif -%}
{%- if row.catposition and row.catposition | int <= 100 %}{{ row.catposition | ordinal }} in category{% endif -%}
2018-08-14 08:54:02 +00:00
</td>
</tr>
{%- endfor -%}
</tbody>
</table>
2018-08-14 08:55:34 +00:00
{%- endif %}
2018-08-14 08:54:02 +00:00
</article>
2018-08-14 08:55:34 +00:00
<footer>
{% include 'prevnext.html' with context %}
</footer>
2018-08-14 08:54:02 +00:00
</body>
</html>