#266 fix assignment view on the projector

This commit is contained in:
Oskar Hahn 2012-07-04 16:14:19 +02:00
parent ef5b9e3281
commit ff44439351
2 changed files with 30 additions and 25 deletions

View File

@ -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 %}
&nbsp; &nbsp;
{% 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" %}

View File

@ -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">
@ -59,7 +61,7 @@
{% 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,21 +71,24 @@
{% 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'%}
&nbsp; {% else %}
{% endif %} &nbsp;
</td> {% endif %}
</td>
{% endwith %}
{% endif %}
{% endfor %} {% endfor %}
</tr> </tr>
{% endfor %} {% endfor %}