#266 fix assignment view on the projector
This commit is contained in:
parent
ef5b9e3281
commit
ff44439351
|
@ -97,7 +97,7 @@
|
||||||
<p><br></p>
|
<p><br></p>
|
||||||
<h3>{% trans "Election results" %}</h3>
|
<h3>{% trans "Election results" %}</h3>
|
||||||
|
|
||||||
{% if polls %}
|
{% if polls.exists %}
|
||||||
<table id="election_table" style="width: auto;">
|
<table id="election_table" style="width: auto;">
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -160,8 +160,8 @@
|
||||||
</td>
|
</td>
|
||||||
{% for poll_dict in poll_list %}
|
{% for poll_dict in poll_list %}
|
||||||
{% if perms.assignment.can_manage_assignment or poll_dict.published %}
|
{% if perms.assignment.can_manage_assignment or poll_dict.published %}
|
||||||
<td style="white-space:nowrap;">
|
{% with vote=poll_dict.votes %}
|
||||||
{% with vote=poll_dict.votes %}
|
<td style="white-space:nowrap;">
|
||||||
{% if 'Yes' in vote and 'No' in vote and 'Abstain' in vote %}
|
{% 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-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-no.png' %}" title="{% trans 'No' %}"> {{ vote.No }}<br>
|
||||||
|
@ -173,8 +173,8 @@
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endwith %}
|
</td>
|
||||||
</td>
|
{% endwith %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if assignment.profile.exists and perms.assignment.can_manage_assignment and assignment.status == "vot" %}
|
{% if assignment.profile.exists and perms.assignment.can_manage_assignment and assignment.status == "vot" %}
|
||||||
|
|
|
@ -5,10 +5,12 @@
|
||||||
{% load staticfiles %}
|
{% load staticfiles %}
|
||||||
|
|
||||||
{% block title %}{{ block.super }} - {{ assignment }}{% endblock %}
|
{% block title %}{{ block.super }} - {{ assignment }}{% endblock %}
|
||||||
|
|
||||||
{% block header %}
|
{% block header %}
|
||||||
<link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/assignment.css' %}" />
|
<link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/assignment.css' %}" />
|
||||||
<script type="text/javascript" src="{% static 'javascript/assignment.js' %}"></script>
|
<script type="text/javascript" src="{% static 'javascript/assignment.js' %}"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if assignment.status != "fin" %}
|
{% if assignment.status != "fin" %}
|
||||||
<div id="sidebar">
|
<div id="sidebar">
|
||||||
|
@ -49,7 +51,7 @@
|
||||||
{% if polls.exists %}
|
{% if polls.exists %}
|
||||||
<h3>{% trans "Election results" %}</h3>
|
<h3>{% trans "Election results" %}</h3>
|
||||||
<table>
|
<table>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans "Candidates" %}</th>
|
<th>{% trans "Candidates" %}</th>
|
||||||
{% for poll in assignment.poll_set.all %}
|
{% for poll in assignment.poll_set.all %}
|
||||||
|
@ -58,8 +60,8 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{% for candidate, votes in vote_results.items %}
|
{% for candidate, poll_list in vote_results.items %}
|
||||||
<tr class="{% cycle 'odd' '' %}">
|
<tr class="{% cycle 'odd' '' %}">
|
||||||
<td class="candidate{% if candidate.1 %} elected{% endif %}">
|
<td class="candidate{% if candidate.1 %} elected{% endif %}">
|
||||||
{% if candidate in assignment.elected.all %}
|
{% if candidate in assignment.elected.all %}
|
||||||
|
@ -69,25 +71,28 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ candidate }}
|
{{ candidate }}
|
||||||
</td>
|
</td>
|
||||||
{% for vote in votes %}
|
{% for poll_dict in poll_list %}
|
||||||
{# Hier stimmt es noch nicht. Es muss rein, dass nur veröffentlichte Wahlergebnisse angezeigt werden sollen #}
|
{% if poll_dict.published %}
|
||||||
<td style="white-space:nowrap;"{% if candidate in assignment.elected.all %} class="elected"{% endif %}>
|
{% with vote=poll_dict.votes %}
|
||||||
{% if 'Yes' in vote and 'No' in vote and 'Abstain' in vote %}
|
<td style="white-space:nowrap;"{% if candidate in assignment.elected.all %} class="elected"{% endif %}>
|
||||||
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Yes' %}"> {{ vote.Yes }}<br>
|
{% if 'Yes' in vote and 'No' in vote and 'Abstain' in vote %}
|
||||||
<img src="{% static 'images/icons/voting-no.png' %}" title="{% trans 'No' %}"> {{ vote.No }}<br>
|
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Yes' %}"> {{ vote.Yes }}<br>
|
||||||
<img src="{% static 'images/icons/voting-abstention.png' %}" title="{% trans 'Abstention' %}"> {{ vote.Abstain }}<br>
|
<img src="{% static 'images/icons/voting-no.png' %}" title="{% trans 'No' %}"> {{ vote.No }}<br>
|
||||||
{% elif 'Votes' in vote %}
|
<img src="{% static 'images/icons/voting-abstention.png' %}" title="{% trans 'Abstention' %}"> {{ vote.Abstain }}<br>
|
||||||
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Yes' %}"> {{ vote.Votes }}
|
{% elif 'Votes' in vote %}
|
||||||
{% elif vote == None %}
|
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Yes' %}"> {{ vote.Votes }}
|
||||||
{% trans 'was not a <br> candidate'%}
|
{% elif vote == None %}
|
||||||
{% else %}
|
{% trans 'was not a <br> candidate'%}
|
||||||
|
{% else %}
|
||||||
{% endif %}
|
|
||||||
</td>
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
{% endwith %}
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>{%trans 'Invalid votes' %}</td>
|
<td>{%trans 'Invalid votes' %}</td>
|
||||||
{% for poll in polls %}
|
{% for poll in polls %}
|
||||||
|
@ -96,7 +101,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr class="total">
|
<tr class="total">
|
||||||
<td><b>{%trans 'Votes cast' %}</b></td>
|
<td><b>{%trans 'Votes cast' %}</b></td>
|
||||||
{% for poll in polls %}
|
{% for poll in polls %}
|
||||||
|
|
Loading…
Reference in New Issue