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 %}
|
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 %}
|
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-02-03 23:12:28 +01:00
|
|
|
{% if not assignment.profile.exists %}
|
2011-07-31 10:46:29 +02:00
|
|
|
<p>
|
2012-02-03 23:12:28 +01:00
|
|
|
<div class="text">{{ assignment.description|linebreaks }}</div>
|
2011-07-31 10:46:29 +02:00
|
|
|
</p>
|
2011-09-21 21:14:19 +02:00
|
|
|
{% endif %}
|
2011-09-09 22:34:55 +02:00
|
|
|
|
2012-02-03 23:12:28 +01:00
|
|
|
{% if assignment.profile.exists and assignment.status != "fin" %}
|
2011-07-31 10:46:29 +02:00
|
|
|
<h3>{% trans "Candidates" %}</h3>
|
|
|
|
<ol>
|
2012-02-03 23:12:28 +01:00
|
|
|
{% for profile in assignment.profile.all|dictsort:"user.first_name" %}
|
2011-07-31 10:46:29 +02:00
|
|
|
<li>{{ profile }} </li>
|
|
|
|
{% empty %}
|
|
|
|
<li style="list-style: none outside none;">
|
|
|
|
<i>{% trans "No candidates available." %}</i>
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ol>
|
2011-09-21 21:14:19 +02:00
|
|
|
<p><br></p>
|
2011-07-31 10:46:29 +02:00
|
|
|
{% endif %}
|
2011-09-09 22:34:55 +02:00
|
|
|
|
2012-05-19 08:09:18 +02:00
|
|
|
{% if polls.count > 0 %}
|
2011-07-31 10:46:29 +02:00
|
|
|
<h3>{% trans "Election results" %}</h3>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<th>{% trans "Candidates" %}</th>
|
2012-02-03 23:12:28 +01:00
|
|
|
{% for poll in assignment.poll_set.all %}
|
2011-09-08 12:30:34 +02:00
|
|
|
{% if poll.published %}
|
|
|
|
<th><nobr>{{forloop.counter}}. {% trans "ballot" %}</nobr></th>
|
|
|
|
{% endif %}
|
2011-07-31 10:46:29 +02:00
|
|
|
{% endfor %}
|
|
|
|
</tr>
|
|
|
|
{% for vote in votes %}
|
|
|
|
<tr class="{% cycle 'odd' '' %}">
|
2011-09-05 20:47:55 +02:00
|
|
|
{% with vote|first as candidate %}
|
2011-09-21 21:10:23 +02:00
|
|
|
<td class="candidate {% if candidate.1 %}elected{% endif %}">
|
2011-09-05 20:47:55 +02:00
|
|
|
{% if candidate.1 %}
|
2012-04-14 14:51:56 +02:00
|
|
|
<a class="elected"><img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Candidate is elected' %}"></a>
|
2011-09-05 20:47:55 +02:00
|
|
|
{% endif %}
|
2011-09-06 07:33:13 +02:00
|
|
|
{{ candidate.0 }}
|
2011-09-05 20:47:55 +02:00
|
|
|
</td>
|
|
|
|
{% for v in vote|last %}
|
2011-09-21 21:17:22 +02:00
|
|
|
<td style="white-space:nowrap;" {% if candidate.1 %}class="elected"{% endif %}>{% if v %}
|
|
|
|
{% if v|length == 3 %}
|
2012-04-14 14:51:56 +02:00
|
|
|
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Yes' %}"> {% if v.0 %}{{ v.0 }}{% else %}∅{% endif %}<br>
|
|
|
|
<img src="{% static 'images/icons/voting-no.png' %}" title="{% trans 'No' %}"> {% if v.1 %}{{ v.1 }}{% else %}∅{% endif %}<br>
|
|
|
|
<img src="{% static 'images/icons/voting-abstention.png' %}" title="{% trans 'Abstention' %}"> {% if v.2 %}{{ v.2 }}{% else %}∅{% endif %}<br>
|
2011-09-21 21:17:22 +02:00
|
|
|
{% else %}
|
2012-04-14 14:51:56 +02:00
|
|
|
{% if v != "-" %}<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Yes' %}">{% endif %}
|
2011-07-31 10:46:29 +02:00
|
|
|
{{ v }}
|
|
|
|
{% endif %}
|
2011-09-21 21:17:22 +02:00
|
|
|
{% endif %}
|
2011-07-31 10:46:29 +02:00
|
|
|
</td>
|
|
|
|
{% endfor %}
|
2011-09-21 21:10:23 +02:00
|
|
|
{% endwith %}
|
2011-09-09 22:34:55 +02:00
|
|
|
</tr>
|
2011-07-31 10:46:29 +02:00
|
|
|
{% empty %}
|
|
|
|
<tr>
|
2012-02-03 23:12:28 +01:00
|
|
|
<td {% if assignment.profile.exist %}colspan="2"{% endif %}><i>{% trans "No ballots available." %}</i></td>
|
2011-07-31 10:46:29 +02:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
2011-09-07 23:25:59 +02:00
|
|
|
<tr>
|
|
|
|
<td>{%trans 'Invalid votes' %}</td>
|
|
|
|
{% for p in polls %}
|
2011-09-08 12:30:34 +02:00
|
|
|
{% if p.published %}
|
2012-04-21 21:38:59 +02:00
|
|
|
<td style="white-space:nowrap;"><img src="{% static 'images/icons/voting-invalid.png' %}" title="{% trans 'Invalid' %}"> {{ p.print_votesinvalid }}</td>
|
2011-09-08 12:30:34 +02:00
|
|
|
{% endif %}
|
2011-09-07 23:25:59 +02:00
|
|
|
{% endfor %}
|
|
|
|
</tr>
|
|
|
|
<tr class="total">
|
|
|
|
<td><b>{%trans 'Votes cast' %}</b></td>
|
|
|
|
{% for p in polls %}
|
2011-09-08 12:30:34 +02:00
|
|
|
{% if p.published %}
|
2012-04-21 21:38:59 +02:00
|
|
|
<td style="white-space:nowrap;"><img src="{% static 'images/icons/voting-total.png' %}" title="{% trans 'Votes cast' %}"> <b>{{ p.print_votescast }}</b></td>
|
2011-09-08 12:30:34 +02:00
|
|
|
{% endif %}
|
2011-09-07 23:25:59 +02:00
|
|
|
{% endfor %}
|
|
|
|
</tr>
|
2011-07-31 10:46:29 +02:00
|
|
|
</table>
|
|
|
|
{% endif %}
|
2011-09-09 22:34:55 +02:00
|
|
|
|
2011-07-31 10:46:29 +02:00
|
|
|
<br>
|
|
|
|
{% endblock %}
|