{% extends "base.html" %} {% block introduction %} {% if msgs.lede %}
🔗 {{abif_id}}     (tags: { {% for t in msgs.taglist %} {{t}} {% if not loop.last %}, {% endif %} {% endfor %} })

{{ 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/ or /id//all) #} {% set is_all_route = (resulttype is defined and (not resulttype or resulttype == 'all')) %} {# Consider 'dot' and 'wlt' together for pairwise; treat as 'all' when each method is available #} {% set all_results_generated = is_all_route and ( 'FPTP' in result_types and 'IRV' in result_types and 'STAR' in result_types and 'approval' in result_types and ('dot' in result_types or 'wlt' in result_types) ) %} {% include 'abifbox-snippet.html' %} {# Duplicate the compact methods nav just under the ABIF box #} {% include 'methods-nav-snippit.html' %}

{{ webenv.statusStr }}Results

{% if abif_id %} {% set pathpart="/id/" + abif_id %} {% set abslink=webenv.base_url + pathpart %}
🔗{{abslink}}
{% endif %} {% if msgs.results_name %}

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 %}

{% for restype in result_types %} {% if restype == 'dot' and ('dot' in result_types or 'wlt' in result_types) %} {% elif restype == 'FPTP' %} {% elif restype == 'IRV' %} {% elif restype == 'STAR' %} {% elif restype == 'approval' %} {% endif %} {% endfor %}
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 %}
tabbed view

{% for restype in result_types %} {% if restype == 'dot' %}
{############ condorcet/pairwise ############} {% if 'dot' in result_types or 'wlt' in result_types %}

Condorcet/Copeland results

{% if abif_id %} {% set pairwise_pathpart="/id/" + abif_id + "/pairwise#pairwise" %} {% set pairwise_abslink=webenv.base_url + pairwise_pathpart %}
{{abif_id}} Condorcet/Copeland results permalink:
🔗{{pairwise_abslink}}
{% endif %} {% set notices = resblob.notices.pairwise %} {% include 'notice-snippet.html' %} {% if pairwise_summary_html %} {{ pairwise_summary_html | safe }} {% endif %} {% if 'wlt' in result_types and pairwise_html %}

Win-loss-tie (Condorcet/Copeland) table

{% if abif_id %} {% set wlt_pathpart="/id/" + abif_id + "/pairwise#wlt" %} {% set wlt_abslink=webenv.base_url + wlt_pathpart %}
{{abif_id}} w-l-t table permalink:
🔗{{wlt_abslink}}
{% endif %} {{ pairwise_html | safe }} {% endif %} {% if 'dot' in result_types and dotsvg_html %}

Pairwise tournament (Copeland ordered)

{% if abif_id %} {% set dot_pathpart="/id/" + abif_id + "/pairwise#dot" %} {% set dot_abslink=webenv.base_url + dot_pathpart %}
{{abif_id}} pairwise diagram permalink:
🔗{{dot_abslink}}
{% endif %} {% if abif_id %}

{{ dotsvg_html | safe }}

{% else %}

{{ dotsvg_html | safe }}

{% endif %} {% endif %} {% endif %}
{% elif restype == 'wlt' %} {# wlt section now handled by dot section above - this maintains backward compatibility #} {% elif restype == 'FPTP' %}
{############ FPTP ############} {% set rellink=restype + "#" + restype %} {% if 'FPTP' in result_types %}

FPTP result

{% if abif_id %} {% set pathpart="/id/" + abif_id + "/" + rellink %} {% set abslink=webenv.base_url + pathpart %}
"FPTP" is "First-past-the-post", also known as "plurality" or "choose-one"
{{abif_id}} FPTP results permalink:
🔗{{abslink}}
{% endif %} {% set notices = resblob.notices.fptp %} {% include 'notice-snippet.html' %}

{% include 'fptp-snippet.html' %}

{% endif %}
{% elif restype == 'IRV' %}
{############ IRV ############} {% set rellink=restype + "#" + restype %} {% if 'IRV' in result_types and IRV_dict %}

IRV/RCV results

{% if abif_id %} {% set pathpart="/id/" + abif_id + "/" + rellink %} {% set abslink=webenv.base_url + pathpart %}
{{abif_id}} IRV/RCV result permalink:
🔗{{abslink}}
{% endif %} {% set notices = resblob.notices.irv %} {% include 'notice-snippet.html' %}

{% include 'irv-snippet.html' %}

{% endif %}
{% elif restype == 'STAR' %}
{############ STAR ############} {% set rellink=restype + "#" + restype %} {% if 'STAR' in result_types and STAR_html %}

STAR results

{% if abif_id %} {% set pathpart="/id/" + abif_id + "/" + rellink %} {% set abslink=webenv.base_url + pathpart %}
{{abif_id}} STAR results permalink:
🔗{{abslink}}
{% endif %} {% if scorestardict and scorestardict['star_lede'] %}

{{ 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 %}
{% elif restype == 'approval' %}
{############ Approval Voting ############} {% set rellink=restype + "#" + restype %} {% if 'approval' in result_types and approval_text %}

Approval voting results

{% if abif_id %} {% set pathpart="/id/" + abif_id + "/" + rellink %} {% set abslink=webenv.base_url + pathpart %}
{{abif_id}} approval voting results permalink:
🔗{{abslink}}
{% endif %} {% set notices = resblob.notices.approval %} {% include 'notice-snippet.html' %} {% include 'approval-snippet.html' %} {% endif %}
{% endif %} {% endfor %}
{% include 'methods-nav-snippit.html' %}

(homepage)

{% endblock content %}