From 039bd4121c3c613cbce5e3d9e1ecfab88c73ce80 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Sat, 21 Apr 2012 22:27:11 +0200 Subject: [PATCH] Some assignment poll template fixes. --- openslides/assignment/templates/assignment/poll_view.html | 8 ++++---- openslides/assignment/views.py | 8 +++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/openslides/assignment/templates/assignment/poll_view.html b/openslides/assignment/templates/assignment/poll_view.html index 1286525f2..c63118426 100644 --- a/openslides/assignment/templates/assignment/poll_view.html +++ b/openslides/assignment/templates/assignment/poll_view.html @@ -2,14 +2,14 @@ {% load i18n %} -{% block title %}{{ block.super }} - {%trans "Poll" %} "{{ poll }}"{% endblock %} +{% block title %}{{ block.super }} - {%trans "Election" %} "{{ assignment }}"{% endblock %} {% block content %} -

{{ poll }}

-

{{ ballotnumber }}. {%trans "ballot" %}: {{options.count}} +

{%trans "Election" %}: {{ assignment }}

+

{{ ballotnumber }}. {%trans "ballot" %}: {{assignment.poll.get_options}} {% blocktrans count counter=options|length %}candidate{% plural %}candidates{% endblocktrans %}

-

{% trans "Short description" %}: {{ poll.description }}

+

{% trans "Short description" %}: {{ assignment.polldescription }}

-1 := {% trans 'majority' %}, -2 := {% trans 'undocumented' %}
{% csrf_token %} diff --git a/openslides/assignment/views.py b/openslides/assignment/views.py index 68e54233c..4a441998f 100644 --- a/openslides/assignment/views.py +++ b/openslides/assignment/views.py @@ -197,7 +197,7 @@ def delother(request, assignment_id, profile_id): return redirect(reverse('assignment_view', args=assignment_id)) -@permission_required('assignment.can_manage_application') +@permission_required('assignment.can_manage_assignment') def set_active(request, assignment_id): assignment = Assignment.objects.get(pk=assignment_id) assignment.set_active() @@ -218,7 +218,9 @@ class ViewPoll(PollFormView): def get_context_data(self, **kwargs): context = super(ViewPoll, self).get_context_data(**kwargs) self.assignment = self.poll.get_assignment() - context['application'] = self.assignment + context['assignment'] = self.assignment + context['poll'] = self.poll + #context['ballotnumber'] = self.poll.get_ballot() return context def get_success_url(self): @@ -294,7 +296,7 @@ class AssignmentPDF(PDFView): assignment_id = self.kwargs['assignment_id'] except KeyError: assignment_id = None - if assignment_id is None: #print all applications + if assignment_id is None: #print all assignments title = config["assignment_pdf_title"] story.append(Paragraph(title, stylesheet['Heading1'])) preamble = config["assignment_pdf_preamble"]