{% extends "base.html" %} {% block title %}{{ game.course_name or 'Game' }} โ€“ Skins & Pins{% endblock %} {% block content %}
{# Leaderboard #}
{% for p in results %} {% if game.format == 'skins' %} {% if skin_value and money_won %} {% set score_val = money_won.get(p.id, 0) %} {% set score_label = "%.4g" % score_val %} {% else %} {% set score_val = skins_won.get(p.id, 0) %} {% set score_label = score_val | string + ' skin' + ('s' if score_val != 1 else '') %} {% endif %} {% else %} {% set t = totals.get(p.id, {}) %} {% set score_val = t.total %} {% set score_label = t.total | round(1) | string + ' pts' %} {% endif %}
{% if loop.first %}๐Ÿ†{% else %}{{ loop.index }}{% endif %} {% if p.avatar and p.avatar.startswith('/') %} {% else %} {{ p.avatar or '๐Ÿ‘ค' }} {% endif %} {{ p.name }} {{ score_label }} {% if game.format == 'bingo_bango_bongo' %} B{{ t.bingo | int }}/{{ t.bango | round(1) }}/{{ t.bongo | int }} {% endif %}
{% endfor %} {% if game.format == 'skins' and unclaimed %}
{% if skin_value and unclaimed_money %}{{ "%.4g" % unclaimed_money }} unclaimed {% else %}{{ unclaimed }} skin{{ 's' if unclaimed != 1 else '' }} unclaimed{% endif %}
{% endif %}
{# Playing handicaps #} {% if playing_handicaps and playing_handicaps.values() | select | list %}
Playing Handicaps
{% for p in players %} {% set ph = playing_handicaps.get(p.id) %} {% if ph is not none %}
{% if p.avatar and p.avatar.startswith('/') %} {% else %}{{ p.avatar or '๐Ÿ‘ค' }}{% endif %} {{ p.name }} {% if p.handicap_snapshot is not none %} HI {{ p.handicap_snapshot }} {% endif %} HC {{ ph }} {% if p.tee_name %} {{ p.tee_name }} {% endif %}
{% endif %} {% endfor %}
{% endif %} {# Scorecard toggle #}
{% if game.format == 'skins' %} {% else %} {% endif %}
{# 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) %} {% set sr = strokes_per_hole.get(p.id, {}).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 %} {% set any_hc = playing_handicaps and playing_handicaps.values() | select | list %} {% if any_hc %} {% if hole_pars %}{% endif %} {% for p in players %} {% set ph = playing_handicaps.get(p.id) %} {% endfor %} {% endif %}
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 %} {% if has_stroke_index and sr > 0 %}{{ '/' * sr }}{% endif %}
Total{{ hole_pars.values() | sum }}{{ stroke_total.val or 'โ€”' }}
HC{{ ph if ph is not none else 'โ€”' }}
{# 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) }}
{# Skins scorecard #} {% if game.format == 'skins' %} {% if hole_pars %}{% endif %} {% for p in players %} {% endfor %} {% for h in holes %} {% set hr = skins_hole_results.get(h) %} {% 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) %} {% set sr = strokes_per_hole.get(p.id, {}).get(h, 0) %} {% endfor %} {% endfor %} {% if hole_pars %}{% endif %} {% for p in players %} {% if skin_value and money_won %} {% else %} {% endif %} {% endfor %}
HolePar {% if p.avatar and p.avatar.startswith('/') %} {% else %} {{ p.avatar or '๐Ÿ‘ค' }} {% endif %}
{{ p.name.split()[0] }}
Skin
{{ h }}{{ hole_pars.get(h, 'โ€”') }} {% if strokes %} {% set is_winner = hr and hr.winner == p.id %} {% 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 %} {% if has_stroke_index and sr > 0 %}{{ '/' * sr }}{% endif %} {% if hr %} {% if skin_value %} {% if hr.winner %}{{ "%.4g" % hr.money_pot }}{% else %}โ†’ {{ "%.4g" % hr.money_pot }}{% endif %} {% else %} {% if hr.winner %}โœ“{% if hr.pot > 1 %} {{ hr.pot }}{% endif %} {% else %}โ†’ {{ hr.pot }}{% endif %} {% endif %} {% endif %}
{% if skin_value %}Value{% else %}Skins{% endif %}{{ "%.4g" % money_won.get(p.id, 0) }}{{ skins_won.get(p.id, 0) }}{% if skin_value and unclaimed_money %}({{ "%.4g" % unclaimed_money }}){% elif unclaimed %}({{ unclaimed }}){% endif %}
{% endif %}
{% endblock %}