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:59:12 +00:00
< h1 > AAC Results{% if title %}: {% if ltype == 'licence' %}Licence {% endif %}{{ title }}{% endif %}{% if year %} ({{ year }}){% endif %}< / h1 >
{% if ltype == 'search' -%}
{% include 'search.html' with context %}
{%- endif -%}
2018-08-14 08:55:34 +00:00
{% if results -%}
{%- set ns.total = 0 -%}
{%- if 'count' in results -%}
{%- set ns.total = results['count'] -%}
{%- endif -%}
2018-08-14 08:59:12 +00:00
< table class = "wide" >
2018-08-14 08:54:02 +00:00
< 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' %}
2018-08-14 08:59:12 +00:00
< th > Race< / th >
2018-08-14 08:54:02 +00:00
{% 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:59:12 +00:00
{%- set person='{} {}'.format(row.name|e, row.surname|e) -%}
2018-08-14 08:54:02 +00:00
< tr >
2018-08-14 08:59:12 +00:00
< td class = "nowrap" > < span class = "label" > Position< / span > < span > {{ row.position|e }}< / span > < / td >
< td class = "nowrap" > < span class = "label" > Name< / span > < span > < a href = "{{ url_for('person', title=person|urlescape, start=None) }}" > {{ person }}< / a > < / span > < / td >
< td class = "nowrap" > < span class = "label" > Licence< / span > < span > < a href = "{{ url_for('licence', title=row.licence|urlescape, year=row.date|year, start=None, show=ns.show) }}" > {{ row.licence|e }}< / a > < / span > < / td >
< td > < span class = "label" > Time< / span > < span > {{ row.time|e }}< / span > < / td >
< td class = "nowrap" > < span class = "label" > Average Pace< / span > < span > {% if row.distance is number and row.distance|int != 0 %}{{ (row.time / row.distance) | pace }} min/KM{% endif %}< / span > < / td >
2018-08-14 08:54:02 +00:00
{%- if ltype != 'event' -%}
2018-08-14 08:59:12 +00:00
< td class = "long" > < span class = "label" > Race< / span > < span > < a href = "{{ url_for('race', title=row.event|urlescape, year=row.date|year, start=None, show=ns.show) }}" > {{ row.event|e }} ({{ row.distance|e }} KM)< / a > < / span > < / td >
2018-08-14 08:54:02 +00:00
{%- endif -%}
2018-08-14 08:59:12 +00:00
< td class = "nowrap" > < span class = "label" > Date< / span > < span > {{ row.date|cleandate|e }}< / span > < / td >
< td class = "long" > < span class = "label" > Notes< / span > < span >
{%- if row.sex and row.sexposition and row.sexposition | int < = 100 %}{{ row.sexposition|ordinal|e }} {{ row.sex|lower|e }}{% endif -%}
2018-08-14 08:57:55 +00:00
{%- if row.sexposition and row.sexposition | int < = 100 and row.catposition and row.catposition | int < = 100 %} and {% endif -%}
2018-08-14 08:59:12 +00:00
{%- if row.catposition and row.catposition | int < = 100 %}{{ row.catposition|ordinal|e }} in category{% endif -%}
< / span >
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 >