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['title'] = self.name
|
||||||
data['polls'] = self.poll_set.all()
|
data['polls'] = self.poll_set.all()
|
||||||
data['vote_results'] = self.vote_results
|
data['vote_results'] = self.vote_results
|
||||||
|
data['assignment_publish_winner_results_only'] = config['assignment_publish_winner_results_only']
|
||||||
data['template'] = 'projector/Assignment.html'
|
data['template'] = 'projector/Assignment.html'
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
@ -75,14 +75,18 @@
|
|||||||
{% if poll_dict.published %}
|
{% if poll_dict.published %}
|
||||||
{% with vote=poll_dict.votes %}
|
{% with vote=poll_dict.votes %}
|
||||||
<td style="white-space:nowrap;"{% if candidate in assignment.elected.all %} class="elected"{% endif %}>
|
<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 %}
|
{% if not assignment_publish_winner_results_only or candidate in assignment.elected.all %}
|
||||||
<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 %}
|
||||||
|
{% trans 'was not a <br> candidate'%}
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user