2019-07-29 15:19:59 +02:00
|
|
|
import uuid
|
|
|
|
|
2016-06-02 12:47:01 +02:00
|
|
|
from django.core.validators import MaxLengthValidator
|
2016-09-17 22:26:23 +02:00
|
|
|
|
2016-06-02 12:47:01 +02:00
|
|
|
from openslides.core.config import ConfigVariable
|
|
|
|
|
|
|
|
|
|
|
|
def get_config_variables():
|
|
|
|
"""
|
|
|
|
Generator which yields all config variables of this app.
|
|
|
|
|
|
|
|
There are two main groups: 'General' and 'Projector'. The group 'General'
|
|
|
|
has subgroups. The generator has to be evaluated during app loading
|
|
|
|
(see apps.py).
|
|
|
|
"""
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="general_event_name",
|
|
|
|
default_value="OpenSlides",
|
|
|
|
label="Event name",
|
2016-06-02 12:47:01 +02:00
|
|
|
weight=110,
|
2019-01-06 16:22:33 +01:00
|
|
|
subgroup="Event",
|
|
|
|
validators=(MaxLengthValidator(100),),
|
|
|
|
)
|
2016-06-02 12:47:01 +02:00
|
|
|
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="general_event_description",
|
|
|
|
default_value="Presentation and assembly system",
|
|
|
|
label="Short description of event",
|
2016-06-02 12:47:01 +02:00
|
|
|
weight=115,
|
2019-01-06 16:22:33 +01:00
|
|
|
subgroup="Event",
|
|
|
|
validators=(MaxLengthValidator(100),),
|
|
|
|
)
|
2016-06-02 12:47:01 +02:00
|
|
|
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="general_event_date",
|
|
|
|
default_value="",
|
|
|
|
label="Event date",
|
2016-06-02 12:47:01 +02:00
|
|
|
weight=120,
|
2019-01-06 16:22:33 +01:00
|
|
|
subgroup="Event",
|
|
|
|
)
|
2016-06-02 12:47:01 +02:00
|
|
|
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="general_event_location",
|
|
|
|
default_value="",
|
|
|
|
label="Event location",
|
2016-06-02 12:47:01 +02:00
|
|
|
weight=125,
|
2019-01-06 16:22:33 +01:00
|
|
|
subgroup="Event",
|
|
|
|
)
|
2016-06-02 12:47:01 +02:00
|
|
|
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="general_event_legal_notice",
|
2016-06-09 16:12:13 +02:00
|
|
|
default_value='<a href="http://www.openslides.org">OpenSlides</a> is a '
|
2019-01-06 16:22:33 +01:00
|
|
|
"free web based presentation and assembly system for "
|
|
|
|
"visualizing and controlling agenda, motions and "
|
|
|
|
"elections of an assembly.",
|
|
|
|
input_type="markupText",
|
|
|
|
label="Legal notice",
|
2016-06-02 12:47:01 +02:00
|
|
|
weight=132,
|
2019-01-06 16:22:33 +01:00
|
|
|
subgroup="Event",
|
|
|
|
)
|
2018-05-22 13:10:01 +02:00
|
|
|
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="general_event_privacy_policy",
|
|
|
|
default_value="",
|
|
|
|
input_type="markupText",
|
|
|
|
label="Privacy policy",
|
2018-05-22 13:10:01 +02:00
|
|
|
weight=132,
|
2019-01-06 16:22:33 +01:00
|
|
|
subgroup="Event",
|
|
|
|
)
|
2016-06-02 12:47:01 +02:00
|
|
|
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="general_event_welcome_title",
|
|
|
|
default_value="Welcome to OpenSlides",
|
|
|
|
label="Front page title",
|
2016-06-02 12:47:01 +02:00
|
|
|
weight=134,
|
2019-01-06 16:22:33 +01:00
|
|
|
subgroup="Event",
|
|
|
|
)
|
2016-06-02 12:47:01 +02:00
|
|
|
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="general_event_welcome_text",
|
|
|
|
default_value="[Space for your welcome text.]",
|
|
|
|
input_type="markupText",
|
|
|
|
label="Front page text",
|
2016-06-02 12:47:01 +02:00
|
|
|
weight=136,
|
2019-01-06 16:22:33 +01:00
|
|
|
subgroup="Event",
|
|
|
|
)
|
2016-06-02 12:47:01 +02:00
|
|
|
|
|
|
|
# General System
|
|
|
|
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="general_system_enable_anonymous",
|
2016-06-02 12:47:01 +02:00
|
|
|
default_value=False,
|
2019-01-06 16:22:33 +01:00
|
|
|
input_type="boolean",
|
|
|
|
label="Allow access for anonymous guest users",
|
2016-06-02 12:47:01 +02:00
|
|
|
weight=138,
|
2019-01-06 16:22:33 +01:00
|
|
|
subgroup="System",
|
|
|
|
)
|
2016-06-02 12:47:01 +02:00
|
|
|
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="general_login_info_text",
|
|
|
|
default_value="",
|
|
|
|
label="Show this text on the login page",
|
2016-06-02 12:47:01 +02:00
|
|
|
weight=140,
|
2019-01-06 16:22:33 +01:00
|
|
|
subgroup="System",
|
|
|
|
)
|
2016-06-02 12:47:01 +02:00
|
|
|
|
2019-01-29 15:20:00 +01:00
|
|
|
yield ConfigVariable(
|
|
|
|
name="openslides_theme",
|
|
|
|
default_value="openslides-theme",
|
|
|
|
input_type="choice",
|
|
|
|
label="OpenSlides Theme",
|
|
|
|
choices=(
|
|
|
|
{"value": "openslides-theme", "display_name": "OpenSlides Default"},
|
|
|
|
{"value": "openslides-dark-theme", "display_name": "OpenSlides Dark"},
|
|
|
|
{"value": "openslides-green-theme", "display_name": "OpenSlides Green"},
|
2019-04-08 10:57:43 +02:00
|
|
|
{
|
|
|
|
"value": "openslides-developer-dark-theme",
|
|
|
|
"display_name": "OpenSlides Developer",
|
|
|
|
},
|
2019-01-29 15:20:00 +01:00
|
|
|
),
|
|
|
|
weight=141,
|
|
|
|
subgroup="System",
|
|
|
|
)
|
|
|
|
|
2020-04-30 11:07:32 +02:00
|
|
|
yield ConfigVariable(
|
|
|
|
name="general_system_conference_auto_connect",
|
|
|
|
default_value=False,
|
|
|
|
input_type="boolean",
|
|
|
|
label="Show the audio conferece integration at the bottom right corner",
|
|
|
|
weight=142,
|
|
|
|
subgroup="System",
|
|
|
|
)
|
|
|
|
|
|
|
|
yield ConfigVariable(
|
|
|
|
name="general_system_conference_show",
|
|
|
|
default_value=False,
|
|
|
|
input_type="boolean",
|
|
|
|
label="Allow users to automatically connect to the audio conference",
|
|
|
|
weight=143,
|
|
|
|
subgroup="System",
|
|
|
|
)
|
|
|
|
|
2017-07-27 15:17:40 +02:00
|
|
|
# General export settings
|
2017-02-07 12:44:51 +01:00
|
|
|
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="general_csv_separator",
|
|
|
|
default_value=",",
|
|
|
|
label="Separator used for all csv exports and examples",
|
2019-07-10 12:57:48 +02:00
|
|
|
weight=160,
|
2019-01-06 16:22:33 +01:00
|
|
|
subgroup="Export",
|
|
|
|
)
|
2017-07-26 15:34:05 +02:00
|
|
|
|
2019-02-07 13:17:54 +01:00
|
|
|
yield ConfigVariable(
|
|
|
|
name="general_csv_encoding",
|
|
|
|
default_value="utf-8",
|
|
|
|
input_type="choice",
|
|
|
|
label="Default encoding for all csv exports",
|
|
|
|
choices=(
|
|
|
|
{"value": "utf-8", "display_name": "UTF-8"},
|
|
|
|
{"value": "iso-8859-15", "display_name": "ISO-8859-15"},
|
|
|
|
),
|
2019-07-10 12:57:48 +02:00
|
|
|
weight=162,
|
2019-02-07 13:17:54 +01:00
|
|
|
subgroup="Export",
|
|
|
|
)
|
|
|
|
|
2017-07-26 15:34:05 +02:00
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="general_export_pdf_pagenumber_alignment",
|
|
|
|
default_value="center",
|
|
|
|
input_type="choice",
|
|
|
|
label="Page number alignment in PDF",
|
2017-07-26 15:34:05 +02:00
|
|
|
choices=(
|
2019-01-06 16:22:33 +01:00
|
|
|
{"value": "left", "display_name": "Left"},
|
|
|
|
{"value": "center", "display_name": "Center"},
|
|
|
|
{"value": "right", "display_name": "Right"},
|
|
|
|
),
|
2019-07-10 12:57:48 +02:00
|
|
|
weight=164,
|
2019-01-06 16:22:33 +01:00
|
|
|
subgroup="Export",
|
|
|
|
)
|
2017-07-26 15:34:05 +02:00
|
|
|
|
2017-07-27 14:20:57 +02:00
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="general_export_pdf_fontsize",
|
|
|
|
default_value="10",
|
|
|
|
input_type="choice",
|
|
|
|
label="Standard font size in PDF",
|
2017-07-27 14:20:57 +02:00
|
|
|
choices=(
|
2019-01-06 16:22:33 +01:00
|
|
|
{"value": "10", "display_name": "10"},
|
|
|
|
{"value": "11", "display_name": "11"},
|
|
|
|
{"value": "12", "display_name": "12"},
|
|
|
|
),
|
2019-07-10 12:57:48 +02:00
|
|
|
weight=166,
|
2019-01-06 16:22:33 +01:00
|
|
|
subgroup="Export",
|
|
|
|
)
|
2017-07-27 14:20:57 +02:00
|
|
|
|
2019-05-20 16:52:36 +02:00
|
|
|
yield ConfigVariable(
|
|
|
|
name="general_export_pdf_pagesize",
|
|
|
|
default_value="A4",
|
|
|
|
input_type="choice",
|
|
|
|
label="Standard page size in PDF",
|
|
|
|
choices=(
|
2019-05-29 09:42:34 +02:00
|
|
|
{"value": "A4", "display_name": "DIN A4"},
|
|
|
|
{"value": "A5", "display_name": "DIN A5"},
|
2019-05-20 16:52:36 +02:00
|
|
|
),
|
2019-07-10 12:57:48 +02:00
|
|
|
weight=168,
|
2019-05-20 16:52:36 +02:00
|
|
|
subgroup="Export",
|
|
|
|
)
|
|
|
|
|
2019-07-10 12:57:48 +02:00
|
|
|
# Logos
|
2017-03-31 13:48:41 +02:00
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="logos_available",
|
2017-04-13 10:23:52 +02:00
|
|
|
default_value=[
|
2019-01-06 16:22:33 +01:00
|
|
|
"logo_projector_main",
|
|
|
|
"logo_projector_header",
|
|
|
|
"logo_web_header",
|
|
|
|
"logo_pdf_header_L",
|
|
|
|
"logo_pdf_header_R",
|
|
|
|
"logo_pdf_footer_L",
|
|
|
|
"logo_pdf_footer_R",
|
|
|
|
"logo_pdf_ballot_paper",
|
|
|
|
],
|
2017-03-31 13:48:41 +02:00
|
|
|
weight=300,
|
2019-01-06 16:22:33 +01:00
|
|
|
group="Logo",
|
|
|
|
hidden=True,
|
|
|
|
)
|
2017-03-31 13:48:41 +02:00
|
|
|
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="logo_projector_main",
|
|
|
|
default_value={"display_name": "Projector logo", "path": ""},
|
|
|
|
input_type="static",
|
2017-03-31 13:48:41 +02:00
|
|
|
weight=301,
|
2019-01-06 16:22:33 +01:00
|
|
|
group="Logo",
|
|
|
|
hidden=True,
|
|
|
|
)
|
2017-04-13 10:23:52 +02:00
|
|
|
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="logo_projector_header",
|
|
|
|
default_value={"display_name": "Projector header image", "path": ""},
|
|
|
|
input_type="static",
|
2017-04-13 10:23:52 +02:00
|
|
|
weight=302,
|
2019-01-06 16:22:33 +01:00
|
|
|
group="Logo",
|
|
|
|
hidden=True,
|
|
|
|
)
|
2017-04-19 14:56:15 +02:00
|
|
|
|
2017-06-22 08:44:59 +02:00
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="logo_web_header",
|
|
|
|
default_value={"display_name": "Web interface header logo", "path": ""},
|
|
|
|
input_type="static",
|
2017-06-22 08:44:59 +02:00
|
|
|
weight=303,
|
2019-01-06 16:22:33 +01:00
|
|
|
group="Logo",
|
|
|
|
hidden=True,
|
|
|
|
)
|
2017-06-22 08:44:59 +02:00
|
|
|
|
2017-04-26 16:09:27 +02:00
|
|
|
# PDF logos
|
2017-04-19 14:56:15 +02:00
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="logo_pdf_header_L",
|
|
|
|
default_value={"display_name": "PDF header logo (left)", "path": ""},
|
|
|
|
input_type="static",
|
2017-04-19 14:56:15 +02:00
|
|
|
weight=310,
|
2019-01-06 16:22:33 +01:00
|
|
|
group="Logo",
|
|
|
|
hidden=True,
|
|
|
|
)
|
2017-04-19 14:56:15 +02:00
|
|
|
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="logo_pdf_header_R",
|
|
|
|
default_value={"display_name": "PDF header logo (right)", "path": ""},
|
|
|
|
input_type="static",
|
2017-04-19 14:56:15 +02:00
|
|
|
weight=311,
|
2019-01-06 16:22:33 +01:00
|
|
|
group="Logo",
|
|
|
|
hidden=True,
|
|
|
|
)
|
2017-06-21 19:32:02 +02:00
|
|
|
|
2018-06-22 14:51:28 +02:00
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="logo_pdf_footer_L",
|
|
|
|
default_value={"display_name": "PDF footer logo (left)", "path": ""},
|
|
|
|
input_type="static",
|
2018-06-22 14:51:28 +02:00
|
|
|
weight=312,
|
2019-01-06 16:22:33 +01:00
|
|
|
group="Logo",
|
|
|
|
hidden=True,
|
|
|
|
)
|
2018-06-22 14:51:28 +02:00
|
|
|
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="logo_pdf_footer_R",
|
|
|
|
default_value={"display_name": "PDF footer logo (right)", "path": ""},
|
|
|
|
input_type="static",
|
2018-06-22 14:51:28 +02:00
|
|
|
weight=313,
|
2019-01-06 16:22:33 +01:00
|
|
|
group="Logo",
|
|
|
|
hidden=True,
|
|
|
|
)
|
2018-06-22 14:51:28 +02:00
|
|
|
|
2017-06-21 19:32:02 +02:00
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="logo_pdf_ballot_paper",
|
|
|
|
default_value={"display_name": "PDF ballot paper logo", "path": ""},
|
|
|
|
input_type="static",
|
2018-06-22 14:51:28 +02:00
|
|
|
weight=314,
|
2019-01-06 16:22:33 +01:00
|
|
|
group="Logo",
|
|
|
|
hidden=True,
|
|
|
|
)
|
2017-08-30 12:17:07 +02:00
|
|
|
|
2018-01-30 16:12:02 +01:00
|
|
|
# Fonts
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="fonts_available",
|
|
|
|
default_value=["font_regular", "font_italic", "font_bold", "font_bold_italic"],
|
2018-01-30 16:12:02 +01:00
|
|
|
weight=320,
|
2019-01-06 16:22:33 +01:00
|
|
|
group="Font",
|
|
|
|
hidden=True,
|
|
|
|
)
|
2018-01-30 16:12:02 +01:00
|
|
|
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="font_regular",
|
2018-01-30 16:12:02 +01:00
|
|
|
default_value={
|
2019-01-06 16:22:33 +01:00
|
|
|
"display_name": "Font regular",
|
2019-01-22 11:59:16 +01:00
|
|
|
"default": "assets/fonts/fira-sans-latin-400.woff",
|
2019-01-06 16:22:33 +01:00
|
|
|
"path": "",
|
|
|
|
},
|
|
|
|
input_type="static",
|
2018-01-30 16:12:02 +01:00
|
|
|
weight=321,
|
2019-01-06 16:22:33 +01:00
|
|
|
group="Font",
|
|
|
|
hidden=True,
|
|
|
|
)
|
2018-01-30 16:12:02 +01:00
|
|
|
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="font_italic",
|
2018-01-30 16:12:02 +01:00
|
|
|
default_value={
|
2019-01-06 16:22:33 +01:00
|
|
|
"display_name": "Font italic",
|
2019-01-22 11:59:16 +01:00
|
|
|
"default": "assets/fonts/fira-sans-latin-400italic.woff",
|
2019-01-06 16:22:33 +01:00
|
|
|
"path": "",
|
|
|
|
},
|
|
|
|
input_type="static",
|
2018-01-30 16:12:02 +01:00
|
|
|
weight=321,
|
2019-01-06 16:22:33 +01:00
|
|
|
group="Font",
|
|
|
|
hidden=True,
|
|
|
|
)
|
2018-01-30 16:12:02 +01:00
|
|
|
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="font_bold",
|
2018-01-30 16:12:02 +01:00
|
|
|
default_value={
|
2019-01-06 16:22:33 +01:00
|
|
|
"display_name": "Font bold",
|
2019-01-22 11:59:16 +01:00
|
|
|
"default": "assets/fonts/fira-sans-latin-500.woff",
|
2019-01-06 16:22:33 +01:00
|
|
|
"path": "",
|
|
|
|
},
|
|
|
|
input_type="static",
|
2018-01-30 16:12:02 +01:00
|
|
|
weight=321,
|
2019-01-06 16:22:33 +01:00
|
|
|
group="Font",
|
|
|
|
hidden=True,
|
|
|
|
)
|
2018-01-30 16:12:02 +01:00
|
|
|
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="font_bold_italic",
|
2018-01-30 16:12:02 +01:00
|
|
|
default_value={
|
2019-01-06 16:22:33 +01:00
|
|
|
"display_name": "Font bold italic",
|
2019-01-22 11:59:16 +01:00
|
|
|
"default": "assets/fonts/fira-sans-latin-500italic.woff",
|
2019-01-06 16:22:33 +01:00
|
|
|
"path": "",
|
|
|
|
},
|
|
|
|
input_type="static",
|
2018-01-30 16:12:02 +01:00
|
|
|
weight=321,
|
2019-01-06 16:22:33 +01:00
|
|
|
group="Font",
|
|
|
|
hidden=True,
|
|
|
|
)
|
2018-01-30 16:12:02 +01:00
|
|
|
|
2017-08-30 12:17:07 +02:00
|
|
|
# Custom translations
|
|
|
|
yield ConfigVariable(
|
2019-01-06 16:22:33 +01:00
|
|
|
name="translations",
|
|
|
|
label="Custom translations",
|
2017-08-30 12:17:07 +02:00
|
|
|
default_value=[],
|
2019-01-06 16:22:33 +01:00
|
|
|
input_type="translations",
|
2017-08-30 12:17:07 +02:00
|
|
|
weight=1000,
|
2019-01-06 16:22:33 +01:00
|
|
|
group="Custom translations",
|
|
|
|
)
|
2019-07-10 15:54:17 +02:00
|
|
|
|
2019-07-29 15:19:59 +02:00
|
|
|
# Config version and DB id
|
2019-07-10 15:54:17 +02:00
|
|
|
yield ConfigVariable(
|
|
|
|
name="config_version",
|
|
|
|
input_type="integer",
|
|
|
|
default_value=1,
|
|
|
|
group="Version",
|
|
|
|
hidden=True,
|
|
|
|
)
|
2019-07-29 15:19:59 +02:00
|
|
|
yield ConfigVariable(
|
|
|
|
name="db_id",
|
|
|
|
input_type="string",
|
|
|
|
default_value=uuid.uuid4().hex,
|
|
|
|
group="Version",
|
|
|
|
hidden=True,
|
|
|
|
)
|