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-29 12:08:15 +02:00
|
|
|
from openslides.core.config 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
|
2015-06-29 12:08:15 +02:00
|
|
|
openslides.core.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-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'))
|
|
|
|
|
2016-01-09 12:51:26 +01:00
|
|
|
yield ConfigVariable(
|
|
|
|
name='general_event_legal_notes',
|
|
|
|
default_value='',
|
|
|
|
input_type='text',
|
|
|
|
label=ugettext_lazy('Legal notes'),
|
|
|
|
weight=132,
|
|
|
|
group=ugettext_lazy('General'),
|
|
|
|
subgroup=ugettext_lazy('Event'))
|
|
|
|
|
2015-06-17 18:32:05 +02:00
|
|
|
# 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
|
|
|
|
2016-01-09 01:10:37 +01:00
|
|
|
yield ConfigVariable(
|
|
|
|
name='general_login_info_text',
|
|
|
|
default_value='',
|
|
|
|
label=ugettext_lazy('Show this text on the login page.'),
|
|
|
|
weight=140,
|
|
|
|
group=ugettext_lazy('General'),
|
|
|
|
subgroup=ugettext_lazy('System'))
|
|
|
|
|
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'),
|
2015-11-06 17:25:25 +01:00
|
|
|
help_text=ugettext_lazy(
|
|
|
|
'You can replace the logo. Just copy a file to '
|
2015-11-29 22:25:01 +01:00
|
|
|
'"static/img/logo-projector.png" in your OpenSlides data path.'),
|
2015-06-17 18:32:05 +02:00
|
|
|
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)
|
2015-06-29 12:08:15 +02:00
|
|
|
|
2015-09-05 14:58:10 +02:00
|
|
|
yield ConfigVariable(
|
|
|
|
name='projector_default_countdown',
|
|
|
|
default_value=60,
|
|
|
|
label=ugettext_lazy('Default countdown'),
|
|
|
|
weight=185,
|
|
|
|
group=ugettext_lazy('Projector'))
|
|
|
|
|
2015-06-29 12:08:15 +02:00
|
|
|
|
|
|
|
config_signal = Signal(providing_args=[])
|
|
|
|
"""Signal to get all config tabs from all apps."""
|