Automated merge with ssh://openslides.org/openslides

This commit is contained in:
Emanuel Schuetze 2012-04-15 12:39:35 +02:00
commit 4d7940cb12
15 changed files with 230 additions and 174 deletions

View File

@ -2,7 +2,7 @@
{% load i18n %}
{% block title %}{{ block.super }} - {% trans "Configuration" %}{% endblock %}
{% block title %}{{ block.super }} - {% trans "Agenda settings" %}{% endblock %}
{% block content %}
<h1>{%trans "Agenda settings" %}</h1>

View File

@ -2,7 +2,7 @@
{% load i18n %}
{% block title %}{{ block.super }} - {% trans "Configuration" %}{% endblock %}
{% block title %}{{ block.super }} - {% trans "Application settings" %}{% endblock %}
{% block content %}
<h1>{%trans "Application settings" %}</h1>

View File

@ -2,7 +2,7 @@
{% load i18n %}
{% block title %}{{ block.super }} - {% trans "Configuration" %}{% endblock %}
{% block title %}{{ block.super }} - {% trans "Election settings" %}{% endblock %}
{% block content %}
<h1>{%trans "Election settings" %}</h1>

View File

@ -17,15 +17,10 @@ from utils.forms import CssClassMixin
from models import config
class SystemConfigForm(Form, CssClassMixin):
system_url = CharField(widget=TextInput(), required=False, label=_("System URL"))
system_welcometext = CharField(widget=Textarea(), required=False, label=_("Welcome text (for password PDF)"))
system_enable_anonymous = BooleanField(required=False, label=_("Access for anonymous / guest users"), help_text=_("Allow access for guest users"))
class EventConfigForm(Form, CssClassMixin):
class GeneralConfigForm(Form, CssClassMixin):
event_name = CharField(widget=TextInput(),label=_("Event name"), max_length=30)
event_description = CharField(widget=TextInput(),label=_("Short description of event"), max_length=100, required=False)
event_date = CharField(widget=TextInput(), required=False, label=_("Event date"))
event_location = CharField(widget=TextInput(), required=False, label=_("Event location"))
event_organizer = CharField(widget=TextInput(), required=False, label=_("Event organizer"))
system_enable_anonymous = BooleanField(required=False, label=_("Allow access for anonymous guest users") )

View File

@ -81,8 +81,6 @@ def default_config(sender, key, **kwargs):
return {
'event_name': 'OpenSlides',
'event_description': 'Presentation and voting system',
'system_url': 'http://127.0.0.1:8000',
'system_welcometext': 'Welcome to OpenSlides!',
}.get(key)

View File

@ -2,12 +2,40 @@
{% load i18n %}
{% block title %}{{ block.super }} - {% trans "Configuration" %}{% endblock %}
{% block title %}{{ block.super }} - {% trans "General settings" %}{% endblock %}
{% block content %}
<h1>{%trans "General settings" %}</h1>
<form action="" method="post">{% csrf_token %}
{{ form.as_p }}
<fieldset>
<legend>{%trans "Event" %}</legend>
{% for field in form %}
{% if "id_event" in field.label_tag %}
<p>
{{ field.errors }}
{{ field.required }}
{{ field.label_tag }}
{{ field }}
{{ field.help_text }}
</p>
{% endif %}
{% endfor %}
</fieldset>
<p></p>
<fieldset style="width: 410px;">
<legend>{%trans "System" %}</legend>
{% for field in form %}
{% if "id_system" in field.label_tag %}
<p>
{{ field.errors }}
{{ field.required }}
{{ field.label_tag }}
{{ field }}
{{ field.help_text }}
</p>
{% endif %}
{% endfor %}
</fieldset>
<p>
<button class="button" type="submit">
<span class="icon ok">{%trans 'Save' %}</span>

View File

