{% 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 %} {% set all_results_generated = (result_types|length == 5) %} {% include 'abifbox-snippet.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'] %} {% set winner_token = namespace(value=None) %} {% for cand_token in scorestardict['scoremodel']['ranklist'] %} {% if scorestardict['scoremodel']['scores'][cand_token]['candname'] == winner_name and winner_token.value is none %} {% set winner_token.value = cand_token %} {% endif %} {% endfor %} {% if winner_token.value %} {{ winner_name }} {% else %} {{ winner_name }} {% 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
{% if abif_id and not all_results_generated %}

{% 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 + "/wlt#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 (Condorcet/Copeland) diagram

{% if abif_id %} {% set dot_pathpart="/id/" + abif_id + "/dot#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 %}

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

(homepage)

{% endblock content %}