{% load i18n %}

{% if poll %}
    {% if voted_already %}
        {% if show_results %}
            <div class="poll">
                <p>{{poll.question}}</p>
                <ul>
                {% for item in poll.items.all %}
                    <li>
                        {{item.content}}
                        <div class="poll-bar"><div class="poll-bar-inner" style="width:{{item.vote_ratio|stringformat:"f"}}%;"></div>
                    </li>
                {% endfor %}
                </ul>
            </div>
        {% endif %}
    {% else %}
        <div class="poll">
          <p>{{poll.question}}</p>
          <br>
            <form action="{{poll.get_absolute_url}}" method="post">{% csrf_token %}
            {{ form.vote }}
            <input type="submit" value="{% trans "Wyślij" %}" />
            </form>
        </div>
    {% endif %}
{% endif %}
