diff --git a/openslides/assignment/models.py b/openslides/assignment/models.py index d9828e273..ae024e537 100644 --- a/openslides/assignment/models.py +++ b/openslides/assignment/models.py @@ -128,16 +128,19 @@ class Assignment(models.Model, SlideMixin): continue vote_results_dict[candidate] = [] for poll in polls: + votes = { + 'votes': {}, + 'published': poll.published, + } try: - polloption = poll.get_options().get(candidate=candidate) - # candidate is related to this poll - votes = {} - for vote in polloption.get_votes(): - votes[vote.value] = vote.get_weight() - vote_results_dict[candidate].append(votes) + # candidate related to this poll + poll_option = poll.get_options().get(candidate=candidate) + for vote in poll_option.get_votes(): + votes['votes'][vote.value] = vote.get_weight() except AssignmentOption.DoesNotExist: # candidate not in related to this poll - vote_results_dict[candidate].append(None) + votes['votes'] = None + vote_results_dict[candidate].append(votes) return vote_results_dict diff --git a/openslides/assignment/templates/assignment/view.html b/openslides/assignment/templates/assignment/view.html index 1647a9c69..73f7fc98d 100644 --- a/openslides/assignment/templates/assignment/view.html +++ b/openslides/assignment/templates/assignment/view.html @@ -99,7 +99,7 @@ {% if polls %}
{% with ballotnumber=polls.count %} @@ -108,7 +108,7 @@ {% endwith %} | |
---|---|
{% trans "Candidates" %} | {% for poll in polls %} @@ -138,15 +138,18 @@ {% endif %}|
{% if candidate in assignment.elected.all %} {% if perms.assignment.can_manage_assignment %} + {# What does this line do #} {% else %} - + + + {% endif %} {% else %} {% if perms.assignment.can_manage_assignment %} @@ -155,21 +158,22 @@ {% endif %} {{ candidate }} | - {% for vote in votes %} - {% if perms.assignment.can_manage_assignment %} - {# Hier stimmt es noch nicht. Es muss rein, dass veröffentlichte Wahlergebnisse für jedermann sichtbar sind #} + {% for poll_dict in poll_list %} + {% if perms.assignment.can_manage_assignment or poll_dict.published %}
- {% if 'Yes' in vote and 'No' in vote and 'Abstain' in vote %}
- {{ vote.Yes }} - {{ vote.No }} - {{ vote.Abstain }} - {% elif 'Votes' in vote %} - {{ vote.Votes }} - {% elif vote == None %} - {% trans 'was not a candidate'%} - {% else %} - - {% endif %} + {% with vote=poll_dict.votes %} + {% if 'Yes' in vote and 'No' in vote and 'Abstain' in vote %} + {{ vote.Yes }} + {{ vote.No }} + {{ vote.Abstain }} + {% elif 'Votes' in vote %} + {{ vote.Votes }} + {% elif vote == None %} + {% trans 'was not a candidate'%} + {% else %} + + {% endif %} + {% endwith %} |
{% endif %}
{% endfor %}
@@ -178,7 +182,7 @@
{% endif %}
{%trans 'Invalid votes' %} | {% for poll in polls %} @@ -190,7 +194,7 @@{% endif %} |
{%trans 'Votes cast' %} | {% for poll in polls %}