2015-06-17 18:32:05 +02:00
|
|
|
from django.core.validators import MaxLengthValidator
|
2015-02-12 20:57:05 +01:00
|
|
|
from django.dispatch import Signal
|
2013-09-25 10:01:01 +02:00
|
|
|
from django.utils.translation import ugettext as _
|
2015-06-17 18:32:05 +02:00
|
|
|
from django.utils.translation import ugettext_lazy
|
2013-03-01 17:13:12 +01:00
|
|
|
|
2015-06-17 18:32:05 +02:00
|
|
|
from openslides.config.api import ConfigVariable
|
2013-03-11 21:32:09 +01:00
|
|
|
|
2015-02-12 20:57:05 +01:00
|
|
|
# This signal is sent when the migrate command is done. That means it is sent
|
|
|
|
# after post_migrate sending and creating all Permission objects. Don't use it
|
|
|
|
# for other things than dealing with Permission objects.
|
|
|
|
post_permission_creation = Signal()
|
|
|
|
|
2013-03-01 17:13:12 +01:00
|
|
|
|
2013-12-02 19:33:43 +01:00
|
|
|
def setup_general_config(sender, **kwargs):
|
2013-03-01 17:13:12 +01:00
|
|
|
"""
|
2014-11-13 22:23:16 +01:00
|
|
|
Receiver function to setup general config variables for OpenSlides.
|
2015-06-17 18:32:05 +02:00
|
|
|
There are two main groups: 'General' and 'Projector'. The group
|
|
|
|
'General' has subgroups. This function is connected to the signal
|
|
|
|
openslides.config.signals.config_signal during app loading.
|
2013-03-01 17:13:12 +01:00
|
|
|
"""
|
2015-06-17 18:32:05 +02:00
|
|
|
# General Event
|
|
|
|
|
|
|
|
yield ConfigVariable(
|
2015-06-16 18:12:59 +02:00
|
|
|
name='general_event_name',
|
2013-03-01 17:13:12 +01:00
|
|
|
default_value='OpenSlides',
|
2015-06-17 18:32:05 +02:00
|
|
|
label=ugettext_lazy('Event name'),
|
|
|
|
weight=110,
|
|
|
|
group=ugettext_lazy('General'),
|
|
|
|
subgroup=ugettext_lazy('Event'),
|
|
|
|
validators=(MaxLengthValidator(50),))
|
2013-03-01 17:13:12 +01:00
|
|
|
|
2015-06-17 18:32:05 +02:00
|
|
|
yield ConfigVariable(
|
2015-06-16 18:12:59 +02:00
|
|
|
name='general_event_description',
|
2013-03-01 17:13:12 +01:00
|
|
|
default_value=_('Presentation and assembly system'),
|
2015-06-17 18:32:05 +02:00
|
|
|
label=ugettext_lazy('Short description of event'),
|
|
|
|
weight=115,
|
|
|
|
group=ugettext_lazy('General'),
|
|
|
|
subgroup=ugettext_lazy('Event'),
|
|
|
|
validators=(MaxLengthValidator(100),),
|
|
|
|
translatable=True)
|
|
|
|
|
|
|
|
yield ConfigVariable(
|
2015-06-16 18:12:59 +02:00
|
|
|
name='general_event_date',
|
2013-03-01 17:13:12 +01:00
|
|
|
default_value='',
|
2015-06-17 18:32:05 +02:00
|
|
|
label=ugettext_lazy('Event date'),
|
|
|
|
weight=120,
|
|
|
|
group=ugettext_lazy('General'),
|
|
|
|
subgroup=ugettext_lazy('Event'))
|
2013-03-01 17:13:12 +01:00
|
|
|
|
2015-06-17 18:32:05 +02:00
|
|
|
yield ConfigVariable(
|
2015-06-16 18:12:59 +02:00
|
|
|
name='general_event_location',
|
2013-03-01 17:13:12 +01:00
|
|
|
default_value='',
|
2015-06-17 18:32:05 +02:00
|
|
|
label=ugettext_lazy('Event location'),
|
|
|
|
weight=125,
|
|
|
|
group=ugettext_lazy('General'),
|
|
|
|
subgroup=ugettext_lazy('Event'))
|
2013-03-01 17:13:12 +01:00
|
|
|
|
2015-06-16 18:12:59 +02:00
|
|
|
# TODO: Check whether this variable is ever used.
|
2015-06-17 18:32:05 +02:00
|
|
|
yield ConfigVariable(
|
2015-06-16 18:12:59 +02:00
|
|
|
name='general_event_organizer',
|
2013-03-01 17:13:12 +01:00
|
|
|
default_value='',
|
2015-06-17 18:32:05 +02:00
|
|
|
label=ugettext_lazy('Event organizer'),
|
|
|
|
weight=130,
|
|
|
|
group=ugettext_lazy('General'),
|
|
|
|
subgroup=ugettext_lazy('Event'))
|
|
|
|
|
|
|
|
# General System
|
2013-03-01 17:13:12 +01:00
|
|
|
|
2015-06-17 18:32:05 +02:00
|
|
|
yield ConfigVariable(
|
2015-06-16 18:12:59 +02:00
|
|
|
name='general_system_enable_anonymous',
|
|
|
|
default_value=False,
|
2015-06-17 18:32:05 +02:00
|
|
|
input_type='boolean',
|
|
|
|
label=ugettext_lazy('Allow access for anonymous guest users'),
|
|
|
|
weight=135,
|
|
|
|
group=ugettext_lazy('General'),
|
|
|
|
subgroup=ugettext_lazy('System'))
|
2015-06-16 18:12:59 +02:00
|
|
|
|
2015-06-17 18:32:05 +02:00
|
|
|
# Projector
|
|
|
|
|
|
|
|
yield ConfigVariable(
|
2013-11-09 23:04:50 +01:00
|
|
|
name='projector_enable_logo',
|
|
|
|
default_value=True,
|
2015-06-17 18:32:05 +02:00
|
|
|
input_type='boolean',
|
|
|
|
label=ugettext_lazy('Show logo on projector'),
|
|
|
|
help_text=ugettext_lazy('You can find and replace the logo under "openslides/core/static/...".'), # TODO: Update path.
|
|
|
|
weight=150,
|
|
|
|
group=ugettext_lazy('Projector'))
|
2013-11-09 23:04:50 +01:00
|
|
|
|
2015-06-17 18:32:05 +02:00
|
|
|
yield ConfigVariable(
|
2013-11-09 23:04:50 +01:00
|
|
|
name='projector_enable_title',
|
|
|
|
default_value=True,
|
2015-06-17 18:32:05 +02:00
|
|
|
input_type='boolean',
|
|
|
|
label=ugettext_lazy('Show title and description of event on projector'),
|
|
|
|
weight=155,
|
|
|
|
group=ugettext_lazy('Projector'))
|
2013-11-09 23:04:50 +01:00
|
|
|
|
2015-06-17 18:32:05 +02:00
|
|
|
yield ConfigVariable(
|
2013-11-09 23:04:50 +01:00
|
|
|
name='projector_backgroundcolor1',
|
|
|
|
default_value='#444444',
|
2015-06-17 18:32:05 +02:00
|
|
|
label=ugettext_lazy('Background color of projector header'),
|
|
|
|
help_text=ugettext_lazy('Use web color names like "red" or hex numbers like "#ff0000".'),
|
|
|
|
weight=160,
|
|
|
|
group=ugettext_lazy('Projector'))
|
2013-11-09 23:04:50 +01:00
|
|
|
|
2015-06-17 18:32:05 +02:00
|
|
|
yield ConfigVariable(
|
2013-11-09 23:04:50 +01:00
|
|
|
name='projector_backgroundcolor2',
|
|
|
|
default_value='#222222',
|
2015-06-17 18:32:05 +02:00
|
|
|
label=ugettext_lazy('Second (optional) background color for linear color gradient'),
|
|
|
|
help_text=ugettext_lazy('Use web color names like "red" or hex numbers like "#ff0000".'),
|
|
|
|
weight=165,
|
|
|
|
group=ugettext_lazy('Projector'))
|
2013-11-09 23:04:50 +01:00
|
|
|
|
2015-06-17 18:32:05 +02:00
|
|
|
yield ConfigVariable(
|
2013-11-09 23:04:50 +01:00
|
|
|
name='projector_fontcolor',
|
|
|
|
default_value='#F5F5F5',
|
2015-06-17 18:32:05 +02:00
|
|
|
label=ugettext_lazy('Font color of projector header'),
|
|
|
|
help_text=ugettext_lazy('Use web color names like "red" or hex numbers like "#ff0000".'),
|
|
|
|
weight=170,
|
|
|
|
group=ugettext_lazy('Projector'))
|
2013-11-09 23:04:50 +01:00
|
|
|
|
2015-06-17 18:32:05 +02:00
|
|
|
yield ConfigVariable(
|
2015-06-16 18:12:59 +02:00
|
|
|
name='projector_welcome_title',
|
2013-03-01 17:13:12 +01:00
|
|
|
default_value=_('Welcome to OpenSlides'),
|
2015-06-17 18:32:05 +02:00
|
|
|
label=ugettext_lazy('Title'),
|
|
|
|
help_text=ugettext_lazy('Also used for the default welcome slide.'),
|
|
|
|
weight=175,
|
|
|
|
group=ugettext_lazy('Projector'),
|
|
|
|
translatable=True)
|
|
|
|
|
|
|
|
yield ConfigVariable(
|
2015-06-16 18:12:59 +02:00
|
|
|
name='projector_welcome_text',
|
2015-06-17 18:32:05 +02:00
|
|
|
default_value=_('[Space for your welcome text.]'),
|
|
|
|
label=ugettext_lazy('Welcome text'),
|
|
|
|
weight=180,
|
|
|
|
group=ugettext_lazy('Projector'),
|
|
|
|
translatable=True)
|