2012-02-06 22:08:08 +01:00
|
|
|
{% extends "base-projector.html" %}
|
2012-02-21 08:21:59 +01:00
|
|
|
|
|
|
|
{% load tags %}
|
|
|
|
{% load i18n %}
|
2012-04-14 14:51:56 +02:00
|
|
|
{% load staticfiles %}
|
2012-02-21 08:21:59 +01:00
|
|
|
|
2012-05-17 21:36:18 +02:00
|
|
|
{% block title %}{{ block.super }} - {{ assignment }}{% endblock %}
|
2012-07-04 16:14:19 +02:00
|
|
|
|
2011-09-06 07:33:13 +02:00
|
|
|
{% block header %}
|
2012-04-14 14:51:56 +02:00
|
|
|
<link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/assignment.css' %}" />
|
|
|
|
<script type="text/javascript" src="{% static 'javascript/assignment.js' %}"></script>
|
2011-09-06 07:33:13 +02:00
|
|
|
{% endblock %}
|
2012-07-04 16:14:19 +02:00
|
|
|
|
2011-07-31 10:46:29 +02:00
|
|
|
{% block content %}
|
2012-02-03 23:12:28 +01:00
|
|
|
{% if assignment.status != "fin" %}
|
2011-07-31 10:46:29 +02:00
|
|
|
<div id="sidebar">
|
2012-06-27 23:29:06 +02:00
|
|
|
<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>
|
2011-07-31 10:46:29 +02:00
|
|
|
</div>
|
2011-09-21 21:14:19 +02:00
|
|
|
{% endif %}
|
2012-06-27 23:29:06 +02:00
|
|
|
<h1>{% trans "Election" %}: {{ assignment }}</h1>
|
2012-04-24 22:27:16 +02:00
|
|
|
{% endblock %}
|
2011-07-31 10:46:29 +02:00
|
|
|
|
2012-04-24 22:27:16 +02:00
|
|
|
{% block scrollcontent %}
|
2012-08-04 15:02:02 +02:00
|
|
|
{% if not assignment.candidates %}
|
2012-07-04 00:40:25 +02:00
|
|
|
<p>
|
|
|
|
<div class="text">{{ assignment.description|linebreaks }}</div>
|
|
|
|
</p>
|
2011-09-21 21:14:19 +02:00
|
|
|
{% endif %}
|
2011-09-09 22:34:55 +02:00
|
|
|
|
2012-08-04 15:02:02 +02:00
|
|
|
{% if assignment.candidates and assignment.status != "fin" %}
|
2012-07-04 00:40:25 +02:00
|
|
|
<h3>{% trans "Candidates" %}</h3>
|
|
|
|
<ol>
|
2012-08-04 15:02:02 +02:00
|
|
|
{% for candidate in assignment.candidates %}
|
|
|
|
<li>{{ candidate }} </li>
|
2012-07-04 00:40:25 +02:00
|
|
|
{% empty %}
|
|
|
|
<li style="list-style: none outside none;">
|
|
|
|
<i>{% trans "No candidates available." %}</i>
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ol>
|
|
|
|
<p><br></p>
|
2011-07-31 10:46:29 +02:00
|
|
|
{% endif %}
|
2011-09-09 22:34:55 +02:00
|
|
|
|
2012-07-02 20:32:13 +02:00
|
|
|
{% if polls.exists %}
|
2012-07-04 00:40:25 +02:00
|
|
|
<h3>{% trans "Election results" %}</h3>
|
|
|
|
<table>
|
2012-07-04 16:14:19 +02:00
|
|
|
|
2012-07-04 00:40:25 +02:00
|
|
|
<tr>
|
|
|
|
<th>{% trans "Candidates" %}</th>
|
2012-07-10 00:47:00 +02:00
|
|
|
{% for poll in polls %}
|
2012-07-16 14:29:30 +02:00
|
|
|
<th>
|
|
|
|
<nobr>{{ poll.get_ballot }}. {% trans "ballot" %}</nobr>
|
|
|
|
</th>
|
2012-07-04 00:40:25 +02:00
|
|
|
{% endfor %}
|
|
|
|
</tr>
|
2012-07-04 16:14:19 +02:00
|
|
|
|
|
|
|
{% for candidate, poll_list in vote_results.items %}
|
2012-07-04 00:40:25 +02:00
|
|
|
<tr class="{% cycle 'odd' '' %}">
|
2012-09-18 22:55:31 +02:00
|
|
|
<td class="candidate{% if candidate in assignment.elected %} elected{% endif %}">
|
|
|
|
{% if candidate in assignment.elected %}
|
2012-07-04 00:40:25 +02:00
|
|
|
<a class="elected">
|
|
|
|
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Candidate is elected' %}">
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
{{ candidate }}
|
|
|
|
</td>
|
2012-07-10 00:47:00 +02:00
|
|
|
{% for vote in poll_list %}
|
2012-09-18 22:55:31 +02:00
|
|
|
<td style="white-space:nowrap;"{% if candidate in assignment.elected %} class="elected"{% endif %}>
|
|
|
|
{% if not assignment_publish_winner_results_only or candidate in assignment.elected %}
|
2012-07-10 00:47:00 +02:00
|
|
|
{% 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>
|
2012-07-02 20:32:13 +02:00
|
|
|
{% endfor %}
|
2012-07-04 00:40:25 +02:00
|
|
|
</tr>
|
2011-09-07 23:25:59 +02:00
|
|
|
{% endfor %}
|
2012-07-04 16:14:19 +02:00
|
|
|
|
2012-07-04 00:40:25 +02:00
|
|
|
<tr>
|
2012-07-16 14:00:29 +02:00
|
|
|
<td>{% trans 'Invalid votes' %}</td>
|
2012-07-04 00:40:25 +02:00
|
|
|
{% for poll in polls %}
|
2012-07-16 14:29:30 +02:00
|
|
|
<td style="white-space:nowrap;">
|
|
|
|
{% if poll.has_votes %}
|
|
|
|
<img src="{% static 'images/icons/voting-invalid.png' %}" title="{% trans 'Invalid' %}">
|
|
|
|
{{ poll.print_votesinvalid }}
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
|
2012-07-04 00:40:25 +02:00
|
|
|
{% endfor %}
|
|
|
|
</tr>
|
2012-07-04 16:14:19 +02:00
|
|
|
|
2012-07-04 00:40:25 +02:00
|
|
|
<tr class="total">
|
2012-07-16 14:29:30 +02:00
|
|
|
<td>
|
|
|
|
<strong>{% trans 'Votes cast' %}</strong>
|
|
|
|
</td>
|
2012-07-04 00:40:25 +02:00
|
|
|
{% for poll in polls %}
|
2012-07-16 14:29:30 +02:00
|
|
|
|
|
|
|
<td style="white-space:nowrap;">
|
|
|
|
{% if poll.has_votes %}
|
|
|
|
<img src="{% static 'images/icons/voting-total.png' %}" title="{% trans 'Votes cast' %}">
|
|
|
|
<strong>{{ poll.print_votescast }}</strong>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
2012-07-04 00:40:25 +02:00
|
|
|
{% endfor %}
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
{% endif %}
|
2011-07-31 10:46:29 +02:00
|
|
|
{% endblock %}
|