{% extends "base.html" %} {% block title %}Results: {{ question }}{% endblock %} {% block head %} {% endblock %} {% block content %}

{{ question }}

{% set total = results.counts | sum %}
{% for option in options %} {% set count = results.counts[loop.index0] %} {% set pct = (count / total * 100) | round(0) | int if total > 0 else 0 %} {% set is_winner = option in results.winners and results.total_votes > 0 %}
{{ option }} {% if is_winner %} {{ "Tie" if results.is_tie else "Winner" }} {% endif %} {{ count }} ({{ pct }}%)
{% endfor %}

Total votes: {{ results.total_votes }}

{% endblock %}