diff --git a/openslides/agenda/templates/agenda/overview.html b/openslides/agenda/templates/agenda/overview.html index 6717c7a29..bbde2f377 100644 --- a/openslides/agenda/templates/agenda/overview.html +++ b/openslides/agenda/templates/agenda/overview.html @@ -51,7 +51,7 @@ - {% trans "Countdown" %} ({{countdown_time}}{% trans "sec" %}){% if countdown_visible == "True" %}: + {% trans "Countdown" %} ({{countdown_time}}{% trans "sec" %}){% if countdown_visible == "True" %}: diff --git a/openslides/application/templates/application/import.html b/openslides/application/templates/application/import.html index 8451bf62d..2bec6fede 100644 --- a/openslides/application/templates/application/import.html +++ b/openslides/application/templates/application/import.html @@ -2,7 +2,7 @@ {% block title %}{{ block.super }} - {%trans "Import applications" %} {% endblock %} {% block content %} -

Import

+

{%trans "Import applications" %}

{% trans 'Select a CSV file to import applications!' %}

{% trans '(Required comma separated values: number, title, text, reason, first_name, last_name - number and reason are optional and may be empty)' %}

diff --git a/openslides/locale/de/LC_MESSAGES/django.mo b/openslides/locale/de/LC_MESSAGES/django.mo index 67253bc9d..20f86dc9e 100644 Binary files a/openslides/locale/de/LC_MESSAGES/django.mo and b/openslides/locale/de/LC_MESSAGES/django.mo differ diff --git a/openslides/locale/de/LC_MESSAGES/django.po b/openslides/locale/de/LC_MESSAGES/django.po index 903c4421c..f62407ea2 100644 --- a/openslides/locale/de/LC_MESSAGES/django.po +++ b/openslides/locale/de/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-14 22:57+0100\n" +"POT-Creation-Date: 2011-11-14 23:35+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -95,8 +95,8 @@ msgstr "Text" #: application/templates/application/edit.html:2 #: application/templates/application/view.html:2 #: application/templates/application/view.html:220 poll/models.py:23 -#: poll/models.py:138 system/templates/system/general.html:18 utils/pdf.py:458 -#: utils/pdf.py:470 +#: poll/models.py:138 system/templates/system/base_system.html:14 +#: utils/pdf.py:458 utils/pdf.py:470 msgid "Application" msgstr "Antrag" @@ -104,7 +104,8 @@ msgstr "Antrag" #: agenda/templates/agenda/overview.html:231 #: agenda/templates/beamer/ItemAssignment.html:8 #: assignment/templates/assignment/edit.html:2 poll/models.py:24 -#: utils/pdf.py:534 utils/pdf.py:675 utils/pdf.py:684 +#: system/templates/system/base_system.html:15 utils/pdf.py:534 +#: utils/pdf.py:675 utils/pdf.py:684 msgid "Election" msgstr "Wahl" @@ -119,7 +120,7 @@ msgstr "Abstimmung" #: agenda/templates/agenda/overview.html:96 #: agenda/templates/beamer/overview.html:3 #: agenda/templates/beamer/overview.html:10 -#: system/templates/system/general.html:13 templates/base.html:37 +#: system/templates/system/base_system.html:13 templates/base.html:37 #: utils/pdf.py:227 utils/pdf.py:232 msgid "Agenda" msgstr "Tagesordnung" @@ -147,7 +148,8 @@ msgstr "Tagesordnungseintrag geändert" #: agenda/views.py:283 application/views.py:531 participant/views.py:145 #: participant/views.py:256 participant/views.py:285 participant/views.py:346 -#: system/views.py:49 system/views.py:92 +#: system/views.py:37 system/views.py:55 system/views.py:79 +#: system/views.py:105 system/views.py:143 msgid "Please check the form for errors." msgstr "Bitte kontrollieren Sie das Formular nach Fehlern." @@ -209,7 +211,10 @@ msgstr "Wahleintrag" #: participant/templates/participant/edit.html:18 #: participant/templates/participant/group_edit.html:14 #: participant/templates/participant/settings.html:15 -#: system/templates/system/general.html:28 +#: system/templates/system/agenda.html:10 +#: system/templates/system/application.html:10 +#: system/templates/system/assignment.html:10 +#: system/templates/system/general.html:10 #: system/templates/system/system.html:11 msgid "Save" msgstr "Speichern" @@ -235,7 +240,10 @@ msgstr "Übernehmen" #: participant/templates/participant/group_edit.html:21 #: participant/templates/participant/import.html:16 #: participant/templates/participant/settings.html:19 -#: system/templates/system/general.html:32 +#: system/templates/system/agenda.html:14 +#: system/templates/system/application.html:14 +#: system/templates/system/assignment.html:14 +#: system/templates/system/general.html:14 #: system/templates/system/system.html:15 msgid "Cancel" msgstr "Abbrechen" @@ -800,6 +808,7 @@ msgstr "Neuer Antrag" #: application/templates/application/base_application.html:13 #: application/templates/application/import.html:2 +#: application/templates/application/import.html:5 msgid "Import applications" msgstr "Anträge importieren" @@ -1194,8 +1203,7 @@ msgstr "gewählt" #: assignment/templates/assignment/overview.html:2 #: assignment/templates/assignment/overview.html:5 #: assignment/templates/assignment/overview.html:21 system/models.py:23 -#: system/templates/system/general.html:23 templates/base.html:45 -#: utils/pdf.py:642 +#: templates/base.html:45 utils/pdf.py:642 msgid "Elections" msgstr "Wahlen" @@ -1703,7 +1711,23 @@ msgstr "Titel für PDF-Dokument (alle Wahlen)" msgid "Preamble text for PDF document (all elections)" msgstr "Einleitungstext für PDF-Dokument (alle Wahlen) " -#: system/views.py:43 +#: system/views.py:35 +msgid "General settings successfully saved." +msgstr "Allgemeine Einstellungen erfolgreich gespeichert." + +#: system/views.py:53 +msgid "Agenda settings successfully saved." +msgstr "Tagesordnungs-Einstellungen erfolgreich gespeichert." + +#: system/views.py:77 +msgid "Application settings successfully saved." +msgstr "Antrags-Einstellungen erfolgreich gespeichert." + +#: system/views.py:103 +msgid "Election settings successfully saved." +msgstr "Wahl-Einstellungen wurden erfolgreich gespeichert." + +#: system/views.py:137 msgid "" "Anonymous access enabled. Please modify the \"Anonymous\" group to fit your " "required permissions." @@ -1711,33 +1735,46 @@ msgstr "" "Anonymer Zugriff aktiviert. Bitte setzen Sie die Rechte der Gruppe " "\"Anonymous\" passend zum gewünschten Zugriffslevel." -#: system/views.py:47 +#: system/views.py:141 msgid "System settings successfully saved." msgstr "Systemeinstellungen erfolgreich gespeichert." -#: system/views.py:90 -msgid "General settings successfully saved." -msgstr "Allgemeine Einstellungen erfolgreich gespeichert." - -#: system/templates/system/base_system.html:7 +#: system/templates/system/agenda.html:2 +#: system/templates/system/application.html:2 +#: system/templates/system/assignment.html:2 +#: system/templates/system/base_system.html:10 #: system/templates/system/general.html:2 #: system/templates/system/system.html:2 templates/base.html:53 msgid "Configuration" msgstr "Konfiguration" -#: system/templates/system/base_system.html:9 -#: system/templates/system/general.html:5 +#: system/templates/system/agenda.html:5 +msgid "Agenda settings" +msgstr "Tagesordnungs-Einstellungen" + +#: system/templates/system/application.html:5 +msgid "Application settings" +msgstr "Antrags-Einstellungen" + +#: system/templates/system/assignment.html:5 +msgid "Election settings" +msgstr "Wahl-Einstellungen" + +#: system/templates/system/base_system.html:12 msgid "General" msgstr "Allgemein" -#: system/templates/system/base_system.html:10 -#: system/templates/system/system.html:5 +#: system/templates/system/base_system.html:16 msgid "System" msgstr "System" -#: system/templates/system/general.html:8 -msgid "Event" -msgstr "Veranstaltung" +#: system/templates/system/general.html:5 +msgid "General settings" +msgstr "Allgemeine Einstellungen" + +#: system/templates/system/system.html:5 +msgid "System settings" +msgstr "System-Einstellungen" #: templates/404.html:9 msgid "Page not found." @@ -1834,3 +1871,6 @@ msgstr "verfügbare Posten" #: utils/utils.py:75 msgid "Sorry, you have no rights to see this page." msgstr "Bedaure, Sie haben keine Berechtigung diese Seite zu sehen." + +#~ msgid "Event" +#~ msgstr "Veranstaltung" diff --git a/openslides/system/templates/system/agenda.html b/openslides/system/templates/system/agenda.html new file mode 100644 index 000000000..08a079e9f --- /dev/null +++ b/openslides/system/templates/system/agenda.html @@ -0,0 +1,19 @@ +{% extends "system/base_system.html" %} +{% block title %}{{ block.super }} - {%trans "Configuration" %}{% endblock %} + +{% block content %} +

