333349a1f2
Also fix AssignmentPDF-Poll-Table
118 lines
4.6 KiB
HTML
118 lines
4.6 KiB
HTML
{% extends "base-projector.html" %}
|
|
|
|
{% load tags %}
|
|
{% load i18n %}
|
|
{% load staticfiles %}
|
|
|
|
{% block title %}{{ block.super }} - {{ assignment }}{% endblock %}
|
|
|
|
{% block header %}
|
|
<link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/assignment.css' %}" />
|
|
<script type="text/javascript" src="{% static 'javascript/assignment.js' %}"></script>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
{% if assignment.status != "fin" %}
|
|
<div id="sidebar">
|
|
<div class="box">
|
|
<p><b>{% trans "Status" %}:</b><br>
|
|
{% trans assignment.get_status_display %}</p>
|
|
{% if assignment.status == "sea" or assignment.status == "vot" %}
|
|
<p><b>{% trans "Number of available posts" %}:</b><br>
|
|
{{ assignment.posts }}</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
<h1>{% trans "Election" %}: {{ assignment }}</h1>
|
|
{% endblock %}
|
|
|
|
{% block scrollcontent %}
|
|
{% if not assignment.profile.exists %}
|
|
<p>
|
|
<div class="text">{{ assignment.description|linebreaks }}</div>
|
|
</p>
|
|
{% endif %}
|
|
|
|
{% if assignment.profile.exists and assignment.status != "fin" %}
|
|
<h3>{% trans "Candidates" %}</h3>
|
|
<ol>
|
|
{% for profile in assignment.profile.all|dictsort:"user.first_name" %}
|
|
<li>{{ profile }} </li>
|
|
{% empty %}
|
|
<li style="list-style: none outside none;">
|
|
<i>{% trans "No candidates available." %}</i>
|
|
</li>
|
|
{% endfor %}
|
|
</ol>
|
|
<p><br></p>
|
|
{% endif %}
|
|
|
|
{% if polls.exists %}
|
|
<h3>{% trans "Election results" %}</h3>
|
|
<table>
|
|
|
|
<tr>
|
|
<th>{% trans "Candidates" %}</th>
|
|
{% for poll in polls %}
|
|
<th><nobr>{{ poll.get_ballot }}. {% trans "ballot" %}</nobr></th>
|
|
{% endfor %}
|
|
</tr>
|
|
|
|
{% for candidate, poll_list in vote_results.items %}
|
|
<tr class="{% cycle 'odd' '' %}">
|
|
<td class="candidate{% if candidate.1 %} elected{% endif %}">
|
|
{% if candidate in assignment.elected.all %}
|
|
<a class="elected">
|
|
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Candidate is elected' %}">
|
|
</a>
|
|
{% endif %}
|
|
{{ candidate }}
|
|
</td>
|
|
{% for vote in poll_list %}
|
|
<td style="white-space:nowrap;"{% if candidate in assignment.elected.all %} class="elected"{% endif %}>
|
|
{% if not assignment_publish_winner_results_only or candidate in assignment.elected.all %}
|
|
{% if 'Yes' in vote and 'No' in vote and 'Abstain' in vote %}
|
|
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Yes' %}"> {{ vote.Yes }}<br>
|
|
<img src="{% static 'images/icons/voting-no.png' %}" title="{% trans 'No' %}"> {{ vote.No }}<br>
|
|
<img src="{% static 'images/icons/voting-abstention.png' %}" title="{% trans 'Abstention' %}"> {{ vote.Abstain }}<br>
|
|
{% elif 'Votes' in vote %}
|
|
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Yes' %}"> {{ vote.Votes }}
|
|
{% elif vote == None %}
|
|
{% trans 'was not a <br> candidate'%}
|
|
{% else %}
|
|
|
|
{% endif %}
|
|
{% else %}
|
|
|
|
{% endif %}
|
|
</td>
|
|
{% endfor %}
|
|
</tr>
|
|
{% endfor %}
|
|
|
|
<tr>
|
|
<td>{%trans 'Invalid votes' %}</td>
|
|
{% for poll in polls %}
|
|
{% if poll.published %}
|
|
<td style="white-space:nowrap;"><img src="{% static 'images/icons/voting-invalid.png' %}" title="{% trans 'Invalid' %}"> {{ poll.print_votesinvalid }}</td>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</tr>
|
|
|
|
<tr class="total">
|
|
<td><b>{%trans 'Votes cast' %}</b></td>
|
|
{% for poll in polls %}
|
|
{% if poll.published %}
|
|
<td style="white-space:nowrap;"><img src="{% static 'images/icons/voting-total.png' %}" title="{% trans 'Votes cast' %}"> <b>{{ poll.print_votescast }}</b></td>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</tr>
|
|
|
|
</table>
|
|
{% elif assignment.profile.exists %}
|
|
<i>{% trans "No ballots available." %}</i>
|
|
{% endif %}
|
|
<br>
|
|
{% endblock %}
|