Merge pull request #19 from emanuelschuetze/master

Fixes for application and assignment ballot paper
This commit is contained in:
Oskar Hahn 2012-09-18 14:08:12 -07:00
commit 685b138d8d
5 changed files with 290 additions and 266 deletions

View File

@ -833,9 +833,9 @@ class ApplicationPollPDF(PDFView):
# set number of ballot papers
if ballot_papers_selection == "NUMBER_OF_DELEGATES":
number = User.objects.filter(profile__type__iexact="delegate").count()
number = User.objects.filter(type__iexact="delegate").count()
elif ballot_papers_selection == "NUMBER_OF_ALL_PARTICIPANTS":
number = int(Profile.objects.count())
number = int(User.objects.count())
else: # ballot_papers_selection == "CUSTOM_NUMBER"
number = int(ballot_papers_number)
number = max(1, number)

View File

@ -63,8 +63,8 @@
{% for candidate, poll_list in vote_results.items %}
<tr class="{% cycle 'odd' '' %}">
<td class="candidate{% if candidate in assignment.elected.all %} elected{% endif %}">
{% if candidate in assignment.elected.all %}
<td class="candidate{% if candidate in assignment.elected %} elected{% endif %}">
{% if candidate in assignment.elected %}
<a class="elected">
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Candidate is elected' %}">
</a>
@ -72,8 +72,8 @@
{{ candidate }}
</td>
{% for vote in poll_list %}
<td style="white-space:nowrap;"{% if candidate in assignment.elected.all %} class="elected"{% endif %}>
{% if not assignment_publish_winner_results_only or candidate in assignment.elected.all %}
<td style="white-space:nowrap;"{% if candidate in assignment.elected %} class="elected"{% endif %}>
{% if not assignment_publish_winner_results_only or candidate in assignment.elected %}
{% 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>

View File

@ -554,9 +554,9 @@ class AssignmentPollPDF(PDFView):
# set number of ballot papers
if ballot_papers_selection == "NUMBER_OF_DELEGATES":
number = User.objects.filter(profile__type__iexact="delegate").count()
number = User.objects.filter(type__iexact="delegate").count()
elif ballot_papers_selection == "NUMBER_OF_ALL_PARTICIPANTS":
number = int(Profile.objects.count())
number = int(User.objects.count())
else: # ballot_papers_selection == "CUSTOM_NUMBER"
number = int(ballot_papers_number)
number = max(1, number)
@ -567,8 +567,8 @@ class AssignmentPollPDF(PDFView):
candidate = option.candidate
cell.append(Paragraph(candidate.user.get_full_name(),
stylesheet['Ballot_option_name']))
if candidate.name_surfix:
cell.append(Paragraph("(%s)" % candidate.name_surfix,
if candidate.name_suffix:
cell.append(Paragraph("(%s)" % candidate.name_suffix,
stylesheet['Ballot_option_group']))
else:
cell.append(Paragraph("&nbsp;",

File diff suppressed because it is too large Load Diff