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
{% if ltype == 'search' -%}
2018-08-14 09:02:56 +00:00
< h1 > AAC Results: Search< / h1 >
2018-08-14 08:59:12 +00:00
{% include 'search.html' with context %}
2018-08-14 09:02:56 +00:00
{% else %}
< h1 > AAC Results{% if title %}: {% if ltype == 'licence' %}Licence {% endif %}{{ title }}{% endif %}{% if year %} ({{ year }}){% endif %}< / h1 >
2018-08-14 08:59:12 +00:00
{%- endif -%}
2018-08-14 09:02:56 +00:00
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 >
< th > Name< / th >
< th > Licence< / th >
< 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 09:01:26 +00:00
{%- set person = '{} {}'.format(row.name or '', row.surname or '') -%}
2018-08-14 08:54:02 +00:00
< tr >
2018-08-14 09:01:26 +00:00
< td class = "nowrap" > < span class = "label" > Position< / span > < span > {{ row.position|e }}{% if row.finishers %} / {{ row.finishers }}{% endif %}< / span > < / td >
< td class = "nowrap" > < span class = "label" > Name< / span > < span > < a href = "{{ url_for('person', title=person|trim|urlescape, start=None) }}" > {{ person|trim|e }}< / a > < / span > < / td >
< td class = "nowrap" > < span class = "label" > Licence< / span > < span > {% if row.licence %}< a href = "{{ url_for('licence', title=row.licence|trim|urlescape, year=row.date|year, start=None, show=ns.show) }}" > {{ row.licence|trim|e }}< / a > {% endif %}< / span > < / td >
2018-08-14 08:59:12 +00:00
< td > < span class = "label" > Time< / span > < span > {{ row.time|e }}< / span > < / td >
2018-08-14 09:05:57 +00:00
< td class = "nowrap" > < span class = "label" > Average Pace< / span > < span > {% if row.distance is number and row.distance|float != 0 %}{{ (row.time / row.distance|float) | pace }} min/KM{% endif %}< / span > < / td >
2018-08-14 08:54:02 +00:00
{%- if ltype != 'event' -%}
2018-08-14 09:02:56 +00:00
< td class = "long" > < span class = "label" > Race< / span > < span > < a href = "{{ url_for('races', title=row.event|trim|urlescape, year=row.date|year, start=None, show=ns.show) }}" > {{ row.event|trim|e }} ({{ row.distance|trim|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 >
2018-08-14 09:05:57 +00:00
{%- if row.sex and row.sexposition and row.sexposition | int < = 100 %}{{ row.sexposition|ordinal|e }} {{ row.sex|lower|gender|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 >