{% extends "base.html" %} {% block introduction %} {% if msgs.lede %}
{{ msgs.lede | safe }}
{% else %}Your .abif has been processed. See results below
{% endif %} {% endblock introduction %} {% block content %} {# Route-aware detection to avoid masking backend over-computation # Only treat as "all methods" when the route intends it (/id/The {{msgs.results_name}} of {{abif_id}} are below, and can be edited in the field above.
{% elif msgs.results_lede %} {# msgs.results_lede is DEPRECATED as of 2024-06-19 #}{{ msgs.results_lede | safe }}
{% else %}Below are various abiftool output blocks for the ABIF above. {% endif %}
| Method | Winner |
|---|---|
| Condorcet/Copeland | {% if copewinners and FPTP_candnames %} {%- for tok in copewinners -%} {{ FPTP_candnames[tok] if tok in FPTP_candnames else tok }}{% if not loop.last %}, {% endif %} {%- endfor -%} {% elif copewinnerstring %} {{ copewinnerstring }} {% else %} N/A {% endif %} |
| FPTP | {% if FPTP_candnames and resblob and resblob['FPTP_result'] and resblob['FPTP_result']['winners'] %} {% set winner_token = resblob['FPTP_result']['winners'][0] %} {{ FPTP_candnames[winner_token] if winner_token in FPTP_candnames else winner_token }} {% elif resblob and resblob['FPTP_result'] and resblob['FPTP_result']['winners'] %} {{ resblob['FPTP_result']['winners'][0] }} {% else %} N/A {% endif %} |
| IRV/RCV | {% if IRV_dict and IRV_dict['winner'] and IRV_candnames %} {%- for winner_token in IRV_dict['winner'] -%} {{ IRV_candnames[winner_token] if winner_token in IRV_candnames else winner_token }}{% if not loop.last %}, {% endif %} {%- endfor -%} {% elif IRV_dict and IRV_dict['winnerstr'] %} {{ IRV_dict['winnerstr'] }} {% else %} N/A {% endif %} |
| STAR | {% if scorestardict and scorestardict['scoremodel']['winner'] and FPTP_candnames %} {% set winner_name = scorestardict['scoremodel']['winner'] %} {# Handle both single winners and ties in STAR results #} {% if "tie " in winner_name %} {# Handle STAR ties: extract candidate names from tie string #} {%- for token, name in FPTP_candnames.items() -%} {%- if name in winner_name -%} {{ name }}{% if not loop.last and loop.index < FPTP_candnames|length %}, {% endif %} {%- endif -%} {%- endfor -%} {% else %} {# Handle single winner #} {% set winner_found = false %} {% for token, name in FPTP_candnames.items() if not winner_found %} {% if winner_name == name %} {{ winner_name }} {% set winner_found = true %} {% endif %} {% endfor %} {% if not winner_found %}{{ winner_name }}{% endif %} {% endif %} {% elif scorestardict and scorestardict['scoremodel']['winner'] %} {{ scorestardict['scoremodel']['winner'] }} {% else %} N/A {% endif %} |
| Approval | {% if approval_result and approval_result['winners'] and FPTP_candnames %} {%- for winner in approval_result['winners'] -%} {{ FPTP_candnames[winner] if winner in FPTP_candnames else winner }}{% if not loop.last %}, {% endif %} {%- endfor -%} {% elif approval_result and approval_result['winners'] %} {% for winner in approval_result['winners'] %}{{ winner }}{% if not loop.last %}, {% endif %}{% endfor %} {% else %} N/A {% endif %} |
{{ dotsvg_html | safe }}
{% endif %} {% endif %} {% endif %}{% include 'fptp-snippet.html' %}
{% endif %}{% include 'irv-snippet.html' %}
{{ scorestardict['star_lede'] }}
{% endif %} {% set notices = resblob.notices.star %} {% include 'notice-snippet.html' %}{% include 'star-snippet.html' %}
{% if scorestardict and scorestardict['star_foot'] %}{{ scorestardict['star_foot'] }}
{% endif %} {% endif %}(homepage)
{% endblock content %}