Some assignment poll template fixes.
This commit is contained in:
parent
99bfd7257b
commit
039bd4121c
@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% block title %}{{ block.super }} - {%trans "Poll" %} "{{ poll }}"{% endblock %}
|
{% block title %}{{ block.super }} - {%trans "Election" %} "{{ assignment }}"{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>{{ poll }}</h1>
|
<h1>{%trans "Election" %}: {{ assignment }}</h1>
|
||||||
<p>{{ ballotnumber }}. {%trans "ballot" %}: {{options.count}}
|
<p>{{ ballotnumber }}. {%trans "ballot" %}: {{assignment.poll.get_options}}
|
||||||
{% blocktrans count counter=options|length %}candidate{% plural %}candidates{% endblocktrans %}
|
{% blocktrans count counter=options|length %}candidate{% plural %}candidates{% endblocktrans %}
|
||||||
</p>
|
</p>
|
||||||
<p><b>{% trans "Short description" %}:</b> {{ poll.description }}</p>
|
<p><b>{% trans "Short description" %}:</b> {{ assignment.polldescription }}</p>
|
||||||
<i>-1 := {% trans 'majority' %}, -2 := {% trans 'undocumented' %}</i>
|
<i>-1 := {% trans 'majority' %}, -2 := {% trans 'undocumented' %}</i>
|
||||||
<form action="" method="post" class="small-form">{% csrf_token %}
|
<form action="" method="post" class="small-form">{% csrf_token %}
|
||||||
<table style="width:auto">
|
<table style="width:auto">
|
||||||
|
@ -197,7 +197,7 @@ def delother(request, assignment_id, profile_id):
|
|||||||
return redirect(reverse('assignment_view', args=assignment_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):
|
def set_active(request, assignment_id):
|
||||||
assignment = Assignment.objects.get(pk=assignment_id)
|
assignment = Assignment.objects.get(pk=assignment_id)
|
||||||
assignment.set_active()
|
assignment.set_active()
|
||||||
@ -218,7 +218,9 @@ class ViewPoll(PollFormView):
|
|||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super(ViewPoll, self).get_context_data(**kwargs)
|
context = super(ViewPoll, self).get_context_data(**kwargs)
|
||||||
self.assignment = self.poll.get_assignment()
|
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
|
return context
|
||||||
|
|
||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
@ -294,7 +296,7 @@ class AssignmentPDF(PDFView):
|
|||||||
assignment_id = self.kwargs['assignment_id']
|
assignment_id = self.kwargs['assignment_id']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
assignment_id = None
|
assignment_id = None
|
||||||
if assignment_id is None: #print all applications
|
if assignment_id is None: #print all assignments
|
||||||
title = config["assignment_pdf_title"]
|
title = config["assignment_pdf_title"]
|
||||||
story.append(Paragraph(title, stylesheet['Heading1']))
|
story.append(Paragraph(title, stylesheet['Heading1']))
|
||||||
preamble = config["assignment_pdf_preamble"]
|
preamble = config["assignment_pdf_preamble"]
|
||||||
|
Loading…
Reference in New Issue
Block a user