Removed reduced agenda pdf. Not useable.

This commit is contained in:
Emanuel Schuetze 2011-09-03 01:24:50 +02:00
parent 2278ddca54
commit ed40977403
3 changed files with 5 additions and 25 deletions

View File

@ -71,8 +71,7 @@
{% if perms.agenda.can_manage_agenda %} {% if perms.agenda.can_manage_agenda %}
<td></td> <td></td>
{% endif %} {% endif %}
<td style="width: 1px;white-space: nowrap"><a href="{% url print_agenda %}" title="{%trans 'Print reduced agenda (only first parent items)' %}"><img src="/static/images/icons/application-pdf.png"></a> <td style="width: 1px;white-space: nowrap"><a href="{% url print_agenda %}" title="{%trans 'Print agenda' %}"><img src="/static/images/icons/application-pdf.png"></a></td>
<a href="{% url print_agenda_full printAllItems=1 %}" title="{%trans 'Print full agenda (all items)' %}"><img src="/static/images/icons/pdf-annotations.png"></a></td>
</tr> </tr>
{% for item in items %} {% for item in items %}
{% if not item.hidden or perms.agenda.can_manage_agenda %} {% if not item.hidden or perms.agenda.can_manage_agenda %}

View File

@ -54,9 +54,6 @@ urlpatterns = patterns('agenda.views',
url(r'^item/(?P<item_id>\d+)/del/$', 'delete', url(r'^item/(?P<item_id>\d+)/del/$', 'delete',
name='item_delete'), name='item_delete'),
url(r'^item/print/(?P<printAllItems>\d+)/$', 'print_agenda',
name='print_agenda_full'),
url(r'^item/print/$', 'print_agenda', url(r'^item/print/$', 'print_agenda',
name='print_agenda'), name='print_agenda'),
) )

View File

@ -182,11 +182,6 @@ def firstPage(canvas, doc):
canvas.setFillGray(0) canvas.setFillGray(0)
#canvas.drawCentredString(PAGE_WIDTH/2.0, PAGE_HEIGHT-108, doc.title) #canvas.drawCentredString(PAGE_WIDTH/2.0, PAGE_HEIGHT-108, doc.title)
canvas.drawString(2.75*cm, PAGE_HEIGHT-108, doc.title) canvas.drawString(2.75*cm, PAGE_HEIGHT-108, doc.title)
if doc.subtitle:
canvas.setFont('Ubuntu',10)
canvas.setFillGray(0.4)
#canvas.drawCentredString(PAGE_WIDTH/2.0, PAGE_HEIGHT-125, doc.subtitle)
canvas.drawString(2.75*cm, PAGE_HEIGHT-125, doc.subtitle)
# footer (with page number) # footer (with page number)
canvas.setFont('Ubuntu',8) canvas.setFont('Ubuntu',8)
canvas.setFillGray(0.4) canvas.setFillGray(0.4)
@ -201,7 +196,7 @@ def laterPages(canvas, doc):
canvas.drawString(10*cm, 1*cm, _("Page")+" %s" % doc.page) canvas.drawString(10*cm, 1*cm, _("Page")+" %s" % doc.page)
canvas.restoreState() canvas.restoreState()
def print_agenda(request, printAllItems=None): def print_agenda(request):
response = HttpResponse(mimetype='application/pdf') response = HttpResponse(mimetype='application/pdf')
filename = u'filename=%s.pdf;' % _("Agenda") filename = u'filename=%s.pdf;' % _("Agenda")
response['Content-Disposition'] = filename.encode('utf-8') response['Content-Disposition'] = filename.encode('utf-8')
@ -209,25 +204,16 @@ def print_agenda(request, printAllItems=None):
story = [Spacer(1,3*cm)] story = [Spacer(1,3*cm)]
doc.title = _("Agenda") doc.title = _("Agenda")
if printAllItems:
doc.subtitle = "("+_("full")+")"
else:
doc.subtitle = "("+_("abridged")+")"
# print item list # print item list
items = children_list(Item.objects.filter(parent=None).order_by('weight')) items = children_list(Item.objects.filter(parent=None).order_by('weight'))
for item in items: for item in items:
if item.hidden is False: if item.hidden is False:
# print all items # print all items
if printAllItems:
if item.parents: if item.parents:
story.append(Paragraph(item.title, stylesheet['Subitem'])) story.append(Paragraph(item.title, stylesheet['Subitem']))
else: else:
story.append(Paragraph(item.title, stylesheet['Item'])) story.append(Paragraph(item.title, stylesheet['Item']))
# print items without parents only
else:
if item.parent is None:
story.append(Paragraph(item.title, stylesheet['Subitem']))
doc.build(story, onFirstPage=firstPage, onLaterPages=laterPages) doc.build(story, onFirstPage=firstPage, onLaterPages=laterPages)
return response return response
@ -240,7 +226,6 @@ def print_userlist(request):
story = [Spacer(1,2*cm)] story = [Spacer(1,2*cm)]
doc.title = _("List of Participants") doc.title = _("List of Participants")
doc.subtitle = ""
# Table # Table
data= [['#', _('Last Name'), _('First Name'), _('Group'), _('Type'), _('Committee')]] data= [['#', _('Last Name'), _('First Name'), _('Group'), _('Type'), _('Committee')]]
sort = 'last_name' sort = 'last_name'
@ -303,7 +288,6 @@ def print_application(request, application_id=None):
response['Content-Disposition'] = filename.encode('utf-8') response['Content-Disposition'] = filename.encode('utf-8')
doc = SimpleDocTemplate(response) doc = SimpleDocTemplate(response)
doc.title = None doc.title = None
doc.subtitle = None
story = [Spacer(1,2*cm)] story = [Spacer(1,2*cm)]
if application_id is None: #print all applications if application_id is None: #print all applications