OpenSlides/openslides/core/config_variables.py

430 lines
11 KiB
Python
Raw Normal View History

import uuid
from django.core.validators import MaxLengthValidator
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",
weight=110,
2019-01-06 16:22:33 +01:00
subgroup="Event",
validators=(MaxLengthValidator(100),),
)
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",
weight=115,
2019-01-06 16:22:33 +01:00
subgroup="Event",
validators=(MaxLengthValidator(100),),
)
yield ConfigVariable(
2019-01-06 16:22:33 +01:00
name="general_event_date",
default_value="",
label="Event date",
weight=120,
2019-01-06 16:22:33 +01:00
subgroup="Event",
)
yield ConfigVariable(
2019-01-06 16:22:33 +01:00
name="general_event_location",
default_value="",
label="Event location",
weight=125,
2019-01-06 16:22:33 +01:00
subgroup="Event",
)
yield ConfigVariable(
2019-01-06 16:22:33 +01:00
name="general_event_legal_notice",
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",
2020-06-11 17:23:42 +02:00
weight=131,
2019-01-06 16:22:33 +01:00
subgroup="Event",
2020-06-11 17:23:42 +02:00
hidden=True,
2019-01-06 16:22:33 +01:00
)
yield ConfigVariable(
2019-01-06 16:22:33 +01:00
name="general_event_privacy_policy",
default_value="",
input_type="markupText",
label="Privacy policy",
weight=132,
2019-01-06 16:22:33 +01:00
subgroup="Event",
2020-06-11 17:23:42 +02:00
hidden=True,
2019-01-06 16:22:33 +01: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",
2020-06-11 17:23:42 +02:00
weight=133,
2019-01-06 16:22:33 +01:00
subgroup="Event",
2020-06-11 17:23:42 +02:00
hidden=True,
2019-01-06 16:22:33 +01: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",
2020-06-11 17:23:42 +02:00
weight=134,
2019-01-06 16:22:33 +01:00
subgroup="Event",
2020-06-11 17:23:42 +02:00
hidden=True,
2019-01-06 16:22:33 +01:00
)
2020-06-11 17:23:42 +02:00
# Live conference
2020-04-30 17:39:21 +02:00
yield ConfigVariable(
name="general_system_conference_show",
2020-04-30 17:39:21 +02:00
default_value=False,
input_type="boolean",
label="Show live conference window",
2020-04-30 17:39:21 +02:00
help_text="Server settings required to activate Jitsi Meet integration.",
weight=140,
2020-06-11 17:23:42 +02:00
subgroup="Live conference",
2020-04-30 17:39:21 +02:00
)
yield ConfigVariable(
name="general_system_conference_auto_connect",
default_value=False,
input_type="boolean",
label="Connect all users to live conference automatically",
help_text="Server settings required to activate Jitsi Meet integration.",
weight=141,
2020-06-11 17:23:42 +02:00
subgroup="Live conference",
)
yield ConfigVariable(
name="general_system_conference_los_restriction",
2020-04-30 17:39:21 +02:00
default_value=False,
input_type="boolean",
2020-06-11 17:23:42 +02:00
label="Allow only current speakers and list of speakers managers to enter the live conference",
2020-04-30 17:39:21 +02:00
help_text="Server settings required to activate Jitsi Meet integration.",
weight=142,
2020-06-11 17:23:42 +02:00
subgroup="Live conference",
2020-04-30 17:39:21 +02:00
)
yield ConfigVariable(
name="general_system_stream_url",
default_value="",
2020-06-11 17:23:42 +02:00
label="Livestream url",
help_text="Remove URL to deactivate livestream. Check extra group permission to see livestream.",
weight=143,
2020-06-11 17:23:42 +02:00
subgroup="Live conference",
)
# General System
yield ConfigVariable(
name="general_system_enable_anonymous",
default_value=False,
input_type="boolean",
label="Allow access for anonymous guest users",
weight=150,
subgroup="System",
)
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",
2020-06-11 17:23:42 +02:00
weight=152,
2019-01-06 16:22:33 +01:00
subgroup="System",
)
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"},
{
"value": "openslides-developer-dark-theme",
"display_name": "OpenSlides Developer",
},
),
2020-06-11 17:23:42 +02:00
weight=154,
subgroup="System",
)
2017-07-27 15:17:40 +02:00
# General export settings
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",
weight=160,
2019-01-06 16:22:33 +01:00
subgroup="Export",
)
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"},
),
weight=162,
subgroup="Export",
)
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",
choices=(
2019-01-06 16:22:33 +01:00
{"value": "left", "display_name": "Left"},
{"value": "center", "display_name": "Center"},
{"value": "right", "display_name": "Right"},
),
weight=164,
2019-01-06 16:22:33 +01:00
subgroup="Export",
)
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",
choices=(
2019-01-06 16:22:33 +01:00
{"value": "10", "display_name": "10"},
{"value": "11", "display_name": "11"},
{"value": "12", "display_name": "12"},
),
weight=166,
2019-01-06 16:22:33 +01:00
subgroup="Export",
)
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"},
),
weight=168,
subgroup="Export",
)
# 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-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
# PDF logos
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",
weight=310,
2019-01-06 16:22:33 +01:00
group="Logo",
hidden=True,
)
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",
weight=311,
2019-01-06 16:22:33 +01:00
group="Logo",
hidden=True,
)
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",
weight=312,
2019-01-06 16:22:33 +01:00
group="Logo",
hidden=True,
)
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",
weight=313,
2019-01-06 16:22:33 +01:00
group="Logo",
hidden=True,
)
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",
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",
"font_monospace",
],
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
yield ConfigVariable(
name="font_monospace",
default_value={
"display_name": "Font monospace",
"default": "assets/fonts/roboto-condensed-bold.woff",
"path": "",
},
input_type="static",
weight=321,
group="Font",
hidden=True,
)
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",
)
# Config version and DB id
yield ConfigVariable(
name="config_version",
input_type="integer",
default_value=1,
group="Version",
hidden=True,
)
yield ConfigVariable(
name="db_id",
input_type="string",
default_value=uuid.uuid4().hex,
group="Version",
hidden=True,
)