{# Jinja2 template for pairwise/win-loss-tie table (simple version) #} {% if colordict %} {% endif %}
{% for rk in candtoks %} {% for ck in candtoks %} {% if not loop.last %} {% if candtoks.index(rk) > candtoks.index(ck) %} {% elif rk == ck %} {% else %} {% if candtoks.index(rk) < candtoks.index(ck) %} {% else %} {% endif %} {% endif %} {% endif %} {% endfor %} {% endfor %}
{{ title | e }} pairwise matchups
{{ candnames[rk] }}
({{ "{:,}".format(wltdict[rk]['wins']) }}-{{ "{:,}".format(wltdict[rk]['losses']) }}-{{ "{:,}".format(wltdict[rk]['ties']) }})
{% set cell = paircells[rk][ck] if paircells else None %} {% if cell %}
{{ candnames[ck] }}: {{ "{:,}".format(cell.ck_score) }}({{ "%.1f"|format(cell.ck_pct) }}%)
{{ candnames[rk] }}: {{ "{:,}".format(cell.rk_score) }}({{ "%.1f"|format(cell.rk_pct) }}%){% if not (pairdict[ck][rk] > pairdict[rk][ck]) %}{% endif %}
(No preference: {{ "{:,}".format(cell.no_pref) }}; {{ "%.1f"|format(cell.no_pref_pct) }}%)
{% else %} {# Fallback to original two-row layout if paircells missing #} {% set total_votes = pairdict[ck][rk] + pairdict[rk][ck] %} {% set ck_score = pairdict[ck][rk] %} {% set ck_percentage = (ck_score / total_votes * 100) if total_votes > 0 else 0 %}
{{ candnames[ck] }}: {{ "{:,}".format(ck_score) }}({{ "%.1f"|format(ck_percentage) }}%)
{% set rk_score = pairdict[rk][ck] %} {% set rk_percentage = (rk_score / total_votes * 100) if total_votes > 0 else 0 %}
{{ candnames[rk] }}: {{ "{:,}".format(rk_score) }}({{ "%.1f"|format(rk_percentage) }}%){% if not (pairdict[ck][rk] > pairdict[rk][ck]) %}{% endif %}
{% endif %}
{{ candnames[rk] }}
{% if is_copeland_tie %} {{ "{:,}".format(wltdict[rk]['losses']) }} loss{{ 'es' if wltdict[rk]['losses'] != 1 else '' }} / {{ "{:,}".format(wltdict[rk]['wins']) }} victor{{ 'y' if wltdict[rk]['wins'] == 1 else 'ies' }} {% elif loop.index0 == 0 %} {{ "{:,}".format(wltdict[rk]['wins']) }} victor{{ 'y' if wltdict[rk]['wins'] == 1 else 'ies' }} ⇣ {% else %} ⇽ {{ "{:,}".format(wltdict[rk]['losses']) }} loss{{ 'es' if wltdict[rk]['losses'] != 1 else '' }} / {{ "{:,}".format(wltdict[rk]['wins']) }} victor{{ 'y' if wltdict[rk]['wins'] == 1 else 'ies' }} ⇣ {% endif %}
{% if is_copeland_tie %}
"Victories" and "losses" sometimes aren't displayed in the expected location when there are ties and/or cycles in the results, but the numbers provided should be accurate.
{% endif %} {% if svg_text %}
{{ svg_text|safe }}
{% endif %}