67 lines
2.2 KiB
HTML
67 lines
2.2 KiB
HTML
{% extends 'assignment/base_assignment.html' %}
|
|
|
|
{% load i18n %}
|
|
|
|
{% block title %}{{ block.super }} - {%trans "Poll" %} "{{ poll }}"{% endblock %}
|
|
|
|
{% block content %}
|
|
<h1>{{ poll }}</h1>
|
|
<p>{{ ballotnumber }}. {%trans "ballot" %}: {{options.count}}
|
|
{% blocktrans count counter=options|length %}candidate{% plural %}candidates{% endblocktrans %}
|
|
</p>
|
|
<p><b>{% trans "Short description" %}:</b> {{ poll.description }}</p>
|
|
<i>-1 := {% trans 'majority' %}, -2 := {% trans 'undocumented' %}</i>
|
|
<form action="" method="post" class="small-form">{% csrf_token %}
|
|
<table style="width:auto">
|
|
<tr>
|
|
<th>Option</th>
|
|
{% for value in poll.get_vote_values %}
|
|
<th>{{ value }}</th>
|
|
{% endfor %}
|
|
</tr>
|
|
{% for form in forms %}
|
|
<tr>
|
|
<td>{{ form.option }}</td>
|
|
{% for value in form %}
|
|
<td>
|
|
{{ value.errors }}
|
|
{{ value }}
|
|
</td>
|
|
{% endfor %}
|
|
</tr>
|
|
{% endfor %}
|
|
<tr class="total">
|
|
<td>{% trans "Invalid votes" %}</td>
|
|
<td>{{ pollform.votesinvalid.errors }}{{ pollform.votesinvalid }}</td>
|
|
</tr>
|
|
<tr class="total">
|
|
<td>{% trans "Votes cast" %}</td>
|
|
<td>{{ pollform.votescast.errors }}{{ pollform.votescast }}</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p>
|
|
<a href='{% url print_assignment_poll poll.id %}'>
|
|
<span class="button">
|
|
<span class="icon pdf">{%trans 'Print ballot' %}</span>
|
|
</span>
|
|
</a>
|
|
</p>
|
|
|
|
<p>
|
|
<button class="button" type="submit">
|
|
<span class="icon ok">{%trans 'Save' %}</span>
|
|
</button>
|
|
<button class="button" type="submit" name="apply">
|
|
<span class="icon apply">{%trans 'Apply' %}</span>
|
|
</button>
|
|
<a href='{% url assignment_view poll.assignment.id %}'>
|
|
<button class="button" type="button" onclick="window.location='{% url assignment_view poll.assignment.id %}'">
|
|
<span class="icon cancel">{%trans 'Cancel' %}</span>
|
|
</button>
|
|
</a>
|
|
</p>
|
|
</form>
|
|
|
|
{% endblock %}
|