{% load filters %}

<div class="row">
    <div class="col-12"><h4>Голосование за идею <span
            class="text-muted">(проголосовало {{ idea.votes.all|length }})</span>
    </h4></div>
</div>
<div class="row">
    {# if user already voted #}
    {% if idea|voted:request.user %}
        {% include 'magplan/ideas/_voting_results.html' %}
    {% else %}
        <div class="col-6">
            <strong>Выбери один из пунктов:</strong>
        </div>
        <div class="col-6">
            {% for i in 5|times %}
                <form method="POST" action="{% url 'ideas_vote' idea.id %}">
                    {% csrf_token %}
                    <input type="hidden" name="score" value="{%  widthratio i 1 25 %}"/>
                    <input style="margin-bottom: 0.5rem;" type="submit" class="btn btn-block btn-{{ i|score_css_color_by_index }}"
                           value="{{ i|emoji_sign_by_index }} {{ i|humanize_score_index }}"/>
                </form>
            {% endfor %}
        </div>

    {% endif %}

</div>