@ -23,14 +23,15 @@ from utils.utils import template, permission_required
from utils.views import FormView, TemplateView
from utils.template import Tab
from forms import SystemConfigForm, EventConfigForm
from forms import GeneralConfigForm
from models import config
class GeneralConfig(FormView):
permission_required = 'config.can_manage_config'
form_class = EventConfigForm
form_class = GeneralConfigForm
template_name = 'config/general.html'
def get_initial(self):
@ -40,6 +41,7 @@ class GeneralConfig(FormView):
'event_date': config['event_date'],
'event_location': config['event_location'],
'event_organizer': config['event_organizer'],
'system_enable_anonymous': config['system_enable_anonymous'],
}
def form_valid(self, form):
@ -48,39 +50,6 @@ class GeneralConfig(FormView):
config['event_date'] = form.cleaned_data['event_date']
config['event_location'] = form.cleaned_data['event_location']
config['event_organizer'] = form.cleaned_data['event_organizer']
messages.success(self.request, _('General settings successfully saved.'))
return super(GeneralConfig, self).form_valid(form)
def form_invalid(self, form):
messages.error(self.request, _('Please check the form for errors.'))
return super(Config, self).form_invalid(form)
class VersionConfig(TemplateView):
permission_required = 'config.can_manage_config'
template_name = 'config/version.html'
def get_context_data(self, **kwargs):
context = super(VersionConfig, self).get_context_data(**kwargs)
context['version'] = get_version()
return context
class Config(FormView):
permission_required = 'config.can_manage_config'
form_class = SystemConfigForm
template_name = 'config/config.html'
def get_initial(self):
return {
'system_url': config['system_url'],
'system_welcometext': config['system_welcometext'],
'system_enable_anonymous': config['system_enable_anonymous'],
}
def form_valid(self, form):
config['system_url'] = form.cleaned_data['system_url']
config['system_welcometext'] = form.cleaned_data['system_welcometext']
if form.cleaned_data['system_enable_anonymous']:
config['system_enable_anonymous'] = True
# check for Anonymous group and (re)create it as needed
@ -96,8 +65,18 @@ class Config(FormView):
messages.success(self.request, _('Anonymous access enabled. Please modify the "Anonymous" group to fit your required permissions.'))
else:
config['system_enable_anonymous'] = False
messages.success(self.request, _('System settings successfully saved.'))
return super(Config, self).form_valid(form)
messages.success(self.request, _('General settings successfully saved.'))
return super(GeneralConfig, self).form_valid(form)
class VersionConfig(TemplateView):
permission_required = 'config.can_manage_config'
template_name = 'config/version.html'
def get_context_data(self, **kwargs):
context = super(VersionConfig, self).get_context_data(**kwargs)
context['version'] = get_version()
return context
def register_tab(request):

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-04-15 10:06+0200\n"
"POT-Creation-Date: 2012-04-15 12:24+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -43,9 +43,10 @@ msgstr "Titel"
msgid "Text"
msgstr "Text"
#: agenda/models.py:41
msgid "Transcript"
msgstr ""
#: agenda/models.py:41 participant/models.py:37
#: participant/templates/participant/overview.html:69
msgid "Comment"
msgstr "Kommentar"
#: agenda/models.py:42
msgid "Closed"
@ -68,8 +69,8 @@ msgstr "Darf die Tagesordung verwalten"
msgid "Agenda Item"
msgstr "Tagesordnungseintrag"
#: agenda/models.py:142 agenda/slides.py:7 agenda/views.py:190
#: agenda/views.py:191 agenda/views.py:220
#: agenda/models.py:142 agenda/slides.py:7 agenda/views.py:185
#: agenda/views.py:186 agenda/views.py:215
#: agenda/templates/agenda/base_agenda.html:9
#: agenda/templates/agenda/overview.html:8
#: agenda/templates/agenda/overview.html:42
@ -79,17 +80,17 @@ msgstr "Tagesordnungseintrag"
msgid "Agenda"
msgstr "Tagesordnung"
#: agenda/views.py:165
#: agenda/views.py:160
#, python-format
msgid "Item <b>%s</b> and his children were successfully deleted."
msgstr "Eintrag <b>%s</b> und seine Kindelemente wurde erfolgreich gelöscht."
#: agenda/views.py:171 utils/views.py:191
#: agenda/views.py:166 utils/views.py:191
#, python-format
msgid "Item <b>%s</b> was successfully deleted."
msgstr "Eintrag <b>%s</b> wurde erfolgreich gelöscht."
#: agenda/views.py:175 agenda/views.py:177
#: agenda/views.py:170 agenda/views.py:172
#: agenda/templates/agenda/overview.html:48 application/views.py:706
#: application/views.py:750 application/templates/application/view.html:80
#: application/templates/projector/Application.html:34
@ -101,7 +102,7 @@ msgstr "Eintrag <b>%s</b> wurde erfolgreich gelöscht."
msgid "Yes"
msgstr "Ja"
#: agenda/views.py:175 agenda/views.py:177
#: agenda/views.py:170 agenda/views.py:172
#: agenda/templates/agenda/overview.html:49 application/views.py:706
#: application/views.py:751 application/templates/application/view.html:81
#: application/templates/projector/Application.html:35
@ -111,17 +112,17 @@ msgstr "Ja"
msgid "No"
msgstr "Nein"
#: agenda/views.py:177
#: agenda/views.py:172
msgid "Yes, with all child items."
msgstr "Ja, mit allen Kindelementen."
#: agenda/views.py:183 agenda/views.py:185 participant/views.py:187
#: participant/views.py:281 utils/utils.py:47 utils/views.py:200
#: agenda/views.py:178 agenda/views.py:180 participant/views.py:188
#: participant/views.py:282 utils/utils.py:47 utils/views.py:200
#, python-format
msgid "Do you really want to delete <b>%s</b>?"
msgstr "Soll <b>%s</b> wirklich gelöscht werden?"
#: agenda/views.py:213
#: agenda/views.py:208
msgid "Agenda settings successfully saved."
msgstr "Tagesordnungs-Einstellungen erfolgreich gespeichert."
@ -133,16 +134,7 @@ msgstr "Alle Einträge"
msgid "New item"
msgstr "Neuer Eintrag"
#: agenda/templates/agenda/config.html:5
#: application/templates/application/config.html:5
#: assignment/templates/assignment/config.html:5 config/views.py:94
#: config/templates/config/base_config.html:7
#: config/templates/config/config.html:5
#: config/templates/config/general.html:5
msgid "Configuration"
msgstr "Konfiguration"
#: agenda/templates/agenda/config.html:8
#: agenda/templates/agenda/config.html:5 agenda/templates/agenda/config.html:8
msgid "Agenda settings"
msgstr "Tagesordnungs-Einstellungen"
@ -153,8 +145,8 @@ msgstr "Tagesordnungs-Einstellungen"
#: assignment/templates/assignment/config.html:13
#: assignment/templates/assignment/edit.html:17
#: assignment/templates/assignment/poll_view.html:53
#: config/templates/config/config.html:14
#: config/templates/config/general.html:13
#: config/templates/config/general.html:41
#: participant/templates/participant/config.html:13
#: participant/templates/participant/edit.html:21
#: participant/templates/participant/group_edit.html:17
#: participant/templates/participant/settings.html:18
@ -170,8 +162,8 @@ msgstr "Speichern"
#: assignment/templates/assignment/config.html:17
#: assignment/templates/assignment/edit.html:24
#: assignment/templates/assignment/poll_view.html:60
#: config/templates/config/config.html:18
#: config/templates/config/general.html:17
#: config/templates/config/general.html:45
#: participant/templates/participant/config.html:17
#: participant/templates/participant/edit.html:28
#: participant/templates/participant/group_edit.html:24
#: participant/templates/participant/import.html:26
@ -186,7 +178,7 @@ msgid "Item"
msgstr "Eintrag"
#: agenda/templates/agenda/edit.html:8
#: agenda/templates/agenda/item_row.html:24
#: agenda/templates/agenda/item_row.html:23
msgid "Edit item"
msgstr "Eintrag bearbeiten"
@ -206,11 +198,7 @@ msgstr "Übernehmen"
msgid "Item closed"
msgstr "Eintrag erledigt"
#: agenda/templates/agenda/item_row.html:22
msgid "Show projector preview"
msgstr "Beamer-Vorschau anzeigen"
#: agenda/templates/agenda/item_row.html:25
#: agenda/templates/agenda/item_row.html:24
msgid "Delete item"
msgstr "Eintrag löschen"
@ -467,8 +455,8 @@ msgid "Application was successfully modified."
msgstr "Antrag wurde erfolgreich geändert."
#: application/views.py:198 application/views.py:597 assignment/views.py:129
#: config/views.py:53 participant/views.py:164 participant/views.py:266
#: participant/views.py:295 participant/views.py:453 utils/views.py:153
#: participant/views.py:165 participant/views.py:267 participant/views.py:296
#: participant/views.py:454 utils/views.py:153
msgid "Please check the form for errors."
msgstr "Bitte kontrollieren Sie das Formular nach Fehlern."
@ -571,7 +559,7 @@ msgstr "FEHLER beim Zurückweisen der Version."
msgid "Do you really want to reject version <b>%s</b>?"
msgstr "Soll Version <b>%s</b> wirklich zurückgewiesen werden?"
#: application/views.py:493 participant/views.py:311
#: application/views.py:493 participant/views.py:312
msgid ""
"The import function is available for the superuser (without user profile) "
"only."
@ -579,7 +567,7 @@ msgstr ""
"Die Importfunktion ist nur für den 'superuser' (ohne Nutzerprofil) verfügbar."
#: application/views.py:524 application/views.py:528 application/views.py:534
#: application/views.py:537 participant/views.py:380
#: application/views.py:537 participant/views.py:381
#, python-format
msgid "Ignoring malformed line %d in import file."
msgstr "Fehlerhafte Zeile %d der Quelldatei wurde ignoriert."
@ -605,11 +593,11 @@ msgid_plural "%d new users were added."
msgstr[0] "%d neuer Nutzer wurde erstellt."
msgstr[1] "%d neue Nutzer wurden erstellt."
#: application/views.py:593 participant/views.py:449
#: application/views.py:593 participant/views.py:450
msgid "Import aborted because of severe errors in the input file."
msgstr "Import auf Grund von schweren Fehlern in der Quelldatei abgebrochen."
#: application/views.py:595 participant/views.py:451
#: application/views.py:595 participant/views.py:452
msgid "Import file has wrong character encoding, only UTF-8 is supported!"
msgstr ""
"Die Quelldatei benutzt eine ungültige Zeichenkodierung, es wird nur UTF-8 "
@ -726,6 +714,7 @@ msgstr "Anträge importieren"
msgid "Print all applications"
msgstr "Alle Anträge drucken"
#: application/templates/application/config.html:5
#: application/templates/application/config.html:8
msgid "Application settings"
msgstr "Antrags-Einstellungen"
@ -942,7 +931,9 @@ msgid "Reset"
msgstr "Zurücksetzen"
#: application/templates/application/view.html:220
#: application/templates/application/view.html:248
#: application/templates/application/view.html:248 config/models.py:120
#: config/templates/config/version.html:5
#: config/templates/config/version.html:8
msgid "Version"
msgstr "Version"
@ -972,7 +963,7 @@ msgstr "Zugelassene Version"
#: application/templates/application/view.html:266
msgid "Reject Version"
msgstr "Verion zurückweisen"
msgstr "Version zurückweisen"
#: application/templates/application/view.html:270
msgid "Version rejected"
@ -1211,6 +1202,7 @@ msgstr "Neue Wahl"
msgid "Print all elections"
msgstr "Alle Wahlen drucken"
#: assignment/templates/assignment/config.html:5
#: assignment/templates/assignment/config.html:8
msgid "Election settings"
msgstr "Wahl-Einstellungen"
@ -1332,73 +1324,70 @@ msgid "No ballots available."
msgstr "Keine Wahlgänge vorhanden."
#: config/forms.py:21
msgid "System URL"
msgstr "System URL"
#: config/forms.py:22
msgid "Welcome text (for password PDF)"
msgstr "Willkommenstext (für Passwort-PDF-Liste)"
#: config/forms.py:23
msgid "Access for anonymous / guest users"
msgstr "Zugriff für anonyme oder Gast-Nutzer"
#: config/forms.py:23
msgid "Allow access for guest users"
msgstr "Zugriff für Gast-Nutzer aktivieren"
#: config/forms.py:27
msgid "Event name"
msgstr "Veranstaltungsname"
#: config/forms.py:28
#: config/forms.py:22
msgid "Short description of event"
msgstr "Kurzbeschreibung der Veranstaltung"
#: config/forms.py:29
#: config/forms.py:23
msgid "Event date"
msgstr "Veranstaltungszeitraum"
#: config/forms.py:30
#: config/forms.py:24
msgid "Event location"
msgstr "Veranstaltungsort"
#: config/forms.py:31
#: config/forms.py:25
msgid "Event organizer"
msgstr "Veranstalter"
#: config/forms.py:26
msgid "Allow access for anonymous guest users"
msgstr "Erlaube Zugriff für anonyme Gast-Nutzer"
#: config/models.py:33
msgid "Can manage configuration"
msgstr "Darf die Konfiguration verwalten"
#: config/models.py:106
#: config/models.py:103
msgid "General"
msgstr "Allgemein"
#: config/views.py:49
msgid "General settings successfully saved."
msgstr "Allgemeine Einstellungen erfolgreich gespeichert."
#: config/views.py:84
#: config/views.py:65
msgid ""
"Anonymous access enabled. Please modify the \"Anonymous\" group to fit your "
"required permissions."
msgstr ""
"Anonymer Zugriff aktiviert. Bitte setzen Sie die Rechte der Gruppe "
"Anonymer Zugriff aktiviert. Bitte setzen Sie die Rechte der Benutzerrolle "
"\"Anonymous\" passend zum gewünschten Zugriffslevel."
#: config/views.py:87
msgid "System settings successfully saved."
msgstr "Systemeinstellungen erfolgreich gespeichert."
#: config/views.py:68
msgid "General settings successfully saved."
msgstr "Allgemeine Einstellungen erfolgreich gespeichert."
#: config/templates/config/config.html:8
msgid "System settings"
msgstr "System-Einstellungen"
#: config/views.py:85 config/templates/config/base_config.html:7
msgid "Configuration"
msgstr "Konfiguration"
#: config/templates/config/general.html:5
#: config/templates/config/general.html:8
msgid "General settings"
msgstr "Allgemeine Einstellungen"
#: config/templates/config/general.html:11
msgid "Event"
msgstr "Veranstaltung"
#: config/templates/config/general.html:26 templates/base.html:28
msgid "Welcome"
msgstr "Willkommen"
#: config/templates/config/version.html:10
msgid "OpenSlides Version"
msgstr "OpenSlides Version"
#: participant/forms.py:27
msgid "Keep applications, try to reassign submitter"
msgstr "Anträge beibehalten, versuchen Antragssteller erneut zuzuweisen"
@ -1423,6 +1412,15 @@ msgstr "Nachname"
msgid "For existing applications"
msgstr "Bei existierenden Anträgen"
#: participant/forms.py:89
msgid "System URL"
msgstr "System URL"
#: participant/forms.py:95
#, fuzzy
msgid "Welcome text"
msgstr "Willkommen"
#: participant/models.py:22 participant/templates/participant/overview.html:23
msgid "Male"
msgstr "Männlich"
@ -1465,10 +1463,6 @@ msgstr "Typ"
msgid "Committee"
msgstr "Amt"
#: participant/models.py:37 participant/templates/participant/overview.html:69
msgid "Comment"
msgstr "Kommentar"
#: participant/models.py:38
msgid "First Password"
msgstr "Erst-Passwort"
@ -1481,63 +1475,63 @@ msgstr "Darf die Teilnehmer/inen sehen"
msgid "Can manage participant"
msgstr "Darf die Teilnehmer/inen verwalten"
#: participant/views.py:156
#: participant/views.py:157
msgid "New participant was successfully created."
msgstr "Neue/r Teilnehmer/in wurde erfolgreich angelegt."
#: participant/views.py:158
#: participant/views.py:159
msgid "Participant was successfully modified."
msgstr "Teilnehmer/in wurde erfolgreich geändert."
#: participant/views.py:185
#: participant/views.py:186
#, python-format
msgid "Participant <b>%s</b> was successfully deleted."
msgstr "Teilnehmer/in <b>%s</b> wurde erfolgreich gelöscht."
#: participant/views.py:198
#: participant/views.py:199
#, python-format
msgid "Participant %d does not exist."
msgstr "Teilnehmer/in %d existiert nicht."
#: participant/views.py:244
#: participant/views.py:245
#, python-format
msgid "Group name \"%s\" is reserved for internal use."
msgstr "Der Gruppenname \"%s\" ist für interne Verwendung reserviert."
#: participant/views.py:258
#: participant/views.py:259
msgid "New group was successfully created."
msgstr "Neue Gruppe wurde erfolgreich angelegt."
#: participant/views.py:260
#: participant/views.py:261
msgid "Group was successfully modified."
msgstr "Gruppe wurde erfolgreich geändert."
#: participant/views.py:279
#: participant/views.py:280
#, python-format
msgid "Group <b>%s</b> was successfully deleted."
msgstr "Gruppe <b>%s</b> wurde erfolgreich gelöscht."
#: participant/views.py:293
#: participant/views.py:294
msgid "User settings successfully saved."
msgstr "Nutzereinstellungen wurden erfolgreich gespeichert."
#: participant/views.py:363
#: participant/views.py:364
msgid "Supporters removed after user import."
msgstr "Unterstützer/innen nach Benutzerimport zurückgesetzt."
#: participant/views.py:416
#: participant/views.py:417
#, python-format
msgid "Reassigned to \"%s\" after (re)importing users."
msgstr "Nach Benutzerimport erneut \"%s\" zugeordnet."
#: participant/views.py:419 participant/views.py:433
#: participant/views.py:420 participant/views.py:434
#, python-format
msgid "Could not reassing application %d - object not found!"
msgstr ""
"Antrag Id#%d konnte nicht neu zugewiesen werden - Das Objekt wurde nicht "
"gefunden!"
#: participant/views.py:436
#: participant/views.py:437
#, python-format
msgid "%d application could not be reassigned and needs a review!"
msgid_plural "%d applications could not be reassigned and need a review!"
@ -1546,26 +1540,26 @@ msgstr[0] ""
msgstr[1] ""
"%d Anträge konnten nicht neu zugewiesen werden und benötigen ein Review!"
#: participant/views.py:439
#: participant/views.py:440
#, python-format
msgid "%d application was successfully reassigned."
msgid_plural "%d applications were successfully reassigned."
msgstr[0] "%d Antrag wurde erfolgreich neu zugewiesen."
msgstr[1] "%d Anträge wurden erfolgreich neu zugewiesen."
#: participant/views.py:442
#: participant/views.py:443
#, python-format
msgid "%d application was discarded."
msgid_plural "%d applications were discarded."
msgstr[0] "%d Antrag wurde gelöscht."
msgstr[1] "%d Anträge wurden gelöscht."
#: participant/views.py:446
#: participant/views.py:447
#, python-format
msgid "%d new participants were successfully imported."
msgstr "%d neue Teilnehmer/innen wurden erfolgreich importiert."
#: participant/views.py:455
#: participant/views.py:456
msgid ""
"Attention: All existing participants will be removed if you import new "
"participants."
@ -1573,12 +1567,12 @@ msgstr ""
"Achtung: Alle existierenden Teilnehmer/innen werden gelöscht, wenn Sie neue "
"Teilnehmer/innen importieren."
#: participant/views.py:457
#: participant/views.py:458
msgid "Attention: Supporters from all existing applications will be removed."
msgstr ""
"Achtung: Alle Unterstützer/innen werden von existiernden Anträgen gelöscht."
#: participant/views.py:458
#: participant/views.py:459
msgid ""
"Attention: Applications which can't be mapped to new users will be set to "
"'Needs Review'."
@ -1586,17 +1580,17 @@ msgstr ""
"Achtung: Anträge welche keinem Nutzer zugeordnet werden können bekommen "
"automatisch den Status \"Benötigt Review\"."
#: participant/views.py:470
#: participant/views.py:471
#, python-format
msgid "The Password for <b>%s</b> was successfully reset."
msgstr "Das Passwort für <b>%s</b> wurde erfolgreich zurückgesetzt."
#: participant/views.py:472
#: participant/views.py:473
#, python-format
msgid "Do you really want to reset the password for <b>%s</b>?"
msgstr "Soll das Passwort für <b>%s</b> wirklich zurückgesetzt werden?"
#: participant/views.py:480
#: participant/views.py:481
#: participant/templates/participant/base_participant.html:12
#: participant/templates/participant/overview.html:6
#: participant/templates/participant/overview.html:16
@ -1605,6 +1599,11 @@ msgstr "Soll das Passwort für <b>%s</b> wirklich zurückgesetzt werden?"
msgid "Participants"
msgstr "Teilnehmer/innen"
#: participant/views.py:502
#, fuzzy
msgid "Participants settings successfully saved."
msgstr "Wahl-Einstellungen wurden erfolgreich gespeichert."
#: participant/templates/participant/base_participant.html:15
msgid "All participants"
msgstr "Alle Teilnehmer/innen"
@ -1637,6 +1636,12 @@ msgstr "Teilnehmerliste drucken"
msgid "Print first time passwords"
msgstr "Erst-Passwörter drucken"
#: participant/templates/participant/config.html:5
#: participant/templates/participant/config.html:8
#, fuzzy
msgid "Participant settings"
msgstr "Teilnehmer/innen"
#: participant/templates/participant/edit.html:5
msgid "Participant"
msgstr "Teilnehmer/in"
@ -1694,11 +1699,11 @@ msgstr ""
#: participant/templates/participant/login.html:8
#: participant/templates/participant/login.html:16
#: participant/templates/participant/login.html:45 templates/base.html:29
#: participant/templates/participant/login.html:45 templates/base.html:30
msgid "Login"
msgstr "Anmelden"
#: participant/templates/participant/login.html:21 templates/base.html:55
#: participant/templates/participant/login.html:21 templates/base.html:56
msgid "Close this notification"
msgstr "Meldung ausblenden"
@ -1870,22 +1875,18 @@ msgstr "Seite nicht gefunden."
msgid "Server Error"
msgstr "Serverfehler"
#: templates/base.html:19
#: templates/base.html:20
msgid "Home"
msgstr "Startseite"
#: templates/base.html:25
#: templates/base.html:26
msgid "Logout"
msgstr "Abmelden"
#: templates/base.html:26
#: templates/base.html:27
msgid "User Settings"
msgstr "Benutzereinstellungen"
#: templates/base.html:27
msgid "Welcome"
msgstr "Willkommen"
#: utils/pdf.py:189
msgid "%Y-%m-%d %H:%Mh"
msgstr "%d.%m.%Y %H:%Mh"
@ -1942,6 +1943,10 @@ msgstr "verfügbare Posten"
msgid "Sorry, you have no rights to see this page."
msgstr "Bedaure, Sie haben keine Berechtigung diese Seite zu sehen."
#: utils/views.py:207
#: utils/views.py:219
msgid "undefined-filename"
msgstr "undefinierter-dateiname"
#, fuzzy
#~ msgid "Access for guest users"
#~ msgstr "Zugriff für Gast-Nutzer aktivieren"

