Fix #280
This commit is contained in:
parent
812d7a3c83
commit
c1e9540699
@ -161,6 +161,7 @@ class Assignment(models.Model, SlideMixin):
|
||||
data['title'] = self.name
|
||||
data['polls'] = self.poll_set.all()
|
||||
data['vote_results'] = self.vote_results
|
||||
data['assignment_publish_winner_results_only'] = config['assignment_publish_winner_results_only']
|
||||
data['template'] = 'projector/Assignment.html'
|
||||
return data
|
||||
|
||||
|
@ -75,14 +75,18 @@
|
||||
{% if poll_dict.published %}
|
||||
{% with vote=poll_dict.votes %}
|
||||
<td style="white-space:nowrap;"{% if candidate in assignment.elected.all %} class="elected"{% endif %}>
|
||||
{% 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'%}
|
||||
{% if not assignment_publish_winner_results_only or candidate in assignment.elected.all %}
|
||||
{% 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 %}
|
||||
|
Loading…
Reference in New Issue
Block a user