diff --git a/openslides/agenda/models.py b/openslides/agenda/models.py index b64d64553..f290714e5 100644 --- a/openslides/agenda/models.py +++ b/openslides/agenda/models.py @@ -31,6 +31,8 @@ from agenda.api import is_summary class Item(MPTTModel, Slide): """ An Agenda Item + + MPTT-model. See http://django-mptt.github.com/django-mptt/ """ prefix = 'item' diff --git a/openslides/agenda/templates/agenda/overview.html b/openslides/agenda/templates/agenda/overview.html index 6701157c9..1f4cf2dc9 100644 --- a/openslides/agenda/templates/agenda/overview.html +++ b/openslides/agenda/templates/agenda/overview.html @@ -10,28 +10,28 @@ {% if perms.agenda.can_manage_agenda %} - - - - - + + + + + - {% endif %} {% endblock %} @@ -41,44 +41,60 @@ {% if items %}
{% csrf_token %} {% if perms.agenda.can_manage_agenda %} - + -
- - - {% trans "Countdown" %} ({{countdown_time}}{% trans "sec" %}){% if countdown_visible == "True" %}: - - - - {% endif %} -

- - {% trans "Adjust projector view" %}: - - - - - -
+
+ + + {% trans "Countdown" %} ({{countdown_time}}{% trans "sec" %}) + {% if countdown_visible == "True" %}: + + + + + + + + + + {% endif %} +

+ + {% trans "Adjust projector view" %}: + + + + + + + + + + + + + + + +
{% endif %} {% if perms.agenda.can_manage_agenda %} - + {% else %} - + {% endif %} {% if perms.agenda.can_manage_agenda %} - + {% endif %} @@ -91,10 +107,13 @@ {% else %} {% endif %} - - + @@ -106,7 +125,7 @@ {% if perms.agenda.can_manage_agenda %} {% else %} @@ -130,19 +149,19 @@ {% if perms.agenda.can_manage_agenda %} @@ -157,7 +176,6 @@ {% endfor %} -
{% else %} {% trans "No items available." %} diff --git a/openslides/agenda/templates/projector/AgendaText.html b/openslides/agenda/templates/projector/AgendaText.html index 3b7767ffe..32d3f57b3 100644 --- a/openslides/agenda/templates/projector/AgendaText.html +++ b/openslides/agenda/templates/projector/AgendaText.html @@ -1,5 +1,9 @@ {% extends "base-projector.html" %} + +{% load i18n %} + {% block title %}{{ block.super }} - {{ item.title }}{% endblock %} + {% block content %} {% if item.text %}

{{ item.title }}

diff --git a/openslides/agenda/urls.py b/openslides/agenda/urls.py index 1b9bf4fe9..529ce86a0 100644 --- a/openslides/agenda/urls.py +++ b/openslides/agenda/urls.py @@ -11,7 +11,7 @@ """ from django.conf.urls.defaults import * -from agenda.views import Overview, View, SetActive, SetClosed, ItemUpdate, ItemCreate, ItemDelete +from agenda.views import Overview, View, SetActive, SetClosed, ItemUpdate, ItemCreate, ItemDelete, ItemPDF urlpatterns = patterns('agenda.views', url(r'^$', @@ -64,7 +64,7 @@ urlpatterns = patterns('agenda.views', ), url(r'^print/$', - 'print_agenda', + ItemPDF.as_view(), name='print_agenda', ), ) diff --git a/openslides/agenda/views.py b/openslides/agenda/views.py index 68f37cac2..c3b9dc1ab 100644 --- a/openslides/agenda/views.py +++ b/openslides/agenda/views.py @@ -9,14 +9,16 @@ :copyright: 2011 by the OpenSlides team, see AUTHORS. :license: GNU GPL, see LICENSE for more details. """ +from reportlab.platypus import Paragraph + from django.core.urlresolvers import reverse from django.contrib import messages from django.utils.translation import ugettext as _ from django.core.context_processors import csrf from django.views.generic.detail import SingleObjectMixin -from utils.pdf import print_agenda -from utils.views import TemplateView, RedirectView, UpdateView, CreateView, DeleteView +from utils.pdf import stylesheet +from utils.views import TemplateView, RedirectView, UpdateView, CreateView, DeleteView, PDFView from system import config @@ -181,3 +183,17 @@ class ItemDelete(DeleteView): self.gen_confirm_form(request, _('Do you really want to delete %s?') % name, object.get_absolute_url('delete'), False) else: self.gen_confirm_form(request, _('Do you really want to delete %s?') % name, object.get_absolute_url('delete'), True) + + +class ItemPDF(PDFView): + permission_required = 'agenda.can_see_agenda' + filename = _('Agenda') + + def append_to_pdf(self, story): + for item in Item.objects.all(): + ancestors = item.get_ancestors() + if ancestors: + space = "      " * ancestors.count() + story.append(Paragraph("%s%s" % (space, item.title), stylesheet['Subitem'])) + else: + story.append(Paragraph(item.title, stylesheet['Item'])) diff --git a/openslides/projector/templates/base-projector.html b/openslides/projector/templates/base-projector.html index 20aa533e2..f239d95b6 100644 --- a/openslides/projector/templates/base-projector.html +++ b/openslides/projector/templates/base-projector.html @@ -1,38 +1,39 @@ +{% load tags %} + -{% load tags %} - - - - - - {% block title %} {% get_config 'event_name' %} {% endblock %} - {% block header %} - {% endblock %} - - - -
+ + + + + + {% block title %} {% get_config 'event_name' %} {% endblock %} + {% block header %} + {% endblock %} + + + +
- + -
- {% now "H:i" %} -
+
+ {% now "H:i" %} +
-
0:00
+
0:00
-
- {% block content %} - {% endblock %} -
- +
+ {% block content %} + {% endblock %} +
+ diff --git a/openslides/projector/urls.py b/openslides/projector/urls.py index ac0f10e6c..4ee2cf939 100644 --- a/openslides/projector/urls.py +++ b/openslides/projector/urls.py @@ -16,33 +16,33 @@ urlpatterns = patterns('projector.views', url(r'^$', 'active_slide', name='projector_show'), - url(r'^bigger$', 'projector_edit', {'direction': 'bigger'}, + url(r'^bigger/$', 'projector_edit', {'direction': 'bigger'}, name='projector_bigger'), - url(r'^smaller$', 'projector_edit', {'direction': 'smaller'}, + url(r'^smaller/$', 'projector_edit', {'direction': 'smaller'}, name='projector_smaller'), - url(r'^up$', 'projector_edit', {'direction': 'up'}, + url(r'^up/$', 'projector_edit', {'direction': 'up'}, name='projector_up'), - url(r'^projector/down$', 'projector_edit', {'direction': 'down'}, + url(r'^down/$', 'projector_edit', {'direction': 'down'}, name='projector_down'), - url(r'^projector/clean$', 'projector_edit', {'direction': 'clean'}, + url(r'^clean/$', 'projector_edit', {'direction': 'clean'}, name='projector_clean'), - url(r'^projector/countdown/show$', 'projector_countdown', {'command': 'show'}, + url(r'^countdown/show/$', 'projector_countdown', {'command': 'show'}, name='countdown_open'), - url(r'^projector/countdown/hide$', 'projector_countdown', {'command': 'hide'}, + url(r'^countdown/hide/$', 'projector_countdown', {'command': 'hide'}, name='countdown_close'), - url(r'^projector/countdown/reset/(?P