{%trans "Agenda settings" %}

+
{% csrf_token %} + {{ form_agenda.as_p }} +

+ + + + +

+
+{% endblock %} diff --git a/openslides/system/templates/system/application.html b/openslides/system/templates/system/application.html new file mode 100644 index 000000000..3cdf440ab --- /dev/null +++ b/openslides/system/templates/system/application.html @@ -0,0 +1,19 @@ +{% extends "system/base_system.html" %} +{% block title %}{{ block.super }} - {%trans "Configuration" %}{% endblock %} + +{% block content %} +

{%trans "Application settings" %}

+
{% csrf_token %} + {{ form_application.as_p }} +

+ + + + +

+
+{% endblock %} diff --git a/openslides/system/templates/system/assignment.html b/openslides/system/templates/system/assignment.html new file mode 100644 index 000000000..0c08d791a --- /dev/null +++ b/openslides/system/templates/system/assignment.html @@ -0,0 +1,19 @@ +{% extends "system/base_system.html" %} +{% block title %}{{ block.super }} - {%trans "Configuration" %}{% endblock %} + +{% block content %} +

{%trans "Election settings" %}

+
{% csrf_token %} + {{ form_assignment.as_p }} +

+ + + + +

+
+{% endblock %} diff --git a/openslides/system/templates/system/base_system.html b/openslides/system/templates/system/base_system.html index 32b3e695b..4e93f36a8 100644 --- a/openslides/system/templates/system/base_system.html +++ b/openslides/system/templates/system/base_system.html @@ -2,11 +2,17 @@ {% load tags %} {% block submenu %} + {% url config_general as url_config_general %} + {% url config_agenda as url_config_agenda %} + {% url config_application as url_config_application %} + {% url config_assignment as url_config_assignment %} {% url config_system as url_config_system %} - {% url config_general as url_config_general %}

