From fa5918e951579408ba563363750e033d6b72ea3d Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Wed, 5 Oct 2011 21:18:28 +0200 Subject: [PATCH] New config option to set title and preamble text for application and assignment pdf. --- openslides/system/forms.py | 9 ++++++++- openslides/system/models.py | 5 ++++- openslides/system/templates/system/general.html | 6 +++++- openslides/system/views.py | 16 ++++++++++++++-- openslides/utils/pdf.py | 10 ++++++++-- 5 files changed, 39 insertions(+), 7 deletions(-) diff --git a/openslides/system/forms.py b/openslides/system/forms.py index def96b1cd..d390140d9 100644 --- a/openslides/system/forms.py +++ b/openslides/system/forms.py @@ -22,7 +22,6 @@ class SystemConfigForm(Form): system_url = CharField(widget=TextInput(), required=False, label=_("System URL")) system_welcometext = CharField(widget=Textarea(), required=False, label=_("Welcome text (for password PDF)")) - class EventConfigForm(Form): error_css_class = 'error' required_css_class = 'required' @@ -39,6 +38,14 @@ class ApplicationConfigForm(Form): application_min_supporters = IntegerField(widget=TextInput(attrs={'class':'small-input'}),label=_("Number of (minimum) required supporters for a application"),initial=4, min_value=0, max_value=8) application_preamble = CharField(widget=TextInput(), required=False, label=_("Application preamble")) + application_pdf_title = CharField(widget=TextInput(), required=False, label=_("Title for PDF document (all applications)")) + application_pdf_preamble = CharField(widget=Textarea(), required=False, label=_("Preamble text for PDF document (all applications)")) +class AssignmentConfigForm(Form): + error_css_class = 'error' + required_css_class = 'required' + + assignment_pdf_title = CharField(widget=TextInput(), required=False, label=_("Title for PDF document (all elections)")) + assignment_pdf_preamble = CharField(widget=Textarea(), required=False, label=_("Preamble text for PDF document (all elections)")) \ No newline at end of file diff --git a/openslides/system/models.py b/openslides/system/models.py index aec5a1274..b14014462 100644 --- a/openslides/system/models.py +++ b/openslides/system/models.py @@ -11,13 +11,16 @@ """ from django.db import models +from django.utils.translation import ugettext as _ DEFAULT_DATA = { 'event_name': 'OpenSlides', 'event_description': 'Presentation and voting system', 'application_min_supporters': 4, 'application_preamble': 'Die Versammlung möge beschließen,', - 'sysem_url': 'http://openslides:8000', + 'application_pdf_title': _('Applications'), + 'assignment_pdf_title': _('Elections'), + 'system_url': 'http://127.0.0.1:8000', } class Config(models.Model): diff --git a/openslides/system/templates/system/general.html b/openslides/system/templates/system/general.html index d92f4d997..e293ae246 100644 --- a/openslides/system/templates/system/general.html +++ b/openslides/system/templates/system/general.html @@ -13,7 +13,11 @@ {%trans "Application" %} {{ form_application.as_p }} - +

+
+ {%trans "Elections" %} + {{ form_assignment.as_p }} +