View File

@ -10,7 +10,7 @@
:license: GNU GPL, see LICENSE for more details.
"""
from django.forms import Form, ModelForm, CharField, EmailField, FileField, FileInput, MultipleChoiceField, ModelMultipleChoiceField, ChoiceField, BooleanField
from django.forms import Form, ModelForm, CharField, EmailField, FileField, FileInput, TextInput, Textarea, MultipleChoiceField, ModelMultipleChoiceField, ChoiceField, BooleanField
from django.contrib.auth.models import User, Group, Permission
from django.contrib.auth.forms import AdminPasswordChangeForm
from django.utils.translation import ugettext as _
@ -80,3 +80,18 @@ class UsersettingsForm(UserEditForm, CssClassMixin):
class UserImportForm(Form, CssClassMixin):
csvfile = FileField(widget=FileInput(attrs={'size':'50'}), label=_("CSV File"))
application_handling = ChoiceField(required=True, choices=USER_APPLICATION_IMPORT_OPTIONS, label=_("For existing applications"))
class ConfigForm(Form, CssClassMixin):
participant_pdf_system_url = CharField(
widget=TextInput(),
required=False,
label=_("System URL"),
help_text="Printed in PDF of first time passwords only.",
)
participant_pdf_welcometext = CharField(
widget=Textarea(),
required=False,
label=_("Welcome text"),
help_text="Printed in PDF of first time passwords only.",
)

View File

@ -68,3 +68,15 @@ class Profile(models.Model):
('can_see_participant', _("Can see participant", fixstr=True)),
('can_manage_participant', _("Can manage participant", fixstr=True)),
)
from django.dispatch import receiver
from openslides.config.signals import default_config_value
@receiver(default_config_value, dispatch_uid="participant_default_config")
def default_config(sender, key, **kwargs):
return {
'participant_pdf_system_url': 'http://example.com:8000',
'participant_pdf_welcometext': 'Welcome to OpenSlides!',
}.get(key)

View File

@ -2,19 +2,18 @@
{% load i18n %}
{% block title %}{{ block.super }} - {% trans "Configuration" %}{% endblock %}
{% block title %}{{ block.super }} - {% trans "Participant settings" %}{% endblock %}
{% block content %}
<h1>{%trans "System settings" %}</h1>
<h1>{%trans "Participant settings" %}</h1>
<form action="" method="post">{% csrf_token %}
{{ form.as_p }}
<p>
<button class="button" type="submit">
<span class="icon ok">{%trans 'Save' %}</span>
</button>
<a href='{% url config_config %}'>
<button class="button" type="button" onclick="window.location='{% url config_config %}'">
<a href='{% url config_application %}'>
<button class="button" type="button" onclick="window.location='{% url config_application %}'">
<span class="icon cancel">{%trans 'Cancel' %}</span>
</button>
</a>

View File

@ -36,12 +36,13 @@ from participant.models import Profile
from participant.api import gen_username, gen_password
from participant.forms import (UserNewForm, UserEditForm, ProfileForm,
UsersettingsForm, UserImportForm, GroupForm,
AdminPasswordChangeForm)
AdminPasswordChangeForm, ConfigForm)
from application.models import Application
from utils.utils import (template, permission_required, gen_confirm_form,
ajax_request, decodedict, encodedict)
from utils.pdf import print_userlist, print_passwords
from utils.template import Tab
from utils.views import FormView
from config.models import config
from django.db.models import Avg, Max, Min, Count
@ -482,3 +483,21 @@ def register_tab(request):
permission=request.user.has_perm('participant.can_see_participant') or request.user.has_perm('participant.can_manage_participant'),
selected=selected,
)
class Config(FormView):
permission_required = 'config.can_manage_config'
form_class = ConfigForm
template_name = 'participant/config.html'
def get_initial(self):
return {
'participant_pdf_system_url': config['participant_pdf_system_url'],
'participant_pdf_welcometext': config['participant_pdf_welcometext'],
}
def form_valid(self, form):
config['participant_pdf_system_url'] = form.cleaned_data['participant_pdf_system_url']
config['participant_pdf_welcometext'] = form.cleaned_data['participant_pdf_welcometext']
messages.success(self.request, _('Participants settings successfully saved.'))
return super(Config, self).form_valid(form)

View File

@ -456,6 +456,12 @@ form input:after {
font-weight: bold;
}
/* Fieldsets */
fieldset {
width: 0px;
padding: 0 60px 0 20px;
}
/* Lists */
ul {
list-style:none outside none;

View File

@ -261,8 +261,8 @@ def print_passwords(request):
story = [Spacer(0,0*cm)]
data= []
system_url = config["system_url"]
system_welcometext = config["system_welcometext"]
participant_pdf_system_url = config["participant_pdf_system_url"]
participant_pdf_welcometext = config["participant_pdf_welcometext"]
for user in User.objects.all().order_by('last_name'):
try:
user.get_profile()
@ -274,12 +274,12 @@ def print_passwords(request):
cell.append(Paragraph(_("User: %s") % (user.username), stylesheet['Ballot_option']))
cell.append(Paragraph(_("Password: %s") % (user.profile.firstpassword), stylesheet['Ballot_option']))
cell.append(Spacer(0,0.5*cm))
cell.append(Paragraph(_("URL: %s") % (system_url), stylesheet['Ballot_option']))
cell.append(Paragraph(_("URL: %s") % (participant_pdf_system_url), stylesheet['Ballot_option']))
cell.append(Spacer(0,0.5*cm))
cell2 = []
cell2.append(Spacer(0,0.8*cm))
if system_welcometext is not None:
cell2.append(Paragraph(system_welcometext.replace('\r\n','<br/>'), stylesheet['Ballot_subtitle']))
if participant_pdf_welcometext is not None:
cell2.append(Paragraph(participant_pdf_welcometext.replace('\r\n','<br/>'), stylesheet['Ballot_subtitle']))
data.append([cell,cell2])
except Profile.DoesNotExist: