{% 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 the results of the election represented above using various election methods with abiftool/abiflib. {% if msgs.ballot_type %} The detected ballot type from the ABIF above is "{{ msgs.ballot_type }}"{% endif %}. Some methods may transform these ballots for analysis; see method notices for details. Resubmit the ABIF with "Transform ballots" turned off to minimize the transformations. {% endif %}
| Method | Winner |
|---|---|
| Condorcet/Copeland | {% set _cope = copewinners if copewinners else resblob.get('copewinners', []) %} {% if _cope and FPTP_candnames %} {%- for tok in _cope -%} {{ FPTP_candnames[tok] if tok in FPTP_candnames else tok }}{% if not loop.last %}, {% endif %} {%- endfor -%} {% elif copewinnerstring or resblob.get('copewinnerstring') %} {{ copewinnerstring or resblob.get('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'] %} {% set winner_name = scorestardict['scoremodel']['winner'] %} {% if FPTP_candnames %} {# 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 - find matching candidate name #} {%- for token, name in FPTP_candnames.items() -%} {%- if winner_name == name -%} {{ winner_name }} {%- endif -%} {%- endfor -%} {% endif %} {% else %} {# No FPTP_candnames available, show raw winner #} {{ winner_name }} {% endif %} {% 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 %}