OpenSlides/openslides/application/templates/projector/ItemAssignment.html

106 lines
4.0 KiB
HTML
Raw Normal View History

2011-07-31 10:46:29 +02:00
{% extends "beamer.html" %}
{% block title %}{{ block.super }} - #{{ item.title }}{% 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 %}
2011-07-31 10:46:29 +02:00
{% block content %}
<h1>{% trans "Election" %}: {{ item.assignment }}</h1>
{% if item.assignment.status != "fin" %}
2011-07-31 10:46:29 +02:00
<div id="sidebar">
<div class="box">
<p><b>{% trans "Status" %}:</b><br>
{% trans item.assignment.get_status_display %}</p>
{% if item.assignment.status == "sea" or item.assignment.status == "vot" %}
<p><b>{% trans "Number of available posts" %}:</b><br>
{{ item.assignment.posts }}</p>
{% endif %}
2011-07-31 10:46:29 +02:00
</div>
</div>
2011-09-21 21:14:19 +02:00
{% endif %}
2011-07-31 10:46:29 +02:00
{% if not item.assignment.profile.exists %}
2011-07-31 10:46:29 +02:00
<p>
<div class="text">{{ item.assignment.description|linebreaks }}</div>
2011-07-31 10:46:29 +02:00
</p>
2011-09-21 21:14:19 +02:00
{% endif %}
{% if item.assignment.profile.exists and item.assignment.status != "fin" %}
2011-07-31 10:46:29 +02:00
<h3>{% trans "Candidates" %}</h3>
<ol>
{% for profile in item.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 %}
{% with polls|first as firstpoll %}
{% if polls.count > 0 and firstpoll.published %}
2011-07-31 10:46:29 +02:00
<h3>{% trans "Election results" %}</h3>
<table>
<tr>
<th>{% trans "Candidates" %}</th>
{% for poll in item.assignment.poll_set.all %}
{% 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' '' %}">
{% with vote|first as candidate %}
<td class="candidate {% if candidate.1 %}elected{% endif %}">
{% if candidate.1 %}
<a class="elected"><img src="/static/images/icons/voting-yes.png" title="{% trans 'Candidate is elected' %}"></a>
{% endif %}
{{ candidate.0 }}
</td>
{% for v in vote|last %}
<td style="white-space:nowrap;" {% if candidate.1 %}class="elected"{% endif %}>{% if v %}
{% if v|length == 3 %}
<img src="/static/images/icons/voting-yes.png" title="{% trans 'Yes' %}"> {% if v.0 %}{{ v.0 }}{% else %}&empty;{% endif %}<br>
<img src="/static/images/icons/voting-no.png" title="{% trans 'No' %}"> {% if v.1 %}{{ v.1 }}{% else %}&empty;{% endif %}<br>
<img src="/static/images/icons/voting-abstention.png" title="{% trans 'Abstention' %}"> {% if v.2 %}{{ v.2 }}{% else %}&empty;{% endif %}<br>
{% else %}
{% if v != "-" %}<img src="/static/images/icons/voting-yes.png" title="{% trans 'Yes' %}">{% endif %}
2011-07-31 10:46:29 +02:00
{{ v }}
{% endif %}
{% endif %}
2011-07-31 10:46:29 +02:00
</td>
{% endfor %}
{% endwith %}
</tr>
2011-07-31 10:46:29 +02:00
{% empty %}
<tr>
<td {% if item.assignment.profile.exist %}colspan="2"{% endif %}><i>{% trans "No ballots available." %}</i></td>
2011-07-31 10:46:29 +02:00
</tr>
{% endfor %}
<tr>
<td>{%trans 'Invalid votes' %}</td>
{% for p in polls %}
{% if p.published %}
<td style="white-space:nowrap;"><img src="/static/images/icons/voting-invalid.png" title="{% trans 'Invalid' %}"> {{ p.votesinvalidf }}</td>
{% endif %}
{% endfor %}
</tr>
<tr class="total">
<td><b>{%trans 'Votes cast' %}</b></td>
{% for p in polls %}
{% if p.published %}
<td style="white-space:nowrap;"><img src="/static/images/icons/voting-total.png" title="{% trans 'Votes cast' %}"> <b>{{ p.votescastf }}</b></td>
{% endif %}
{% endfor %}
</tr>
2011-07-31 10:46:29 +02:00
</table>
{% endif %}
{% endwith %}
2011-07-31 10:46:29 +02:00
<br>
{% endblock %}