Source

Ochs / templates / news / poll.html

{% if not is_ajax %}
<div class="poll">
{% endif %}
    <h4>{{ poll.question }}</h4>
    <form method="post" action="/poll/vote/{{ poll.id }}/">
    <input type="hidden" name="poll" value="{{ poll.id }}" />
    <table cellspacing="0">
        {% for choice in choices %}
        <tr>
            <td>{{ choice.choice }}</td>
            {% if poll.already_answered %}
            <td>{{ choice.percentage }}%</td>
            {% else %}
            <td><input type="radio" name="choice" value="{{ choice.id }}" /></td>
            {% endif %}
            <td>
        </tr>
        {% endfor %}
        <tfoot>
            <tr><td colspan="2">{{ total_votes }} total votes</td></tr>
        </tfoot>
    </table>
    </form>
{% if not is_ajax %}
</div>
{% endif %}