{% load i18n %}

{% for option in poll.options.all %}
{% if forloop.first or not forloop.counter|divisibleby:2 %}
<div class="mx-auto mb-3 w-full md:w-3/4">
{% endif %}
<div class="col-md-6">
  <b>{{ option.text }}</b> <span class="text-sm text-white/60">({{ option.percentage|floatformat }}%)</span>
  <div class="my-2 h-6 rounded bg-charcoal" aria-valuenow="{{ option.percentage|floatformat }}" aria-valuemin="0" aria-valuemax="100">
    <div class="{% if option.percentage > 0 %}w-[{{ option.percentage|floatformat }}%]{% else %}w-1{% endif %} bg-gradient-to-r from-green to-orange h-6 rounded"></div>
  </div>
</div>
{% if forloop.last or forloop.counter|divisibleby:2 %}
</div>
{% endif %}
{% endfor %}
<div class="mx-auto mb-3 w-full md:w-3/4">
  {% trans "Total votes:" %}&nbsp;{{ poll.votes|length }}
</div>
