{% extends "base.html" %} {% block title %}{{ game.course_name or 'Game' }} โ€“ Skins & Pins{% endblock %} {% block content %}
{# Leaderboard #}
{% for p in results %} {% set t = totals.get(p.id, {}) %}
{% if loop.first %}๐Ÿ†{% else %}{{ loop.index }}{% endif %} {% if p.avatar and p.avatar.startswith('/') %} {% else %} {{ p.avatar or '๐Ÿ‘ค' }} {% endif %} {{ p.name }} {{ t.total | round(1) }} pts B{{ t.bingo | int }}/{{ t.bango | round(1) }}/{{ t.bongo | int }}
{% endfor %}
{# Scorecard toggle #}
{# Strokes scorecard #} {% if hole_pars %}{% endif %} {% for p in players %} {% endfor %} {% for h in holes %} {% if hole_pars %}{% endif %} {% for p in players %} {% set s = scores.get(h, {}).get(p.id, {}) %} {% set strokes = s.strokes if s else 0 %} {% set par = hole_pars.get(h, 0) %} {% endfor %} {% endfor %} {% if hole_pars %}{% endif %} {% for p in players %} {% set stroke_total = namespace(val=0) %} {% for h in holes %} {% set s = scores.get(h, {}).get(p.id, {}) %} {% if s and s.strokes %}{% set stroke_total.val = stroke_total.val + s.strokes %}{% endif %} {% endfor %} {% endfor %}
HolePar {% if p.avatar and p.avatar.startswith('/') %} {% else %} {{ p.avatar or '๐Ÿ‘ค' }} {% endif %}
{{ p.name.split()[0] }}
{{ h }}{{ hole_pars.get(h, 'โ€”') }} {% if strokes %} {% if par %} {% set diff = strokes - par %} {% if strokes == 1 %} {{ strokes }} {% elif diff <= -2 %} {{ strokes }} {% elif diff == -1 %} {{ strokes }} {% elif diff == 1 %} {{ strokes }} {% elif diff >= 2 %} {{ strokes }} {% else %} {{ strokes }} {% endif %} {% else %} {{ strokes }} {% endif %} {% else %} โ€” {% endif %}
Total{{ hole_pars.values() | sum }}{{ stroke_total.val or 'โ€”' }}
{# Points scorecard #} {% for p in players %} {% endfor %} {% for h in holes %} {% for p in players %} {% set s = scores.get(h, {}).get(p.id, {}) %} {% set pts = (s.bingo + s.bango + s.bongo) if s else 0 %} {% endfor %} {% endfor %} {% for p in players %} {% endfor %}
Hole {% if p.avatar and p.avatar.startswith('/') %} {% else %} {{ p.avatar or '๐Ÿ‘ค' }} {% endif %}
{{ p.name.split()[0] }}
{{ h }}{{ pts | round(1) if pts else 'โ€”' }}
Total{{ totals.get(p.id, {}).get('total', 0) | round(1) }}
{% endblock %}