{%trans "Configuration" %}

{% endblock %} diff --git a/openslides/system/templates/system/general.html b/openslides/system/templates/system/general.html index 8c8bdccd7..0303ff0ca 100644 --- a/openslides/system/templates/system/general.html +++ b/openslides/system/templates/system/general.html @@ -2,27 +2,9 @@ {% block title %}{{ block.super }} - {%trans "Configuration" %}{% endblock %} {% block content %} -

{%trans "General" %}

+

{%trans "General settings" %}

{% csrf_token %} -
- {%trans "Event" %} - {{ form_event.as_p }} -
-

-
- {%trans "Agenda" %} - {{ form_agenda.as_p }} -
-

-
- {%trans "Application" %} - {{ form_application.as_p }} -
-

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

- - diff --git a/openslides/system/urls.py b/openslides/system/urls.py index f899ba2a9..1e7673d04 100644 --- a/openslides/system/urls.py +++ b/openslides/system/urls.py @@ -14,5 +14,8 @@ from django.conf.urls.defaults import * urlpatterns = patterns('system.views', url(r'^config/general$', 'get_general_config', name='config_general'), + url(r'^config/agenda$', 'get_agenda_config', name='config_agenda'), + url(r'^config/application$', 'get_application_config', name='config_application'), + url(r'^config/assignment$', 'get_assignment_config', name='config_assignment'), url(r'^config/system$', 'get_system_config', name='config_system'), ) diff --git a/openslides/system/views.py b/openslides/system/views.py index b470a2ace..09e8a00d2 100644 --- a/openslides/system/views.py +++ b/openslides/system/views.py @@ -20,6 +20,100 @@ from utils.utils import template, permission_required from system.forms import SystemConfigForm, EventConfigForm, AgendaConfigForm, ApplicationConfigForm, AssignmentConfigForm from system.api import config_get, config_set +@permission_required('system.can_manage_system') +@template('system/general.html') +def get_general_config(request): + if request.method == 'POST': + form_event = EventConfigForm(request.POST, prefix='event') + if form_event.is_valid(): + # event form + config_set('event_name', form_event.cleaned_data['event_name']) + config_set('event_description', form_event.cleaned_data['event_description']) + config_set('event_date', form_event.cleaned_data['event_date']) + config_set('event_location', form_event.cleaned_data['event_location']) + config_set('event_organizer', form_event.cleaned_data['event_organizer']) + messages.success(request, _('General settings successfully saved.')) + else: + messages.error(request, _('Please check the form for errors.')) + else: + form_event = EventConfigForm(initial={ + 'event_name': config_get('event_name'), + }, prefix='event') + return { + 'form_event': form_event, + } + +@permission_required('system.can_manage_system') +@template('system/agenda.html') +def get_agenda_config(request): + if request.method == 'POST': + form_agenda = AgendaConfigForm(request.POST, prefix='agenda') + if form_agenda.is_valid(): + config_set('agenda_countdown_time', form_agenda.cleaned_data['agenda_countdown_time']) + messages.success(request, _('Agenda settings successfully saved.')) + else: + messages.error(request, _('Please check the form for errors.')) + else: + form_agenda = AgendaConfigForm(initial={ + 'agenda_countdown_time': config_get('agenda_countdown_time'), + }, prefix='agenda') + return { + 'form_agenda': form_agenda, + } + +@permission_required('system.can_manage_system') +@template('system/application.html') +def get_application_config(request): + if request.method == 'POST': + form_application = ApplicationConfigForm(request.POST, prefix='application') + form_assignment = AssignmentConfigForm(request.POST, prefix='assignment') + if form_application.is_valid(): + config_set('application_min_supporters', form_application.cleaned_data['application_min_supporters']) + config_set('application_preamble', form_application.cleaned_data['application_preamble']) + config_set('application_pdf_ballot_papers_selection', form_application.cleaned_data['application_pdf_ballot_papers_selection']) + config_set('application_pdf_ballot_papers_number', form_application.cleaned_data['application_pdf_ballot_papers_number']) + config_set('application_pdf_title', form_application.cleaned_data['application_pdf_title']) + config_set('application_pdf_preamble', form_application.cleaned_data['application_pdf_preamble']) + messages.success(request, _('Application settings successfully saved.')) + else: + messages.error(request, _('Please check the form for errors.')) + else: + form_application = ApplicationConfigForm(initial={ + 'application_min_supporters': config_get('application_min_supporters'), + 'application_preamble': config_get('application_preamble'), + 'application_pdf_ballot_papers_selection': config_get('application_pdf_ballot_papers_selection'), + 'application_pdf_ballot_papers_number': config_get('application_pdf_ballot_papers_number'), + 'application_pdf_title': config_get('application_pdf_title'), + 'application_pdf_preamble': config_get('application_pdf_preamble'), + }, prefix='application') + return { + 'form_application': form_application, + } + +@permission_required('system.can_manage_system') +@template('system/assignment.html') +def get_assignment_config(request): + if request.method == 'POST': + form_assignment = AssignmentConfigForm(request.POST, prefix='assignment') + if form_assignment.is_valid(): + config_set('assignment_pdf_ballot_papers_selection', form_assignment.cleaned_data['assignment_pdf_ballot_papers_selection']) + config_set('assignment_pdf_ballot_papers_number', form_assignment.cleaned_data['assignment_pdf_ballot_papers_number']) + config_set('assignment_pdf_title', form_assignment.cleaned_data['assignment_pdf_title']) + config_set('assignment_pdf_preamble', form_assignment.cleaned_data['assignment_pdf_preamble']) + messages.success(request, _('Election settings successfully saved.')) + else: + messages.error(request, _('Please check the form for errors.')) + else: + form_assignment = AssignmentConfigForm(initial={ + 'assignment_pdf_ballot_papers_selection': config_get('assignment_pdf_ballot_papers_selection'), + 'assignment_pdf_ballot_papers_number': config_get('assignment_pdf_ballot_papers_number'), + 'assignment_pdf_title': config_get('assignment_pdf_title'), + 'assignment_pdf_preamble': config_get('assignment_pdf_preamble'), + }, prefix='assignment') + return { + 'form_assignment': form_assignment, + } + @permission_required('system.can_manage_system') @template('system/system.html') def get_system_config(request): @@ -47,7 +141,6 @@ def get_system_config(request): messages.success(request, _('System settings successfully saved.')) else: messages.error(request, _('Please check the form for errors.')) - else: form = SystemConfigForm(initial={ 'system_url': config_get('system_url'), @@ -57,68 +150,3 @@ def get_system_config(request): return { 'form': form, } - -@permission_required('system.can_manage_system') -@template('system/general.html') -def get_general_config(request): - if request.method == 'POST': - form_event = EventConfigForm(request.POST, prefix='event') - form_agenda = AgendaConfigForm(request.POST, prefix='agenda') - form_application = ApplicationConfigForm(request.POST, prefix='application') - form_assignment = AssignmentConfigForm(request.POST, prefix='assignment') - if form_event.is_valid() and form_agenda.is_valid() and form_application.is_valid() and form_assignment.is_valid(): - # event form - config_set('event_name', form_event.cleaned_data['event_name']) - config_set('event_description', form_event.cleaned_data['event_description']) - config_set('event_date', form_event.cleaned_data['event_date']) - config_set('event_location', form_event.cleaned_data['event_location']) - config_set('event_organizer', form_event.cleaned_data['event_organizer']) - # agenda form - config_set('agenda_countdown_time', form_agenda.cleaned_data['agenda_countdown_time']) - # application form - config_set('application_min_supporters', form_application.cleaned_data['application_min_supporters']) - config_set('application_preamble', form_application.cleaned_data['application_preamble']) - config_set('application_pdf_ballot_papers_selection', form_application.cleaned_data['application_pdf_ballot_papers_selection']) - config_set('application_pdf_ballot_papers_number', form_application.cleaned_data['application_pdf_ballot_papers_number']) - config_set('application_pdf_title', form_application.cleaned_data['application_pdf_title']) - config_set('application_pdf_preamble', form_application.cleaned_data['application_pdf_preamble']) - # assignment form - config_set('assignment_pdf_ballot_papers_selection', form_assignment.cleaned_data['assignment_pdf_ballot_papers_selection']) - config_set('assignment_pdf_ballot_papers_number', form_assignment.cleaned_data['assignment_pdf_ballot_papers_number']) - config_set('assignment_pdf_title', form_assignment.cleaned_data['assignment_pdf_title']) - config_set('assignment_pdf_preamble', form_assignment.cleaned_data['assignment_pdf_preamble']) - messages.success(request, _('General settings successfully saved.')) - else: - messages.error(request, _('Please check the form for errors.')) - - else: - form_event = EventConfigForm(initial={ - 'event_name': config_get('event_name'), - 'event_description': config_get('event_description'), - 'event_date': config_get('event_date'), - 'event_location': config_get('event_location'), - 'event_organizer': config_get('event_organizer'), - }, prefix='event') - form_agenda = AgendaConfigForm(initial={ - 'agenda_countdown_time': config_get('agenda_countdown_time'), - }, prefix='agenda') - form_application = ApplicationConfigForm(initial={ - 'application_min_supporters': config_get('application_min_supporters'), - 'application_preamble': config_get('application_preamble'), - 'application_pdf_ballot_papers_selection': config_get('application_pdf_ballot_papers_selection'), - 'application_pdf_ballot_papers_number': config_get('application_pdf_ballot_papers_number'), - 'application_pdf_title': config_get('application_pdf_title'), - 'application_pdf_preamble': config_get('application_pdf_preamble'), - }, prefix='application') - form_assignment = AssignmentConfigForm(initial={ - 'assignment_pdf_ballot_papers_selection': config_get('assignment_pdf_ballot_papers_selection'), - 'assignment_pdf_ballot_papers_number': config_get('assignment_pdf_ballot_papers_number'), - 'assignment_pdf_title': config_get('assignment_pdf_title'), - 'assignment_pdf_preamble': config_get('assignment_pdf_preamble'), - }, prefix='assignment') - return { - 'form_event': form_event, - 'form_agenda': form_agenda, - 'form_application': form_application, - 'form_assignment': form_assignment, - }