def set_simple_config_view():
    """
    Sets a simple config view with some config variables but without
    grouping.
    """
    yield ConfigVariable(name='additional_config_var', default_value='BaeB0ahcMae3feem')
    yield ConfigVariable(name='additional_config_var_2', default_value='')
    yield ConfigVariable(name='none_config_var', default_value=None)
Exemple #2
0
def set_grouped_config_view():
    """
    Sets a grouped config collection. There are some variables, one variable
    with a string as default value, one with a boolean as default value,
    one with an integer as default value, one with choices and one hidden
    variable. These variables are grouped in two subgroups.
    """
    yield ConfigVariable(
        name="string_var",
        default_value="default_string_rien4ooCZieng6ah",
        group="Config vars for testing 1",
        subgroup="Group 1 aiYeix2mCieQuae3",
    )
    yield ConfigVariable(
        name="bool_var",
        default_value=True,
        input_type="boolean",
        group="Config vars for testing 1",
        subgroup="Group 1 aiYeix2mCieQuae3",
    )
    yield ConfigVariable(
        name="integer_var",
        default_value=3,
        input_type="integer",
        group="Config vars for testing 1",
        subgroup="Group 1 aiYeix2mCieQuae3",
    )

    yield ConfigVariable(
        name="hidden_var",
        default_value="hidden_value",
        group="Config vars for testing 1",
        subgroup="Group 2 Toongai7ahyahy7B",
    )
    yield ConfigVariable(
        name="choices_var",
        default_value="1",
        input_type="choice",
        choices=(
            {
                "value": "1",
                "display_name": "Choice One Ughoch4ocoche6Ee"
            },
            {
                "value": "2",
                "display_name": "Choice Two Vahnoh5yalohv5Eb"
            },
        ),
        group="Config vars for testing 1",
        subgroup="Group 2 Toongai7ahyahy7B",
    )
def set_simple_config_collection_with_callback():
    def callback():
        raise TestConfigException('Change callback dhcnfg34dlg06kdg successfully called.')
    yield ConfigVariable(
        name='var_with_callback_ghvnfjd5768gdfkwg0hm2',
        default_value='',
        on_change=callback)
def get_config_variables():
    """
    Generator which yields all config variables of this app.
    It has to be evaluated during app loading (see apps.py).
    """
    yield ConfigVariable(name='protocol_motion_reason',
                         default_value=True,
                         input_type='boolean',
                         label='Add motion reason in protocol',
                         weight=1300,
                         group='Protocol',
                         subgroup='Motions')
def set_grouped_config_view():
    """
    Sets a grouped config collection. There are some variables, one variable
    with a string as default value, one with a boolean as default value,
    one with an integer as default value, one with choices and one hidden
    variable. These variables are grouped in two subgroups.
    """
    yield ConfigVariable(
        name='string_var',
        default_value='default_string_rien4ooCZieng6ah',
        group='Config vars for testing 1',
        subgroup='Group 1 aiYeix2mCieQuae3')
    yield ConfigVariable(
        name='bool_var',
        default_value=True,
        input_type='boolean',
        group='Config vars for testing 1',
        subgroup='Group 1 aiYeix2mCieQuae3')
    yield ConfigVariable(
        name='integer_var',
        default_value=3,
        input_type='integer',
        group='Config vars for testing 1',
        subgroup='Group 1 aiYeix2mCieQuae3')

    yield ConfigVariable(
        name='hidden_var',
        default_value='hidden_value',
        group='Config vars for testing 1',
        subgroup='Group 2 Toongai7ahyahy7B')
    yield ConfigVariable(
        name='choices_var',
        default_value='1',
        input_type='choice',
        choices=(
            {'value': '1', 'display_name': 'Choice One Ughoch4ocoche6Ee'},
            {'value': '2', 'display_name': 'Choice Two Vahnoh5yalohv5Eb'}),
        group='Config vars for testing 1',
        subgroup='Group 2 Toongai7ahyahy7B')
Exemple #6
0
    def test_default_value_in_data(self):
        """
        Tests, that the default_value attribute is in the 'data' property of
        a ConfigVariable instance.
        """
        config_variable = ConfigVariable('test_variable', 'test_default_value')

        self.assertIn(
            'default_value', config_variable.data,
            "Config_varialbe.data should have a key 'default_value'")
        self.assertEqual(
            config_variable.data['default_value'], 'test_default_value',
            "The value of config_variable.data['default_value'] should be the same "
            "as set as second argument of ConfigVariable()")
Exemple #7
0
def set_simple_config_view_integration_config_test():
    """
    Sets a simple config view with some config variables but without
    grouping.
    """
    yield ConfigVariable(
        name="test_var_aeW3Quahkah1phahCheo",
        default_value=None,
        label="test_label_aeNahsheu8phahk8taYo",
    )

    yield ConfigVariable(name="test_var_Xeiizi7ooH8Thuk5aida",
                         default_value="")

    yield ConfigVariable(name="test_var_ohhii4iavoh5Phoh5ahg",
                         default_value=0,
                         input_type="integer")

    yield ConfigVariable(
        name="test_var_wei0Rei9ahzooSohK1ph",
        default_value="key_1_Queit2juchoocos2Vugh",
        input_type="choice",
        choices=(
            {
                "value": "key_1_Queit2juchoocos2Vugh",
                "display_name": "label_1_Queit2juchoocos2Vugh",
            },
            {
                "value": "key_2_yahb2ain1aeZ1lea1Pei",
                "display_name": "label_2_yahb2ain1aeZ1lea1Pei",
            },
        ),
    )

    yield ConfigVariable(
        name="test_var_Hi7Oje8Oith7goopeeng",
        default_value="",
        validators=(validator_for_testing, ),
    )

    yield ConfigVariable(
        name="test_var_pud2zah2teeNaiP7IoNa",
        default_value=None,
        label="test_label_xaing7eefaePheePhei6",
        hidden=True,
    )
Exemple #8
0
def set_simple_config_view_integration_config_test():
    """
    Sets a simple config view with some config variables but without
    grouping.
    """
    yield ConfigVariable(name='test_var_aeW3Quahkah1phahCheo',
                         default_value=None,
                         label='test_label_aeNahsheu8phahk8taYo')

    yield ConfigVariable(name='test_var_Xeiizi7ooH8Thuk5aida',
                         default_value='')

    yield ConfigVariable(name='test_var_ohhii4iavoh5Phoh5ahg',
                         default_value=0,
                         input_type='integer')

    yield ConfigVariable(name='test_var_wei0Rei9ahzooSohK1ph',
                         default_value='key_1_Queit2juchoocos2Vugh',
                         input_type='choice',
                         choices=({
                             'value':
                             'key_1_Queit2juchoocos2Vugh',
                             'display_name':
                             'label_1_Queit2juchoocos2Vugh'
                         }, {
                             'value':
                             'key_2_yahb2ain1aeZ1lea1Pei',
                             'display_name':
                             'label_2_yahb2ain1aeZ1lea1Pei'
                         }))

    yield ConfigVariable(name='test_var_Hi7Oje8Oith7goopeeng',
                         default_value='',
                         validators=(validator_for_testing, ))

    yield ConfigVariable(name='test_var_pud2zah2teeNaiP7IoNa',
                         default_value=None,
                         label='test_label_xaing7eefaePheePhei6',
                         hidden=True)
def get_config_variables():
    """
    Generator which yields all config variables of this app.

    They are grouped in 'General', 'Amendments', 'Supporters', 'Voting and ballot
    papers' and 'PDF'. The generator has to be evaluated during app loading
    (see apps.py).
    """

    # General
    yield ConfigVariable(
        name="motions_workflow",
        default_value="1",
        input_type="choice",
        label="Workflow of new motions",
        choices=get_workflow_choices,
        weight=310,
        group="Motions",
    )

    yield ConfigVariable(
        name="motions_statute_amendments_workflow",
        default_value="1",
        input_type="choice",
        label="Workflow of new statute amendments",
        choices=get_workflow_choices,
        weight=312,
        group="Motions",
    )

    yield ConfigVariable(
        name="motions_preamble",
        default_value="The assembly may decide:",
        label="Motion preamble",
        weight=320,
        group="Motions",
    )

    yield ConfigVariable(
        name="motions_default_line_numbering",
        default_value="outside",
        input_type="choice",
        label="Default line numbering",
        choices=(
            {
                "value": "outside",
                "display_name": "outside"
            },
            {
                "value": "inline",
                "display_name": "inline"
            },
            {
                "value": "none",
                "display_name": "Disabled"
            },
        ),
        weight=322,
        group="Motions",
    )

    yield ConfigVariable(
        name="motions_line_length",
        default_value=85,
        input_type="integer",
        label="Line length",
        help_text=
        "The maximum number of characters per line. Relevant when line numbering is enabled. Min: 40",
        weight=323,
        group="Motions",
        validators=(MinValueValidator(40), ),
    )

    yield ConfigVariable(
        name="motions_reason_required",
        default_value=False,
        input_type="boolean",
        label="Reason required for creating new motion",
        weight=324,
        group="Motions",
    )

    yield ConfigVariable(
        name="motions_disable_text_on_projector",
        default_value=False,
        input_type="boolean",
        label="Hide motion text on projector",
        weight=325,
        group="Motions",
    )

    yield ConfigVariable(
        name="motions_disable_reason_on_projector",
        default_value=False,
        input_type="boolean",
        label="Hide reason on projector",
        weight=326,
        group="Motions",
    )

    yield ConfigVariable(
        name="motions_disable_recommendation_on_projector",
        default_value=False,
        input_type="boolean",
        label="Hide recommendation on projector",
        weight=327,
        group="Motions",
    )

    yield ConfigVariable(
        name="motions_hide_referring_motions",
        default_value=False,
        input_type="boolean",
        label="Hide referring motions",
        weight=328,
        group="Motions",
    )

    yield ConfigVariable(
        name="motions_disable_sidebox_on_projector",
        default_value=True,
        input_type="boolean",
        label="Show meta information box below the title on projector",
        weight=329,
        group="Motions",
    )

    yield ConfigVariable(
        name="motions_show_sequential_numbers",
        default_value=True,
        input_type="boolean",
        label="Show the sequential number for a motion",
        help_text="In motion list, motion detail and PDF.",
        weight=330,
        group="Motions",
    )

    yield ConfigVariable(
        name="motions_recommendations_by",
        default_value="",
        label="Name of recommender",
        help_text=
        "Will be displayed as label before selected recommendation. Use an empty value to disable the recommendation system.",
        weight=332,
        group="Motions",
    )

    yield ConfigVariable(
        name="motions_statute_recommendations_by",
        default_value="",
        label="Name of recommender for statute amendments",
        help_text=
        "Will be displayed as label before selected recommendation in statute amendments.",
        weight=333,
        group="Motions",
    )

    yield ConfigVariable(
        name="motions_recommendation_text_mode",
        default_value="diff",
        input_type="choice",
        label="Default text version for change recommendations",
        choices=(
            {
                "value": "original",
                "display_name": "Original version"
            },
            {
                "value": "changed",
                "display_name": "Changed version"
            },
            {
                "value": "diff",
                "display_name": "Diff version"
            },
            {
                "value": "agreed",
                "display_name": "Final version"
            },
        ),
        weight=334,
        group="Motions",
    )

    yield ConfigVariable(
        name="motions_motions_sorting",
        default_value="identifier",
        input_type="choice",
        label="Sort motions by",
        choices=(
            {
                "value": "weight",
                "display_name": "Call list"
            },
            {
                "value": "identifier",
                "display_name": "Identifier"
            },
        ),
        weight=335,
        group="Motions",
    )

    # Numbering
    yield ConfigVariable(
        name="motions_identifier",
        default_value="per_category",
        input_type="choice",
        label="Identifier",
        choices=(
            {
                "value": "per_category",
                "display_name": "Numbered per category"
            },
            {
                "value": "serially_numbered",
                "display_name": "Serially numbered"
            },
            {
                "value": "manually",
                "display_name": "Set it manually"
            },
        ),
        weight=340,
        group="Motions",
        subgroup="Numbering",
    )

    yield ConfigVariable(
        name="motions_identifier_min_digits",
        default_value=1,
        input_type="integer",
        label="Number of minimal digits for identifier",
        help_text="Uses leading zeros to sort motions correctly by identifier.",
        weight=342,
        group="Motions",
        subgroup="Numbering",
        validators=(MinValueValidator(1), ),
    )

    yield ConfigVariable(
        name="motions_identifier_with_blank",
        default_value=False,
        input_type="boolean",
        label="Allow blank in identifier",
        help_text="Blank between prefix and number, e.g. 'A 001'.",
        weight=344,
        group="Motions",
        subgroup="Numbering",
    )

    # Amendments

    yield ConfigVariable(
        name="motions_statutes_enabled",
        default_value=False,
        input_type="boolean",
        label="Activate statute amendments",
        weight=350,
        group="Motions",
        subgroup="Amendments",
    )

    yield ConfigVariable(
        name="motions_amendments_enabled",
        default_value=False,
        input_type="boolean",
        label="Activate amendments",
        weight=351,
        group="Motions",
        subgroup="Amendments",
    )

    yield ConfigVariable(
        name="motions_amendments_main_table",
        default_value=True,
        input_type="boolean",
        label="Show amendments together with motions",
        weight=352,
        group="Motions",
        subgroup="Amendments",
    )

    yield ConfigVariable(
        name="motions_amendments_prefix",
        default_value="-",
        label="Prefix for the identifier for amendments",
        weight=353,
        group="Motions",
        subgroup="Amendments",
    )

    yield ConfigVariable(
        name="motions_amendments_text_mode",
        default_value="paragraph",
        input_type="choice",
        label="How to create new amendments",
        choices=(
            {
                "value": "freestyle",
                "display_name": "Empty text field"
            },
            {
                "value": "fulltext",
                "display_name": "Edit the whole motion text"
            },
            {
                "value": "paragraph",
                "display_name": "Paragraph-based, Diff-enabled"
            },
        ),
        weight=354,
        group="Motions",
        subgroup="Amendments",
    )

    yield ConfigVariable(
        name="motions_amendments_multiple_paragraphs",
        default_value=True,
        input_type="boolean",
        label="Amendments can change multiple paragraphs",
        weight=355,
        group="Motions",
        subgroup="Amendments",
    )

    yield ConfigVariable(
        name="motions_amendments_of_amendments",
        default_value=False,
        input_type="boolean",
        label="Allow amendments of amendments",
        weight=356,
        group="Motions",
        subgroup="Amendments",
    )

    # Supporters

    yield ConfigVariable(
        name="motions_min_supporters",
        default_value=0,
        input_type="integer",
        label="Number of (minimum) required supporters for a motion",
        help_text="Choose 0 to disable the supporting system.",
        weight=360,
        group="Motions",
        subgroup="Supporters",
        validators=(MinValueValidator(0), ),
    )

    yield ConfigVariable(
        name="motions_remove_supporters",
        default_value=False,
        input_type="boolean",
        label=
        "Remove all supporters of a motion if a submitter edits his motion in early state",
        weight=361,
        group="Motions",
        subgroup="Supporters",
    )

    # Voting and ballot papers

    yield ConfigVariable(
        name="motion_poll_default_100_percent_base",
        default_value="YNA",
        input_type="choice",
        label="Default 100 % base of a voting result",
        choices=tuple({
            "value": base[0],
            "display_name": base[1]
        } for base in MotionPoll.PERCENT_BASES),
        weight=370,
        group="Motions",
        subgroup="Voting and ballot papers",
    )

    yield ConfigVariable(
        name="motion_poll_default_majority_method",
        default_value="simple",
        input_type="choice",
        choices=tuple({
            "value": method[0],
            "display_name": method[1]
        } for method in MotionPoll.MAJORITY_METHODS),
        label="Required majority",
        help_text=
        "Default method to check whether a motion has reached the required majority.",
        weight=371,
        hidden=True,
        group="Motions",
        subgroup="Voting and ballot papers",
    )

    yield ConfigVariable(
        name="motion_poll_default_groups",
        default_value=[],
        input_type="groups",
        label="Default groups with voting rights",
        weight=372,
        group="Motions",
        subgroup="Voting and ballot papers",
    )

    yield ConfigVariable(
        name="motions_pdf_ballot_papers_selection",
        default_value="CUSTOM_NUMBER",
        input_type="choice",
        label="Number of ballot papers",
        choices=(
            {
                "value": "NUMBER_OF_DELEGATES",
                "display_name": "Number of all delegates"
            },
            {
                "value": "NUMBER_OF_ALL_PARTICIPANTS",
                "display_name": "Number of all participants",
            },
            {
                "value": "CUSTOM_NUMBER",
                "display_name": "Use the following custom number",
            },
        ),
        weight=373,
        group="Motions",
        subgroup="Voting and ballot papers",
    )

    yield ConfigVariable(
        name="motions_pdf_ballot_papers_number",
        default_value=8,
        input_type="integer",
        label="Custom number of ballot papers",
        weight=374,
        group="Motions",
        subgroup="Voting and ballot papers",
        validators=(MinValueValidator(1), ),
    )

    # PDF export

    yield ConfigVariable(
        name="motions_export_title",
        default_value="Motions",
        label="Title for PDF documents of motions",
        weight=380,
        group="Motions",
        subgroup="PDF export",
    )

    yield ConfigVariable(
        name="motions_export_preamble",
        default_value="",
        label="Preamble text for PDF documents of motions",
        weight=382,
        group="Motions",
        subgroup="PDF export",
    )

    yield ConfigVariable(
        name="motions_export_submitter_recommendation",
        default_value=False,
        label="Show submitters and recommendation/state in table of contents",
        input_type="boolean",
        weight=384,
        group="Motions",
        subgroup="PDF export",
    )

    yield ConfigVariable(
        name="motions_export_follow_recommendation",
        default_value=False,
        label="Show checkbox to record decision",
        input_type="boolean",
        weight=386,
        group="Motions",
        subgroup="PDF export",
    )
def get_config_variables():
    """
    Generator which yields all config variables of this app.

    They are grouped in 'Ballot and ballot papers' and 'PDF'. The generator has
    to be evaluated during app loading (see apps.py).
    """
    # Ballot and ballot papers
    yield ConfigVariable(name='assignments_poll_vote_values',
                         default_value='auto',
                         input_type='choice',
                         label='Election method',
                         choices=({
                             'value': 'auto',
                             'display_name': 'Automatic assign of method'
                         }, {
                             'value':
                             'votes',
                             'display_name':
                             'Always one option per candidate'
                         }, {
                             'value':
                             'yesnoabstain',
                             'display_name':
                             'Always Yes-No-Abstain per candidate'
                         }, {
                             'value': 'yesno',
                             'display_name': 'Always Yes/No per candidate'
                         }),
                         weight=410,
                         group='Elections',
                         subgroup='Ballot and ballot papers')

    yield ConfigVariable(
        name='assignments_poll_100_percent_base',
        default_value='YES_NO_ABSTAIN',
        input_type='choice',
        label='The 100-%-base of an election result consists of',
        choices=({
            'value': 'YES_NO_ABSTAIN',
            'display_name': 'Yes/No/Abstain per candidate'
        }, {
            'value': 'YES_NO',
            'display_name': 'Yes/No per candidate'
        }, {
            'value': 'VALID',
            'display_name': 'All valid ballots'
        }, {
            'value': 'CAST',
            'display_name': 'All casted ballots'
        }, {
            'value': 'DISABLED',
            'display_name': 'Disabled (no percents)'
        }),
        help_text=
        ('For Yes/No/Abstain per candidate and Yes/No per candidate the 100-%-base '
         'depends on the election method: If there is only one option per candidate, '
         'the sum of all votes of all candidates is 100 %. Otherwise for each '
         'candidate the sum of all votes is 100 %.'),
        weight=420,
        group='Elections',
        subgroup='Ballot and ballot papers')

    # TODO: Add server side validation of the choices.
    yield ConfigVariable(
        name='assignments_poll_default_majority_method',
        default_value=majorityMethods[0]['value'],
        input_type='choice',
        choices=majorityMethods,
        label='Required majority',
        help_text=
        'Default method to check whether a candidate has reached the required majority.',
        weight=425,
        group='Elections',
        subgroup='Ballot and ballot papers')

    yield ConfigVariable(name='assignments_add_candidates_to_list_of_speakers',
                         default_value=True,
                         input_type='boolean',
                         label='Put all candidates on the list of speakers',
                         weight=428,
                         group='Elections',
                         subgroup='Ballot and ballot papers')

    yield ConfigVariable(name='assignments_pdf_ballot_papers_selection',
                         default_value='CUSTOM_NUMBER',
                         input_type='choice',
                         label='Number of ballot papers (selection)',
                         choices=({
                             'value': 'NUMBER_OF_DELEGATES',
                             'display_name': 'Number of all delegates'
                         }, {
                             'value': 'NUMBER_OF_ALL_PARTICIPANTS',
                             'display_name': 'Number of all participants'
                         }, {
                             'value':
                             'CUSTOM_NUMBER',
                             'display_name':
                             'Use the following custom number'
                         }),
                         weight=430,
                         group='Elections',
                         subgroup='Ballot and ballot papers')

    yield ConfigVariable(name='assignments_pdf_ballot_papers_number',
                         default_value=8,
                         input_type='integer',
                         label='Custom number of ballot papers',
                         weight=440,
                         group='Elections',
                         subgroup='Ballot and ballot papers',
                         validators=(MinValueValidator(1), ))

    # PDF

    yield ConfigVariable(name='assignments_pdf_title',
                         default_value='Elections',
                         label='Title for PDF document (all elections)',
                         weight=460,
                         group='Elections',
                         subgroup='PDF')

    yield ConfigVariable(
        name='assignments_pdf_preamble',
        default_value='',
        label='Preamble text for PDF document (all elections)',
        weight=470,
        group='Elections',
        subgroup='PDF')
Exemple #11
0
def get_config_variables():
    """
    Generator which yields all config variables of this app.

    It has to be evaluated during app loading (see apps.py).
    """
    yield ConfigVariable(name='agenda_enable_numbering',
                         label='Enable numbering for agenda items',
                         input_type='boolean',
                         default_value=True,
                         weight=200,
                         group='Agenda',
                         subgroup='General')

    yield ConfigVariable(
        name='agenda_number_prefix',
        default_value='',
        label='Numbering prefix for agenda items',
        help_text=
        'This prefix will be set if you run the automatic agenda numbering.',
        weight=210,
        group='Agenda',
        subgroup='General',
        validators=(MaxLengthValidator(20), ))

    yield ConfigVariable(name='agenda_numeral_system',
                         default_value='arabic',
                         input_type='choice',
                         label='Numeral system for agenda items',
                         choices=({
                             'value': 'arabic',
                             'display_name': 'Arabic'
                         }, {
                             'value': 'roman',
                             'display_name': 'Roman'
                         }),
                         weight=215,
                         group='Agenda',
                         subgroup='General')

    yield ConfigVariable(name='agenda_start_event_date_time',
                         default_value=None,
                         input_type='datetimepicker',
                         label='Begin of event',
                         help_text='Input format: DD.MM.YYYY HH:MM',
                         weight=220,
                         group='Agenda',
                         subgroup='General')

    yield ConfigVariable(name='agenda_hide_internal_items_on_projector',
                         default_value=True,
                         input_type='boolean',
                         label='Hide internal items when projecting subitems',
                         weight=225,
                         group='Agenda',
                         subgroup='General')

    yield ConfigVariable(
        name='agenda_new_items_default_visibility',
        default_value='2',
        input_type='choice',
        choices=({
            'value': '1',
            'display_name': 'Public item'
        }, {
            'value': '2',
            'display_name': 'Internal item'
        }, {
            'value': '3',
            'display_name': 'Hidden item'
        }),
        label='Default visibility for new agenda items (except topics)',
        weight=227,
        group='Agenda',
        subgroup='General')

    # List of speakers

    yield ConfigVariable(
        name='agenda_show_last_speakers',
        default_value=1,
        input_type='integer',
        label='Number of last speakers to be shown on the projector',
        weight=230,
        group='Agenda',
        subgroup='List of speakers',
        validators=(MinValueValidator(0), ))

    yield ConfigVariable(
        name='agenda_countdown_warning_time',
        default_value=0,
        input_type='integer',
        label='Show orange countdown in the last x seconds of speaking time',
        help_text=
        'Enter duration in seconds. Choose 0 to disable warning color.',
        weight=235,
        group='Agenda',
        subgroup='List of speakers',
        validators=(MinValueValidator(0), ))

    yield ConfigVariable(
        name='agenda_couple_countdown_and_speakers',
        default_value=False,
        input_type='boolean',
        label='Couple countdown with the list of speakers',
        help_text=
        '[Begin speech] starts the countdown, [End speech] stops the countdown.',
        weight=240,
        group='Agenda',
        subgroup='List of speakers')
Exemple #12
0
def get_config_variables():
    """
    Generator which yields all config variables of this app.

    They are grouped in 'Ballot and ballot papers' and 'PDF'. The generator has
    to be evaluated during app loading (see apps.py).
    """
    # Ballot and ballot papers
    yield ConfigVariable(
        name="assignments_poll_vote_values",
        default_value="auto",
        input_type="choice",
        label="Election method",
        choices=(
            {
                "value": "auto",
                "display_name": "Automatic assign of method"
            },
            {
                "value": "votes",
                "display_name": "Always one option per candidate"
            },
            {
                "value": "yesnoabstain",
                "display_name": "Always Yes-No-Abstain per candidate",
            },
            {
                "value": "yesno",
                "display_name": "Always Yes/No per candidate"
            },
        ),
        weight=410,
        group="Elections",
        subgroup="Ballot and ballot papers",
    )

    yield ConfigVariable(
        name="assignments_poll_100_percent_base",
        default_value="YES_NO_ABSTAIN",
        input_type="choice",
        label="The 100-%-base of an election result consists of",
        choices=(
            {
                "value": "YES_NO_ABSTAIN",
                "display_name": "Yes/No/Abstain per candidate"
            },
            {
                "value": "YES_NO",
                "display_name": "Yes/No per candidate"
            },
            {
                "value": "VALID",
                "display_name": "All valid ballots"
            },
            {
                "value": "CAST",
                "display_name": "All casted ballots"
            },
            {
                "value": "DISABLED",
                "display_name": "Disabled (no percents)"
            },
        ),
        help_text=
        ("For Yes/No/Abstain per candidate and Yes/No per candidate the 100-%-base "
         "depends on the election method: If there is only one option per candidate, "
         "the sum of all votes of all candidates is 100 %. Otherwise for each "
         "candidate the sum of all votes is 100 %."),
        weight=420,
        group="Elections",
        subgroup="Ballot and ballot papers",
    )

    # TODO: Add server side validation of the choices.
    yield ConfigVariable(
        name="assignments_poll_default_majority_method",
        default_value=majorityMethods[0]["value"],
        input_type="choice",
        choices=majorityMethods,
        label="Required majority",
        help_text=
        "Default method to check whether a candidate has reached the required majority.",
        weight=425,
        group="Elections",
        subgroup="Ballot and ballot papers",
    )

    yield ConfigVariable(
        name="assignments_pdf_ballot_papers_selection",
        default_value="CUSTOM_NUMBER",
        input_type="choice",
        label="Number of ballot papers (selection)",
        choices=(
            {
                "value": "NUMBER_OF_DELEGATES",
                "display_name": "Number of all delegates"
            },
            {
                "value": "NUMBER_OF_ALL_PARTICIPANTS",
                "display_name": "Number of all participants",
            },
            {
                "value": "CUSTOM_NUMBER",
                "display_name": "Use the following custom number",
            },
        ),
        weight=430,
        group="Elections",
        subgroup="Ballot and ballot papers",
    )

    yield ConfigVariable(
        name="assignments_pdf_ballot_papers_number",
        default_value=8,
        input_type="integer",
        label="Custom number of ballot papers",
        weight=435,
        group="Elections",
        subgroup="Ballot and ballot papers",
        validators=(MinValueValidator(1), ),
    )

    yield ConfigVariable(
        name="assignments_add_candidates_to_list_of_speakers",
        default_value=True,
        input_type="boolean",
        label="Put all candidates on the list of speakers",
        weight=440,
        group="Elections",
        subgroup="Ballot and ballot papers",
    )

    # PDF

    yield ConfigVariable(
        name="assignments_pdf_title",
        default_value="Elections",
        label="Title for PDF document (all elections)",
        weight=460,
        group="Elections",
        subgroup="PDF export",
    )

    yield ConfigVariable(
        name="assignments_pdf_preamble",
        default_value="",
        label="Preamble text for PDF document (all elections)",
        weight=470,
        group="Elections",
        subgroup="PDF export",
    )
Exemple #13
0
def get_config_variables():
    """
    Generator which yields all config variables of this app.

    They are grouped in 'General', 'Amendments', 'Supporters', 'Voting and ballot
    papers' and 'PDF'. The generator has to be evaluated during app loading
    (see apps.py).
    """

    # General
    yield ConfigVariable(
        name="motions_workflow",
        default_value="1",
        input_type="choice",
        label="Workflow of new motions",
        choices=get_workflow_choices,
        weight=310,
        group="Motions",
        subgroup="General",
    )

    yield ConfigVariable(
        name="motions_statute_amendments_workflow",
        default_value="1",
        input_type="choice",
        label="Workflow of new statute amendments",
        choices=get_workflow_choices,
        weight=312,
        group="Motions",
        subgroup="General",
    )

    yield ConfigVariable(
        name="motions_identifier",
        default_value="per_category",
        input_type="choice",
        label="Identifier",
        choices=(
            {
                "value": "per_category",
                "display_name": "Numbered per category"
            },
            {
                "value": "serially_numbered",
                "display_name": "Serially numbered"
            },
            {
                "value": "manually",
                "display_name": "Set it manually"
            },
        ),
        weight=315,
        group="Motions",
        subgroup="General",
    )

    yield ConfigVariable(
        name="motions_preamble",
        default_value="The assembly may decide:",
        label="Motion preamble",
        weight=320,
        group="Motions",
        subgroup="General",
    )

    yield ConfigVariable(
        name="motions_default_line_numbering",
        default_value="none",
        input_type="choice",
        label="Default line numbering",
        choices=(
            {
                "value": "outside",
                "display_name": "outside"
            },
            {
                "value": "inline",
                "display_name": "inline"
            },
            {
                "value": "none",
                "display_name": "Disabled"
            },
        ),
        weight=322,
        group="Motions",
        subgroup="General",
    )

    yield ConfigVariable(
        name="motions_line_length",
        default_value=90,
        input_type="integer",
        label="Line length",
        help_text=
        "The maximum number of characters per line. Relevant when line numbering is enabled. Min: 40",
        weight=323,
        group="Motions",
        subgroup="General",
        validators=(MinValueValidator(40), ),
    )

    yield ConfigVariable(
        name="motions_reason_required",
        default_value=False,
        input_type="boolean",
        label="Reason required for creating new motion",
        weight=324,
        group="Motions",
        subgroup="General",
    )

    yield ConfigVariable(
        name="motions_disable_reason_on_projector",
        default_value=False,
        input_type="boolean",
        label="Hide reason on projector",
        weight=325,
        group="Motions",
        subgroup="General",
    )

    yield ConfigVariable(
        name="motions_disable_sidebox_on_projector",
        default_value=False,
        input_type="boolean",
        label="Hide meta information box on projector",
        weight=326,
        group="Motions",
        subgroup="General",
    )

    yield ConfigVariable(
        name="motions_disable_recommendation_on_projector",
        default_value=False,
        input_type="boolean",
        label="Hide recommendation on projector",
        weight=327,
        group="Motions",
        subgroup="General",
    )

    yield ConfigVariable(
        name="motions_recommendations_by",
        default_value="",
        label="Name of recommender",
        help_text=
        "Will be displayed as label before selected recommendation. Use an empty value to disable the recommendation system.",
        weight=332,
        group="Motions",
        subgroup="General",
    )

    yield ConfigVariable(
        name="motions_statute_recommendations_by",
        default_value="",
        label="Name of recommender for statute amendments",
        help_text=
        "Will be displayed as label before selected recommendation in statute amendments. "
        +
        "Use an empty value to disable the recommendation system for statute amendments.",
        weight=333,
        group="Motions",
        subgroup="General",
    )

    yield ConfigVariable(
        name="motions_recommendation_text_mode",
        default_value="original",
        input_type="choice",
        label="Default text version for change recommendations",
        choices=(
            {
                "value": "original",
                "display_name": "Original version"
            },
            {
                "value": "changed",
                "display_name": "Changed version"
            },
            {
                "value": "diff",
                "display_name": "Diff version"
            },
            {
                "value": "agreed",
                "display_name": "Final version"
            },
        ),
        weight=334,
        group="Motions",
        subgroup="General",
    )

    yield ConfigVariable(
        name="motions_category_sorting",
        default_value="prefix",
        input_type="choice",
        label="Sort categories by",
        choices=(
            {
                "value": "prefix",
                "display_name": "Prefix"
            },
            {
                "value": "name",
                "display_name": "Name"
            },
        ),
        weight=335,
        group="Motions",
        subgroup="General",
    )

    yield ConfigVariable(
        name="motions_motions_sorting",
        default_value="identifier",
        input_type="choice",
        label="Sort motions by",
        choices=(
            {
                "value": "callListWeight",
                "display_name": "Call list"
            },
            {
                "value": "identifier",
                "display_name": "Identifier"
            },
        ),
        weight=335,
        group="Motions",
        subgroup="General",
    )

    # Amendments

    yield ConfigVariable(
        name="motions_statutes_enabled",
        default_value=False,
        input_type="boolean",
        label="Activate statute amendments",
        weight=338,
        group="Motions",
        subgroup="Amendments",
    )

    yield ConfigVariable(
        name="motions_amendments_enabled",
        default_value=False,
        input_type="boolean",
        label="Activate amendments",
        weight=339,
        group="Motions",
        subgroup="Amendments",
    )

    yield ConfigVariable(
        name="motions_amendments_main_table",
        default_value=False,
        input_type="boolean",
        label="Show amendments together with motions",
        weight=340,
        group="Motions",
        subgroup="Amendments",
    )

    yield ConfigVariable(
        name="motions_amendments_prefix",
        default_value="-",
        label="Prefix for the identifier for amendments",
        weight=341,
        group="Motions",
        subgroup="Amendments",
    )

    yield ConfigVariable(
        name="motions_amendments_text_mode",
        default_value="freestyle",
        input_type="choice",
        label="How to create new amendments",
        choices=(
            {
                "value": "freestyle",
                "display_name": "Empty text field"
            },
            {
                "value": "fulltext",
                "display_name": "Edit the whole motion text"
            },
            {
                "value": "paragraph",
                "display_name": "Paragraph-based, Diff-enabled"
            },
        ),
        weight=342,
        group="Motions",
        subgroup="Amendments",
    )

    # Supporters

    yield ConfigVariable(
        name="motions_min_supporters",
        default_value=0,
        input_type="integer",
        label="Number of (minimum) required supporters for a motion",
        help_text="Choose 0 to disable the supporting system.",
        weight=345,
        group="Motions",
        subgroup="Supporters",
        validators=(MinValueValidator(0), ),
    )

    yield ConfigVariable(
        name="motions_remove_supporters",
        default_value=False,
        input_type="boolean",
        label=
        "Remove all supporters of a motion if a submitter edits his motion in early state",
        weight=350,
        group="Motions",
        subgroup="Supporters",
    )

    # Voting and ballot papers

    yield ConfigVariable(
        name="motions_poll_100_percent_base",
        default_value="YES_NO_ABSTAIN",
        input_type="choice",
        label="The 100 % base of a voting result consists of",
        choices=(
            {
                "value": "YES_NO_ABSTAIN",
                "display_name": "Yes/No/Abstain"
            },
            {
                "value": "YES_NO",
                "display_name": "Yes/No"
            },
            {
                "value": "VALID",
                "display_name": "All valid ballots"
            },
            {
                "value": "CAST",
                "display_name": "All casted ballots"
            },
            {
                "value": "DISABLED",
                "display_name": "Disabled (no percents)"
            },
        ),
        weight=355,
        group="Motions",
        subgroup="Voting and ballot papers",
    )

    # TODO: Add server side validation of the choices.
    yield ConfigVariable(
        name="motions_poll_default_majority_method",
        default_value=majorityMethods[0]["value"],
        input_type="choice",
        choices=majorityMethods,
        label="Required majority",
        help_text=
        "Default method to check whether a motion has reached the required majority.",
        weight=357,
        group="Motions",
        subgroup="Voting and ballot papers",
    )

    yield ConfigVariable(
        name="motions_pdf_ballot_papers_selection",
        default_value="CUSTOM_NUMBER",
        input_type="choice",
        label="Number of ballot papers (selection)",
        choices=(
            {
                "value": "NUMBER_OF_DELEGATES",
                "display_name": "Number of all delegates"
            },
            {
                "value": "NUMBER_OF_ALL_PARTICIPANTS",
                "display_name": "Number of all participants",
            },
            {
                "value": "CUSTOM_NUMBER",
                "display_name": "Use the following custom number",
            },
        ),
        weight=360,
        group="Motions",
        subgroup="Voting and ballot papers",
    )

    yield ConfigVariable(
        name="motions_pdf_ballot_papers_number",
        default_value=8,
        input_type="integer",
        label="Custom number of ballot papers",
        weight=365,
        group="Motions",
        subgroup="Voting and ballot papers",
        validators=(MinValueValidator(1), ),
    )

    # PDF and DOCX export

    yield ConfigVariable(
        name="motions_export_title",
        default_value="Motions",
        label="Title for PDF and DOCX documents (all motions)",
        weight=370,
        group="Motions",
        subgroup="Export",
    )

    yield ConfigVariable(
        name="motions_export_preamble",
        default_value="",
        label="Preamble text for PDF and DOCX documents (all motions)",
        weight=375,
        group="Motions",
        subgroup="Export",
    )
Exemple #14
0
def get_config_variables():
    """
    Generator which yields all config variables of this app.
    They are grouped in 'Ballot and ballot papers' and 'PDF'. The generator has
    to be evaluated during app loading (see apps.py).
    """
    # Voting
    yield ConfigVariable(
        name="assignment_poll_method",
        default_value=AssignmentPoll.POLLMETHOD_Y,
        input_type="choice",
        label="Default election method",
        choices=tuple({
            "value": method[0],
            "display_name": method[1]
        } for method in AssignmentPoll.POLLMETHODS),
        weight=400,
        group="Elections",
        subgroup="Ballot",
    )

    if getattr(settings, "ENABLE_ELECTRONIC_VOTING", False):
        assignment_poll_type_choices = tuple({
            "value": type[0],
            "display_name": type[1]
        } for type in AssignmentPoll.TYPES)
    else:
        assignment_poll_type_choices = ({
            "value":
            AssignmentPoll.TYPE_ANALOG,
            "display_name":
            AssignmentPoll.TYPE_ANALOG,
        }, )

    yield ConfigVariable(
        name="assignment_poll_default_type",
        default_value=AssignmentPoll.TYPE_ANALOG,
        input_type="choice",
        label="Default voting type",
        choices=assignment_poll_type_choices,
        weight=403,
        group="Elections",
        subgroup="Ballot",
    )

    yield ConfigVariable(
        name="assignment_poll_default_100_percent_base",
        default_value=AssignmentPoll.PERCENT_BASE_VALID,
        input_type="choice",
        label="Default 100 % base of an election result",
        choices=tuple({
            "value": base[0],
            "display_name": base[1]
        } for base in AssignmentPoll.PERCENT_BASES),
        weight=405,
        group="Elections",
        subgroup="Ballot",
    )

    yield ConfigVariable(
        name="assignment_poll_default_groups",
        default_value=[],
        input_type="groups",
        label="Default groups with voting rights",
        weight=410,
        group="Elections",
        subgroup="Ballot",
    )

    yield ConfigVariable(
        name="assignment_poll_default_majority_method",
        default_value=AssignmentPoll.MAJORITY_SIMPLE,
        input_type="choice",
        choices=tuple({
            "value": method[0],
            "display_name": method[1]
        } for method in AssignmentPoll.MAJORITY_METHODS),
        label="Required majority",
        help_text=
        "Default method to check whether a candidate has reached the required majority.",
        weight=415,
        hidden=True,
        group="Elections",
        subgroup="Ballot",
    )

    yield ConfigVariable(
        name="assignment_poll_sort_poll_result_by_votes",
        default_value=True,
        input_type="boolean",
        label="Sort election results by amount of votes",
        weight=420,
        group="Elections",
        subgroup="Ballot",
    )

    yield ConfigVariable(
        name="assignment_poll_add_candidates_to_list_of_speakers",
        default_value=True,
        input_type="boolean",
        label="Put all candidates on the list of speakers",
        weight=425,
        group="Elections",
        subgroup="Ballot",
    )

    # Ballot Paper
    yield ConfigVariable(
        name="assignments_pdf_ballot_papers_selection",
        default_value="CUSTOM_NUMBER",
        input_type="choice",
        label="Number of ballot papers",
        choices=(
            {
                "value": "NUMBER_OF_DELEGATES",
                "display_name": "Number of all delegates"
            },
            {
                "value": "NUMBER_OF_ALL_PARTICIPANTS",
                "display_name": "Number of all participants",
            },
            {
                "value": "CUSTOM_NUMBER",
                "display_name": "Use the following custom number",
            },
        ),
        weight=430,
        group="Elections",
        subgroup="Ballot papers",
    )

    yield ConfigVariable(
        name="assignments_pdf_ballot_papers_number",
        default_value=8,
        input_type="integer",
        label="Custom number of ballot papers",
        weight=435,
        group="Elections",
        subgroup="Ballot papers",
        validators=(MinValueValidator(1), ),
    )

    # PDF
    yield ConfigVariable(
        name="assignments_pdf_title",
        default_value="Elections",
        label="Title for PDF document (all elections)",
        weight=460,
        group="Elections",
        subgroup="PDF export",
    )

    yield ConfigVariable(
        name="assignments_pdf_preamble",
        default_value="",
        label="Preamble text for PDF document (all elections)",
        weight=470,
        group="Elections",
        subgroup="PDF export",
    )
def set_simple_config_collection_disabled_view():
    yield ConfigVariable(name='hidden_config_var_2', default_value='')
Exemple #16
0
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(
        name="general_event_name",
        default_value="OpenSlides",
        label="Event name",
        weight=110,
        subgroup="Event",
        validators=(MaxLengthValidator(100), ),
    )

    yield ConfigVariable(
        name="general_event_description",
        default_value="Presentation and assembly system",
        label="Short description of event",
        weight=115,
        subgroup="Event",
        validators=(MaxLengthValidator(100), ),
    )

    yield ConfigVariable(
        name="general_event_date",
        default_value="",
        label="Event date",
        weight=120,
        subgroup="Event",
    )

    yield ConfigVariable(
        name="general_event_location",
        default_value="",
        label="Event location",
        weight=125,
        subgroup="Event",
    )

    yield ConfigVariable(
        name="general_event_legal_notice",
        default_value='<a href="http://www.openslides.org">OpenSlides</a> is a '
        "free web based presentation and assembly system for "
        "visualizing and controlling agenda, motions and "
        "elections of an assembly.",
        input_type="markupText",
        label="Legal notice",
        weight=131,
        subgroup="Event",
        hidden=True,
    )

    yield ConfigVariable(
        name="general_event_privacy_policy",
        default_value="",
        input_type="markupText",
        label="Privacy policy",
        weight=132,
        subgroup="Event",
        hidden=True,
    )

    yield ConfigVariable(
        name="general_event_welcome_title",
        default_value="Welcome to OpenSlides",
        label="Front page title",
        weight=133,
        subgroup="Event",
        hidden=True,
    )

    yield ConfigVariable(
        name="general_event_welcome_text",
        default_value="[Space for your welcome text.]",
        input_type="markupText",
        label="Front page text",
        weight=134,
        subgroup="Event",
        hidden=True,
    )

    # Live conference

    yield ConfigVariable(
        name="general_system_conference_show",
        default_value=False,
        input_type="boolean",
        label="Show live conference window",
        help_text=
        "Server settings required to activate Jitsi Meet integration.",
        weight=140,
        subgroup="Live conference",
    )

    yield ConfigVariable(
        name="general_system_conference_los_restriction",
        default_value=False,
        input_type="boolean",
        label=
        "Allow only current speakers and list of speakers managers to enter the live conference",
        help_text=
        "Server settings required to activate Jitsi Meet integration.",
        weight=141,
        subgroup="Live conference",
    )

    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=142,
        subgroup="Live conference",
    )

    yield ConfigVariable(
        name="general_system_conference_open_microphone",
        default_value=False,
        input_type="boolean",
        label="Automatically open the microphone for new conference speakers",
        help_text=
        "Server settings required to activate Jitsi Meet integration.",
        weight=143,
        subgroup="Live conference",
    )

    yield ConfigVariable(
        name="general_system_conference_open_video",
        default_value=False,
        input_type="boolean",
        label="Automatically open the web cam for new conference speakers",
        help_text=
        "Server settings required to activate Jitsi Meet integration.",
        weight=144,
        subgroup="Live conference",
    )

    yield ConfigVariable(
        name="general_system_conference_auto_connect_next_speakers",
        default_value=0,
        input_type="integer",
        label=
        "Number of next speakers automatically connecting to the live conference",
        help_text=
        "Live conference has to be active. Choose 0 to disable auto connect.",
        weight=145,
        subgroup="Live conference",
    )

    yield ConfigVariable(
        name="general_system_stream_url",
        default_value="",
        label="Livestream url",
        help_text=
        "Remove URL to deactivate livestream. Check extra group permission to see livestream.",
        weight=146,
        subgroup="Live conference",
    )

    yield ConfigVariable(
        name="general_system_stream_poster",
        default_value="",
        label="Livestream poster image url",
        help_text=
        "Shows if livestream is not started. Recommended image format: 500x280px, PNG or JPG",
        weight=147,
        subgroup="Live conference",
    )

    yield ConfigVariable(
        name="general_system_conference_enable_helpdesk",
        default_value=False,
        input_type="boolean",
        label="Enable virtual help desk room",
        help_text="""
            Shows a button with help icon to connect to an extra Jitsi conference room for technical audio/video tests.
        """,
        weight=148,
        subgroup="Live conference",
    )

    # Applause

    yield ConfigVariable(
        name="general_system_applause_enable",
        default_value=False,
        input_type="boolean",
        label="Enable virtual applause",
        weight=150,
        subgroup="Virtual applause",
    )

    yield ConfigVariable(
        name="general_system_applause_type",
        default_value="applause-type-bar",
        input_type="choice",
        choices=(
            {
                "value": "applause-type-bar",
                "display_name": "Level indicator",
            },
            {
                "value": "applause-type-particles",
                "display_name": "Particles",
            },
        ),
        label="Applause visualization",
        weight=151,
        subgroup="Virtual applause",
    )

    yield ConfigVariable(
        name="general_system_applause_show_level",
        default_value=False,
        input_type="boolean",
        label="Show applause amount",
        weight=152,
        subgroup="Virtual applause",
    )

    yield ConfigVariable(
        name="general_system_applause_min_amount",
        default_value=1,
        input_type="integer",
        label="Lowest applause amount",
        help_text=
        "Defines the minimum deflection which is required to recognize applause.",
        weight=153,
        subgroup="Virtual applause",
    )

    yield ConfigVariable(
        name="general_system_applause_max_amount",
        default_value=0,
        input_type="integer",
        label="Highest applause amount",
        help_text=
        "Defines the maximum deflection. Entering zero will use the amount of present participants instead.",
        weight=154,
        subgroup="Virtual applause",
    )

    yield ConfigVariable(
        name="general_system_stream_applause_timeout",
        default_value=5,
        input_type="integer",
        label="Applause interval in seconds",
        help_text="Defines the time in which applause amounts are add up.",
        weight=155,
        subgroup="Virtual applause",
    )

    yield ConfigVariable(
        name="general_system_applause_particle_image",
        default_value="",
        label="Applause particle image URL",
        help_text=
        "Shows the given image as applause particle. Recommended image format: 24x24px, PNG, JPG or SVG",
        weight=156,
        subgroup="Virtual applause",
    )

    # General System

    yield ConfigVariable(
        name="general_system_enable_anonymous",
        default_value=False,
        input_type="boolean",
        label="Allow access for anonymous guest users",
        weight=160,
        subgroup="System",
    )

    yield ConfigVariable(
        name="general_login_info_text",
        default_value="",
        label="Show this text on the login page",
        weight=162,
        subgroup="System",
    )

    yield ConfigVariable(
        name="openslides_theme",
        default_value="openslides-default-light-theme",
        input_type="choice",
        label="OpenSlides Theme",
        choices=(
            {
                "value": "openslides-default-light-theme",
                "display_name": "OpenSlides Default",
            },
            {
                "value": "openslides-default-dark-theme",
                "display_name": "OpenSlides Dark",
            },
            {
                "value": "openslides-red-light-theme",
                "display_name": "OpenSlides Red"
            },
            {
                "value": "openslides-red-dark-theme",
                "display_name": "OpenSlides Red Dark",
            },
            {
                "value": "openslides-green-light-theme",
                "display_name": "OpenSlides Green",
            },
            {
                "value": "openslides-green-dark-theme",
                "display_name": "OpenSlides Green Dark",
            },
            {
                "value": "openslides-solarized-dark-theme",
                "display_name": "OpenSlides Solarized",
            },
        ),
        weight=164,
        subgroup="System",
    )

    # General export settings

    yield ConfigVariable(
        name="general_csv_separator",
        default_value=",",
        label="Separator used for all csv exports and examples",
        weight=170,
        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=172,
        subgroup="Export",
    )

    yield ConfigVariable(
        name="general_export_pdf_pagenumber_alignment",
        default_value="center",
        input_type="choice",
        label="Page number alignment in PDF",
        choices=(
            {
                "value": "left",
                "display_name": "Left"
            },
            {
                "value": "center",
                "display_name": "Center"
            },
            {
                "value": "right",
                "display_name": "Right"
            },
        ),
        weight=174,
        subgroup="Export",
    )

    yield ConfigVariable(
        name="general_export_pdf_fontsize",
        default_value="10",
        input_type="choice",
        label="Standard font size in PDF",
        choices=(
            {
                "value": "10",
                "display_name": "10"
            },
            {
                "value": "11",
                "display_name": "11"
            },
            {
                "value": "12",
                "display_name": "12"
            },
        ),
        weight=176,
        subgroup="Export",
    )

    yield ConfigVariable(
        name="general_export_pdf_pagesize",
        default_value="A4",
        input_type="choice",
        label="Standard page size in PDF",
        choices=(
            {
                "value": "A4",
                "display_name": "DIN A4"
            },
            {
                "value": "A5",
                "display_name": "DIN A5"
            },
        ),
        weight=178,
        subgroup="Export",
    )

    # Logos
    yield ConfigVariable(
        name="logos_available",
        default_value=[
            "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",
        ],
        weight=300,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_projector_main",
        default_value={
            "display_name": "Projector logo",
            "path": ""
        },
        input_type="static",
        weight=301,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_projector_header",
        default_value={
            "display_name": "Projector header image",
            "path": ""
        },
        input_type="static",
        weight=302,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_web_header",
        default_value={
            "display_name": "Web interface header logo",
            "path": ""
        },
        input_type="static",
        weight=303,
        group="Logo",
        hidden=True,
    )

    # PDF logos
    yield ConfigVariable(
        name="logo_pdf_header_L",
        default_value={
            "display_name": "PDF header logo (left)",
            "path": ""
        },
        input_type="static",
        weight=310,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_pdf_header_R",
        default_value={
            "display_name": "PDF header logo (right)",
            "path": ""
        },
        input_type="static",
        weight=311,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_pdf_footer_L",
        default_value={
            "display_name": "PDF footer logo (left)",
            "path": ""
        },
        input_type="static",
        weight=312,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_pdf_footer_R",
        default_value={
            "display_name": "PDF footer logo (right)",
            "path": ""
        },
        input_type="static",
        weight=313,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_pdf_ballot_paper",
        default_value={
            "display_name": "PDF ballot paper logo",
            "path": ""
        },
        input_type="static",
        weight=314,
        group="Logo",
        hidden=True,
    )

    # Fonts
    yield ConfigVariable(
        name="fonts_available",
        default_value=[
            "font_regular",
            "font_italic",
            "font_bold",
            "font_bold_italic",
            "font_monospace",
            "font_chyron_speaker_name",
        ],
        weight=320,
        group="Font",
        hidden=True,
    )

    yield ConfigVariable(
        name="font_regular",
        default_value={
            "display_name": "Font regular",
            "default": "assets/fonts/fira-sans-latin-400.woff",
            "path": "",
        },
        input_type="static",
        weight=321,
        group="Font",
        hidden=True,
    )

    yield ConfigVariable(
        name="font_italic",
        default_value={
            "display_name": "Font italic",
            "default": "assets/fonts/fira-sans-latin-400italic.woff",
            "path": "",
        },
        input_type="static",
        weight=321,
        group="Font",
        hidden=True,
    )

    yield ConfigVariable(
        name="font_bold",
        default_value={
            "display_name": "Font bold",
            "default": "assets/fonts/fira-sans-latin-500.woff",
            "path": "",
        },
        input_type="static",
        weight=321,
        group="Font",
        hidden=True,
    )

    yield ConfigVariable(
        name="font_bold_italic",
        default_value={
            "display_name": "Font bold italic",
            "default": "assets/fonts/fira-sans-latin-500italic.woff",
            "path": "",
        },
        input_type="static",
        weight=321,
        group="Font",
        hidden=True,
    )

    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,
    )

    yield ConfigVariable(
        name="font_chyron_speaker_name",
        default_value={
            "display_name": "Font for speaker name (chyron)",
            "default": "assets/fonts/fira-sans-latin-400.woff",
            "path": "",
        },
        input_type="static",
        weight=321,
        group="Font",
        hidden=True,
    )

    # Custom translations
    yield ConfigVariable(
        name="translations",
        label="Custom translations",
        default_value=[],
        input_type="translations",
        weight=1000,
        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,
    )
Exemple #17
0
def setup_general_config(sender, **kwargs):
    """
    Receiver function to setup general config variables for OpenSlides.
    There are two main groups: 'General' and 'Projector'. The group
    'General' has subgroups. This function is connected to the signal
    openslides.core.signals.config_signal during app loading.
    """
    # General Event

    yield ConfigVariable(name='general_event_name',
                         default_value='OpenSlides',
                         label=ugettext_lazy('Event name'),
                         weight=110,
                         group=ugettext_lazy('General'),
                         subgroup=ugettext_lazy('Event'),
                         validators=(MaxLengthValidator(50), ))

    yield ConfigVariable(name='general_event_description',
                         default_value=_('Presentation and assembly system'),
                         label=ugettext_lazy('Short description of event'),
                         weight=115,
                         group=ugettext_lazy('General'),
                         subgroup=ugettext_lazy('Event'),
                         validators=(MaxLengthValidator(100), ),
                         translatable=True)

    yield ConfigVariable(name='general_event_date',
                         default_value='',
                         label=ugettext_lazy('Event date'),
                         weight=120,
                         group=ugettext_lazy('General'),
                         subgroup=ugettext_lazy('Event'))

    yield ConfigVariable(name='general_event_location',
                         default_value='',
                         label=ugettext_lazy('Event location'),
                         weight=125,
                         group=ugettext_lazy('General'),
                         subgroup=ugettext_lazy('Event'))

    yield ConfigVariable(name='general_event_organizer',
                         default_value='',
                         label=ugettext_lazy('Event organizer'),
                         weight=130,
                         group=ugettext_lazy('General'),
                         subgroup=ugettext_lazy('Event'))

    yield ConfigVariable(
        name='general_event_legal_notice',
        default_value=
        _('<a href="http://www.openslides.org">OpenSlides</a> is a free web based '
          'presentation and assembly system for visualizing and controlling agenda, '
          'motions and elections of an assembly.'),
        input_type='text',
        label=ugettext_lazy('Legal notice'),
        weight=132,
        group=ugettext_lazy('General'),
        subgroup=ugettext_lazy('Event'),
        translatable=True)

    yield ConfigVariable(name='general_event_welcome_title',
                         default_value=_('Welcome to OpenSlides'),
                         label=ugettext_lazy('Front page title'),
                         weight=134,
                         group=ugettext_lazy('General'),
                         subgroup=ugettext_lazy('Event'),
                         translatable=True)

    yield ConfigVariable(name='general_event_welcome_text',
                         default_value=_('[Space for your welcome text.]'),
                         input_type='text',
                         label=ugettext_lazy('Front page text'),
                         weight=136,
                         group=ugettext_lazy('General'),
                         subgroup=ugettext_lazy('Event'),
                         translatable=True)

    # General System

    yield ConfigVariable(
        name='general_system_enable_anonymous',
        default_value=False,
        input_type='boolean',
        label=ugettext_lazy('Allow access for anonymous guest users'),
        weight=138,
        group=ugettext_lazy('General'),
        subgroup=ugettext_lazy('System'))

    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'))

    # Projector

    yield ConfigVariable(
        name='projector_enable_logo',
        default_value=True,
        input_type='boolean',
        label=ugettext_lazy('Show logo on projector'),
        help_text=ugettext_lazy(
            'You can replace the logo. Just copy a file to '
            '"static/img/logo-projector.png" in your OpenSlides data path.'),
        weight=150,
        group=ugettext_lazy('Projector'))

    yield ConfigVariable(
        name='projector_enable_title',
        default_value=True,
        input_type='boolean',
        label=ugettext_lazy(
            'Show title and description of event on projector'),
        weight=155,
        group=ugettext_lazy('Projector'))

    yield ConfigVariable(
        name='projector_header_backgroundcolor',
        default_value='#317796',
        input_type='colorpicker',
        label=ugettext_lazy('Background color of projector header and footer'),
        weight=160,
        group=ugettext_lazy('Projector'))

    yield ConfigVariable(
        name='projector_header_fontcolor',
        default_value='#F5F5F5',
        input_type='colorpicker',
        label=ugettext_lazy('Font color of projector header and footer'),
        weight=165,
        group=ugettext_lazy('Projector'))

    yield ConfigVariable(
        name='projector_h1_fontcolor',
        default_value='#317796',
        input_type='colorpicker',
        label=ugettext_lazy('Font color of projector headline'),
        weight=170,
        group=ugettext_lazy('Projector'))

    yield ConfigVariable(name='projector_default_countdown',
                         default_value=60,
                         label=ugettext_lazy('Default countdown'),
                         weight=185,
                         group=ugettext_lazy('Projector'))
Exemple #18
0
def setup_motion_config(sender, **kwargs):
    """
    Receiver function to setup all motion config variables. They are
    grouped in 'General', 'Amendments', 'Supporters', 'Voting and ballot
    papers' and 'PDF'. This function connected to the signal
    openslides.core.signals.config_signal during app loading.
    """
    # General

    yield ConfigVariable(name='motions_workflow',
                         default_value='1',
                         input_type='choice',
                         label=ugettext_lazy('Workflow of new motions'),
                         choices=({
                             'value': str(workflow.pk),
                             'display_name': ugettext_lazy(workflow.name)
                         } for workflow in Workflow.objects.all()),
                         weight=310,
                         group=ugettext_lazy('Motions'),
                         subgroup=ugettext_lazy('General'))

    yield ConfigVariable(name='motions_identifier',
                         default_value='per_category',
                         input_type='choice',
                         label=ugettext_lazy('Identifier'),
                         choices=({
                             'value':
                             'per_category',
                             'display_name':
                             ugettext_lazy('Numbered per category')
                         }, {
                             'value':
                             'serially_numbered',
                             'display_name':
                             ugettext_lazy('Serially numbered')
                         }, {
                             'value':
                             'manually',
                             'display_name':
                             ugettext_lazy('Set it manually')
                         }),
                         weight=315,
                         group=ugettext_lazy('Motions'),
                         subgroup=ugettext_lazy('General'))

    yield ConfigVariable(name='motions_preamble',
                         default_value=_('The assembly may decide,'),
                         label=ugettext_lazy('Motion preamble'),
                         weight=320,
                         group=ugettext_lazy('Motions'),
                         subgroup=ugettext_lazy('General'),
                         translatable=True)

    yield ConfigVariable(
        name='motions_stop_submitting',
        default_value=False,
        input_type='boolean',
        label=ugettext_lazy('Stop submitting new motions by non-staff users'),
        weight=325,
        group=ugettext_lazy('Motions'),
        subgroup=ugettext_lazy('General'))

    yield ConfigVariable(name='motions_allow_disable_versioning',
                         default_value=False,
                         input_type='boolean',
                         label=ugettext_lazy('Allow to disable versioning'),
                         weight=330,
                         group=ugettext_lazy('Motions'),
                         subgroup=ugettext_lazy('General'))

    # Amendments
    # Amendments currently not implemented. (TODO: Implement it like in OpenSlides 1.7.)
    yield ConfigVariable(name='motions_amendments_enabled',
                         default_value=False,
                         input_type='boolean',
                         label=ugettext_lazy('Activate amendments'),
                         hidden=True,
                         weight=335,
                         group=ugettext_lazy('Motions'),
                         subgroup=ugettext_lazy('Amendments'))

    yield ConfigVariable(
        name='motions_amendments_prefix',
        default_value=pgettext('Prefix for the identifier for amendments',
                               'A'),
        label=ugettext_lazy('Prefix for the identifier for amendments'),
        hidden=True,
        weight=340,
        group=ugettext_lazy('Motions'),
        subgroup=ugettext_lazy('Amendments'))

    # Supporters

    yield ConfigVariable(
        name='motions_min_supporters',
        default_value=0,
        input_type='integer',
        label=ugettext_lazy(
            'Number of (minimum) required supporters for a motion'),
        help_text=ugettext_lazy('Choose 0 to disable the supporting system.'),
        weight=345,
        group=ugettext_lazy('Motions'),
        subgroup=ugettext_lazy('Supporters'),
        validators=(MinValueValidator(0), ))

    yield ConfigVariable(
        name='motions_remove_supporters',
        default_value=False,
        input_type='boolean',
        label=ugettext_lazy(
            'Remove all supporters of a motion if a submitter edits his motion in early state'
        ),
        weight=350,
        group=ugettext_lazy('Motions'),
        subgroup=ugettext_lazy('Supporters'))

    # Voting and ballot papers

    yield ConfigVariable(
        name='motions_poll_100_percent_base',
        default_value='WITHOUT_INVALID',
        input_type='choice',
        label=ugettext_lazy('The 100 % base of a voting result consists of'),
        choices=PERCENT_BASE_CHOICES,
        weight=355,
        group=ugettext_lazy('Motions'),
        subgroup=ugettext_lazy('Voting and ballot papers'))

    yield ConfigVariable(
        name='motions_pdf_ballot_papers_selection',
        default_value='CUSTOM_NUMBER',
        input_type='choice',
        label=ugettext_lazy('Number of ballot papers (selection)'),
        choices=({
            'value': 'NUMBER_OF_DELEGATES',
            'display_name': ugettext_lazy('Number of all delegates')
        }, {
            'value': 'NUMBER_OF_ALL_PARTICIPANTS',
            'display_name': ugettext_lazy('Number of all participants')
        }, {
            'value':
            'CUSTOM_NUMBER',
            'display_name':
            ugettext_lazy('Use the following custom number')
        }),
        weight=360,
        group=ugettext_lazy('Motions'),
        subgroup=ugettext_lazy('Voting and ballot papers'))

    yield ConfigVariable(name='motions_pdf_ballot_papers_number',
                         default_value=8,
                         input_type='integer',
                         label=ugettext_lazy('Custom number of ballot papers'),
                         weight=365,
                         group=ugettext_lazy('Motions'),
                         subgroup=ugettext_lazy('Voting and ballot papers'),
                         validators=(MinValueValidator(1), ))

    # PDF

    yield ConfigVariable(
        name='motions_pdf_title',
        default_value=_('Motions'),
        label=ugettext_lazy('Title for PDF document (all motions)'),
        weight=370,
        group=ugettext_lazy('Motions'),
        subgroup=ugettext_lazy('PDF'),
        translatable=True)

    yield ConfigVariable(
        name='motions_pdf_preamble',
        default_value='',
        label=ugettext_lazy('Preamble text for PDF document (all motions)'),
        weight=375,
        group=ugettext_lazy('Motions'),
        subgroup=ugettext_lazy('PDF'))

    yield ConfigVariable(
        name='motions_pdf_paragraph_numbering',
        default_value=False,
        input_type='boolean',
        label=ugettext_lazy('Show paragraph numbering (only in PDF)'),
        weight=380,
        group=ugettext_lazy('Motions'),
        subgroup=ugettext_lazy('PDF'))
def get_config_variables():
    """
    Generator which yields all config variables of this app.

    They are grouped in 'General', 'Amendments', 'Supporters', 'Voting and ballot
    papers' and 'PDF'. The generator has to be evaluated during app loading
    (see apps.py).
    """

    # General
    yield ConfigVariable(
        name='motions_workflow',
        default_value='1',
        input_type='choice',
        label='Workflow of new motions',
        choices=get_workflow_choices,
        weight=310,
        group='Motions',
        subgroup='General')

    yield ConfigVariable(
        name='motions_identifier',
        default_value='per_category',
        input_type='choice',
        label='Identifier',
        choices=(
            {'value': 'per_category', 'display_name': 'Numbered per category'},
            {'value': 'serially_numbered', 'display_name': 'Serially numbered'},
            {'value': 'manually', 'display_name': 'Set it manually'}),
        weight=315,
        group='Motions',
        subgroup='General')

    yield ConfigVariable(
        name='motions_preamble',
        default_value='The assembly may decide:',
        label='Motion preamble',
        weight=320,
        group='Motions',
        subgroup='General')

    yield ConfigVariable(
        name='motions_default_line_numbering',
        default_value='none',
        input_type='choice',
        label='Default line numbering',
        choices=(
            {'value': 'outside', 'display_name': 'Outside'},
            {'value': 'inline', 'display_name': 'Inline'},
            {'value': 'none', 'display_name': 'Disabled'}),
        weight=322,
        group='Motions',
        subgroup='General')

    yield ConfigVariable(
        name='motions_line_length',
        default_value=90,
        input_type='integer',
        label='Line length',
        help_text='The maximum number of characters per line. Relevant when line numbering is enabled. Min: 40',
        weight=323,
        group='Motions',
        subgroup='General',
        validators=(MinValueValidator(40),))

    yield ConfigVariable(
        name='motions_disable_reason_on_projector',
        default_value=False,
        input_type='boolean',
        label='Hide reason on projector',
        weight=325,
        group='Motions',
        subgroup='General')

    yield ConfigVariable(
        name='motions_disable_sidebox_on_projector',
        default_value=False,
        input_type='boolean',
        label='Hide meta information box on projector',
        weight=326,
        group='Motions',
        subgroup='General')

    yield ConfigVariable(
        name='motions_disable_recommendation_on_projector',
        default_value=False,
        input_type='boolean',
        label='Hide recommendation on projector',
        weight=327,
        group='Motions',
        subgroup='General')

    yield ConfigVariable(
        name='motions_stop_submitting',
        default_value=False,
        input_type='boolean',
        label='Stop submitting new motions by non-staff users',
        weight=331,
        group='Motions',
        subgroup='General')

    yield ConfigVariable(
        name='motions_recommendations_by',
        default_value='',
        label='Name of recommender',
        help_text='Will be displayed as label before selected recommendation. Use an empty value to disable the recommendation system.',
        weight=332,
        group='Motions',
        subgroup='General')

    yield ConfigVariable(
        name='motions_recommendation_text_mode',
        default_value='original',
        input_type='choice',
        label='Default text version for change recommendations',
        choices=(
            {'value': 'original', 'display_name': 'Original version'},
            {'value': 'changed', 'display_name': 'Changed version'},
            {'value': 'diff', 'display_name': 'Diff version'},
            {'value': 'agreed', 'display_name': 'Final version'}),
        weight=333,
        group='Motions',
        subgroup='General')

    # Amendments
    yield ConfigVariable(
        name='motions_amendments_enabled',
        default_value=False,
        input_type='boolean',
        label='Activate amendments',
        weight=335,
        group='Motions',
        subgroup='Amendments')

    yield ConfigVariable(
        name='motions_amendments_main_table',
        default_value=False,
        input_type='boolean',
        label='Show amendments together with motions',
        weight=337,
        group='Motions',
        subgroup='Amendments')

    yield ConfigVariable(
        name='motions_amendments_prefix',
        default_value='-',
        label='Prefix for the identifier for amendments',
        weight=340,
        group='Motions',
        subgroup='Amendments')

    yield ConfigVariable(
        name='motions_amendments_text_mode',
        default_value='freestyle',
        input_type='choice',
        label='How to create new amendments',
        choices=(
            {'value': 'freestyle', 'display_name': 'Empty text field'},
            {'value': 'fulltext', 'display_name': 'Edit the whole motion text'},
            {'value': 'paragraph', 'display_name': 'Paragraph-based, Diff-enabled'},
        ),
        weight=342,
        group='Motions',
        subgroup='Amendments')

    # Supporters

    yield ConfigVariable(
        name='motions_min_supporters',
        default_value=0,
        input_type='integer',
        label='Number of (minimum) required supporters for a motion',
        help_text='Choose 0 to disable the supporting system.',
        weight=345,
        group='Motions',
        subgroup='Supporters',
        validators=(MinValueValidator(0),))

    yield ConfigVariable(
        name='motions_remove_supporters',
        default_value=False,
        input_type='boolean',
        label='Remove all supporters of a motion if a submitter edits his motion in early state',
        weight=350,
        group='Motions',
        subgroup='Supporters')

    # Voting and ballot papers

    yield ConfigVariable(
        name='motions_poll_100_percent_base',
        default_value='YES_NO_ABSTAIN',
        input_type='choice',
        label='The 100 % base of a voting result consists of',
        choices=(
            {'value': 'YES_NO_ABSTAIN', 'display_name': 'Yes/No/Abstain'},
            {'value': 'YES_NO', 'display_name': 'Yes/No'},
            {'value': 'VALID', 'display_name': 'All valid ballots'},
            {'value': 'CAST', 'display_name': 'All casted ballots'},
            {'value': 'DISABLED', 'display_name': 'Disabled (no percents)'}
            ),
        weight=355,
        group='Motions',
        subgroup='Voting and ballot papers')

    # TODO: Add server side validation of the choices.
    yield ConfigVariable(
        name='motions_poll_default_majority_method',
        default_value='simple_majority',
        input_type='majorityMethod',
        label='Required majority',
        help_text='Default method to check whether a motion has reached the required majority.',
        weight=357,
        group='Motions',
        subgroup='Voting and ballot papers')

    yield ConfigVariable(
        name='motions_pdf_ballot_papers_selection',
        default_value='CUSTOM_NUMBER',
        input_type='choice',
        label='Number of ballot papers (selection)',
        choices=(
            {'value': 'NUMBER_OF_DELEGATES', 'display_name': 'Number of all delegates'},
            {'value': 'NUMBER_OF_ALL_PARTICIPANTS', 'display_name': 'Number of all participants'},
            {'value': 'CUSTOM_NUMBER', 'display_name': 'Use the following custom number'}),
        weight=360,
        group='Motions',
        subgroup='Voting and ballot papers')

    yield ConfigVariable(
        name='motions_pdf_ballot_papers_number',
        default_value=8,
        input_type='integer',
        label='Custom number of ballot papers',
        weight=365,
        group='Motions',
        subgroup='Voting and ballot papers',
        validators=(MinValueValidator(1),))

    # PDF and DOCX export

    yield ConfigVariable(
        name='motions_export_title',
        default_value='Motions',
        label='Title for PDF and DOCX documents (all motions)',
        weight=370,
        group='Motions',
        subgroup='Export')

    yield ConfigVariable(
        name='motions_export_preamble',
        default_value='',
        label='Preamble text for PDF and DOCX documents (all motions)',
        weight=375,
        group='Motions',
        subgroup='Export')

    yield ConfigVariable(
        name='motions_export_category_sorting',
        default_value='prefix',
        input_type='choice',
        label='Sort categories by',
        choices=(
            {'value': 'prefix', 'display_name': 'Prefix'},
            {'value': 'name', 'display_name': 'Name'}),
        weight=380,
        group='Motions',
        subgroup='Export')

    yield ConfigVariable(
        name='motions_export_sequential_number',
        default_value=True,
        input_type='boolean',
        label='Include the sequential number in PDF and DOCX',
        weight=385,
        group='Motions',
        subgroup='Export')
Exemple #20
0
def setup_agenda_config(sender, **kwargs):
    """
    Receiver function to setup all agenda config variables.
    This function connected to the signal openslides.core.signals.config_signal
    during app loading.
    """
    yield ConfigVariable(
        name='agenda_number_prefix',
        default_value='',
        label=ugettext_lazy('Numbering prefix for agenda items'),
        help_text=ugettext_lazy(
            'This prefix will be set if you run the automatic agenda numbering.'
        ),
        weight=210,
        group=ugettext_lazy('Agenda'),
        subgroup=ugettext_lazy('General'),
        validators=(MaxLengthValidator(20), ))

    yield ConfigVariable(
        name='agenda_numeral_system',
        default_value='arabic',
        input_type='choice',
        label=ugettext_lazy('Numeral system for agenda items'),
        choices=({
            'value': 'arabic',
            'display_name': ugettext_lazy('Arabic')
        }, {
            'value': 'roman',
            'display_name': ugettext_lazy('Roman')
        }),
        weight=215,
        group=ugettext_lazy('Agenda'),
        subgroup=ugettext_lazy('General'))

    # TODO: Use an input type with generic datetime support.
    yield ConfigVariable(
        name='agenda_start_event_date_time',
        default_value='',
        label=ugettext_lazy('Begin of event'),
        help_text=ugettext_lazy('Input format: DD.MM.YYYY HH:MM'),
        weight=220,
        group=ugettext_lazy('Agenda'),
        subgroup=ugettext_lazy('General'),
        validators=(validate_start_time, ))

    # List of speakers

    yield ConfigVariable(
        name='agenda_show_last_speakers',
        default_value=1,
        input_type='integer',
        label=ugettext_lazy(
            'Number of last speakers to be shown on the projector'),
        weight=230,
        group=ugettext_lazy('Agenda'),
        subgroup=ugettext_lazy('List of speakers'),
        validators=(MinValueValidator(0), ))

    yield ConfigVariable(
        name='agenda_countdown_warning_time',
        default_value=0,
        input_type='integer',
        label=ugettext_lazy(
            'Show orange countdown in the last x seconds of speaking time'),
        help_text=ugettext_lazy(
            'Enter duration in seconds. Choose 0 to disable warning color.'),
        weight=235,
        group=ugettext_lazy('Agenda'),
        subgroup=ugettext_lazy('List of speakers'),
        validators=(MinValueValidator(0), ))

    yield ConfigVariable(
        name='agenda_couple_countdown_and_speakers',
        default_value=False,
        input_type='boolean',
        label=ugettext_lazy('Couple countdown with the list of speakers'),
        help_text=ugettext_lazy(
            '[Begin speech] starts the countdown, [End speech] stops the countdown.'
        ),
        weight=240,
        group=ugettext_lazy('Agenda'),
        subgroup=ugettext_lazy('List of speakers'))
Exemple #21
0
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(
        name="general_event_name",
        default_value="OpenSlides",
        label="Event name",
        weight=110,
        subgroup="Event",
        validators=(MaxLengthValidator(100), ),
    )

    yield ConfigVariable(
        name="general_event_description",
        default_value="Presentation and assembly system",
        label="Short description of event",
        weight=115,
        subgroup="Event",
        validators=(MaxLengthValidator(100), ),
    )

    yield ConfigVariable(
        name="general_event_date",
        default_value="",
        label="Event date",
        weight=120,
        subgroup="Event",
    )

    yield ConfigVariable(
        name="general_event_location",
        default_value="",
        label="Event location",
        weight=125,
        subgroup="Event",
    )

    yield ConfigVariable(
        name="general_event_legal_notice",
        default_value='<a href="http://www.openslides.org">OpenSlides</a> is a '
        "free web based presentation and assembly system for "
        "visualizing and controlling agenda, motions and "
        "elections of an assembly.",
        input_type="markupText",
        label="Legal notice",
        weight=131,
        subgroup="Event",
        hidden=True,
    )

    yield ConfigVariable(
        name="general_event_privacy_policy",
        default_value="",
        input_type="markupText",
        label="Privacy policy",
        weight=132,
        subgroup="Event",
        hidden=True,
    )

    yield ConfigVariable(
        name="general_event_welcome_title",
        default_value="Welcome to OpenSlides",
        label="Front page title",
        weight=133,
        subgroup="Event",
        hidden=True,
    )

    yield ConfigVariable(
        name="general_event_welcome_text",
        default_value="[Space for your welcome text.]",
        input_type="markupText",
        label="Front page text",
        weight=134,
        subgroup="Event",
        hidden=True,
    )

    # Live conference

    yield ConfigVariable(
        name="general_system_conference_show",
        default_value=False,
        input_type="boolean",
        label="Show live conference window",
        help_text=
        "Server settings required to activate Jitsi Meet integration.",
        weight=140,
        subgroup="Live conference",
    )

    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,
        subgroup="Live conference",
    )

    yield ConfigVariable(
        name="general_system_conference_los_restriction",
        default_value=False,
        input_type="boolean",
        label=
        "Allow only current speakers and list of speakers managers to enter the live conference",
        help_text=
        "Server settings required to activate Jitsi Meet integration.",
        weight=142,
        subgroup="Live conference",
    )

    yield ConfigVariable(
        name="general_system_stream_url",
        default_value="",
        label="Livestream url",
        help_text=
        "Remove URL to deactivate livestream. Check extra group permission to see livestream.",
        weight=143,
        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(
        name="general_login_info_text",
        default_value="",
        label="Show this text on the login page",
        weight=152,
        subgroup="System",
    )

    yield ConfigVariable(
        name="openslides_theme",
        default_value="openslides-default-light-theme",
        input_type="choice",
        label="OpenSlides Theme",
        choices=(
            {
                "value": "openslides-default-light-theme",
                "display_name": "OpenSlides Default",
            },
            {
                "value": "openslides-default-dark-theme",
                "display_name": "OpenSlides Dark",
            },
            {
                "value": "openslides-red-light-theme",
                "display_name": "OpenSlides Red"
            },
            {
                "value": "openslides-red-dark-theme",
                "display_name": "OpenSlides Red Dark",
            },
            {
                "value": "openslides-green-light-theme",
                "display_name": "OpenSlides Green",
            },
            {
                "value": "openslides-green-dark-theme",
                "display_name": "OpenSlides Green Dark",
            },
            {
                "value": "openslides-solarized-dark-theme",
                "display_name": "OpenSlides Solarized",
            },
        ),
        weight=154,
        subgroup="System",
    )

    # General export settings

    yield ConfigVariable(
        name="general_csv_separator",
        default_value=",",
        label="Separator used for all csv exports and examples",
        weight=160,
        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(
        name="general_export_pdf_pagenumber_alignment",
        default_value="center",
        input_type="choice",
        label="Page number alignment in PDF",
        choices=(
            {
                "value": "left",
                "display_name": "Left"
            },
            {
                "value": "center",
                "display_name": "Center"
            },
            {
                "value": "right",
                "display_name": "Right"
            },
        ),
        weight=164,
        subgroup="Export",
    )

    yield ConfigVariable(
        name="general_export_pdf_fontsize",
        default_value="10",
        input_type="choice",
        label="Standard font size in PDF",
        choices=(
            {
                "value": "10",
                "display_name": "10"
            },
            {
                "value": "11",
                "display_name": "11"
            },
            {
                "value": "12",
                "display_name": "12"
            },
        ),
        weight=166,
        subgroup="Export",
    )

    yield ConfigVariable(
        name="general_export_pdf_pagesize",
        default_value="A4",
        input_type="choice",
        label="Standard page size in PDF",
        choices=(
            {
                "value": "A4",
                "display_name": "DIN A4"
            },
            {
                "value": "A5",
                "display_name": "DIN A5"
            },
        ),
        weight=168,
        subgroup="Export",
    )

    # Logos
    yield ConfigVariable(
        name="logos_available",
        default_value=[
            "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",
        ],
        weight=300,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_projector_main",
        default_value={
            "display_name": "Projector logo",
            "path": ""
        },
        input_type="static",
        weight=301,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_projector_header",
        default_value={
            "display_name": "Projector header image",
            "path": ""
        },
        input_type="static",
        weight=302,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_web_header",
        default_value={
            "display_name": "Web interface header logo",
            "path": ""
        },
        input_type="static",
        weight=303,
        group="Logo",
        hidden=True,
    )

    # PDF logos
    yield ConfigVariable(
        name="logo_pdf_header_L",
        default_value={
            "display_name": "PDF header logo (left)",
            "path": ""
        },
        input_type="static",
        weight=310,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_pdf_header_R",
        default_value={
            "display_name": "PDF header logo (right)",
            "path": ""
        },
        input_type="static",
        weight=311,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_pdf_footer_L",
        default_value={
            "display_name": "PDF footer logo (left)",
            "path": ""
        },
        input_type="static",
        weight=312,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_pdf_footer_R",
        default_value={
            "display_name": "PDF footer logo (right)",
            "path": ""
        },
        input_type="static",
        weight=313,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_pdf_ballot_paper",
        default_value={
            "display_name": "PDF ballot paper logo",
            "path": ""
        },
        input_type="static",
        weight=314,
        group="Logo",
        hidden=True,
    )

    # Fonts
    yield ConfigVariable(
        name="fonts_available",
        default_value=[
            "font_regular",
            "font_italic",
            "font_bold",
            "font_bold_italic",
            "font_monospace",
        ],
        weight=320,
        group="Font",
        hidden=True,
    )

    yield ConfigVariable(
        name="font_regular",
        default_value={
            "display_name": "Font regular",
            "default": "assets/fonts/fira-sans-latin-400.woff",
            "path": "",
        },
        input_type="static",
        weight=321,
        group="Font",
        hidden=True,
    )

    yield ConfigVariable(
        name="font_italic",
        default_value={
            "display_name": "Font italic",
            "default": "assets/fonts/fira-sans-latin-400italic.woff",
            "path": "",
        },
        input_type="static",
        weight=321,
        group="Font",
        hidden=True,
    )

    yield ConfigVariable(
        name="font_bold",
        default_value={
            "display_name": "Font bold",
            "default": "assets/fonts/fira-sans-latin-500.woff",
            "path": "",
        },
        input_type="static",
        weight=321,
        group="Font",
        hidden=True,
    )

    yield ConfigVariable(
        name="font_bold_italic",
        default_value={
            "display_name": "Font bold italic",
            "default": "assets/fonts/fira-sans-latin-500italic.woff",
            "path": "",
        },
        input_type="static",
        weight=321,
        group="Font",
        hidden=True,
    )

    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,
    )

    # Custom translations
    yield ConfigVariable(
        name="translations",
        label="Custom translations",
        default_value=[],
        input_type="translations",
        weight=1000,
        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,
    )
def get_config_variables():
    """
    Generator which yields all config variables of this app.

    They are grouped in 'Sorting' and 'PDF'. The generator has to be evaluated
    during app loading (see apps.py).
    """
    # Sorting
    yield ConfigVariable(name='users_sort_by',
                         default_value='first_name',
                         input_type='choice',
                         label='Sort name of participants by',
                         choices=({
                             'value': 'first_name',
                             'display_name': 'Given name'
                         }, {
                             'value': 'last_name',
                             'display_name': 'Surname'
                         }),
                         weight=510,
                         group='Participants',
                         subgroup='General')

    # PDF

    yield ConfigVariable(name='users_pdf_welcometitle',
                         default_value='Welcome to OpenSlides',
                         label='Title for access data and welcome PDF',
                         weight=520,
                         group='Participants',
                         subgroup='PDF')

    yield ConfigVariable(
        name='users_pdf_welcometext',
        default_value='[Place for your welcome and help text.]',
        label='Help text for access data and welcome PDF',
        weight=530,
        group='Participants',
        subgroup='PDF')

    # TODO: Use Django's URLValidator here.
    yield ConfigVariable(name='users_pdf_url',
                         default_value='http://example.com:8000',
                         label='System URL',
                         help_text='Used for QRCode in PDF of access data.',
                         weight=540,
                         group='Participants',
                         subgroup='PDF')

    yield ConfigVariable(
        name='users_pdf_wlan_ssid',
        default_value='',
        label='WLAN name (SSID)',
        help_text='Used for WLAN QRCode in PDF of access data.',
        weight=550,
        group='Participants',
        subgroup='PDF')

    yield ConfigVariable(
        name='users_pdf_wlan_password',
        default_value='',
        label='WLAN password',
        help_text='Used for WLAN QRCode in PDF of access data.',
        weight=560,
        group='Participants',
        subgroup='PDF')

    yield ConfigVariable(
        name='users_pdf_wlan_encryption',
        default_value='',
        input_type='choice',
        label='WLAN encryption',
        help_text='Used for WLAN QRCode in PDF of access data.',
        choices=({
            'value': '',
            'display_name': '---------'
        }, {
            'value': 'WEP',
            'display_name': 'WEP'
        }, {
            'value': 'WPA',
            'display_name': 'WPA/WPA2'
        }, {
            'value': 'nopass',
            'display_name': 'No encryption'
        }),
        weight=570,
        group='Participants',
        subgroup='PDF')
def set_simple_config_view_multiple_vars():
    """
    Sets a bad config view with some multiple config vars.
    """
    yield ConfigVariable(name='multiple_config_var', default_value='foobar1')
    yield ConfigVariable(name='multiple_config_var', default_value='foobar2')
def get_config_variables():
    """
    Generator which yields all config variables of this app.

    It has to be evaluated during app loading (see apps.py).
    """
    yield ConfigVariable(name='votecollector_method',
                         default_value='both',
                         input_type='choice',
                         label='Distribution method for keypads',
                         choices=({
                             'value': 'anonym',
                             'display_name': 'Use anonymous keypads only'
                         }, {
                             'value':
                             'person',
                             'display_name':
                             'Use personalized keypads only'
                         }, {
                             'value':
                             'both',
                             'display_name':
                             'Use anonymous and personalized keypads'
                         }),
                         weight=610,
                         group='VoteCollector')
    yield ConfigVariable(
        # TODO: Use URL validator.
        name='votecollector_uri',
        default_value='http://localhost:8030',
        label='URL of VoteCollector',
        help_text='Example: http://localhost:8030',
        weight=620,
        group='VoteCollector')
    yield ConfigVariable(name='votecollector_vote_started_msg',
                         default_value=ugettext_noop('Please vote now!'),
                         label="Overlay message 'Vote started'",
                         weight=630,
                         group='VoteCollector')
    yield ConfigVariable(
        name='votecollector_live_voting',
        default_value=False,
        input_type='boolean',
        label='Use live voting for motions',
        help_text=
        'Incoming votes will be shown on projector while voting is active.',
        weight=640,
        group='VoteCollector')
    yield ConfigVariable(
        name='votecollector_seating_plan',
        default_value=True,
        input_type='boolean',
        label='Show seating plan',
        help_text=
        'Incoming votes will be shown in seating plan on projector for keypads with assigned seats.',
        weight=650,
        group='VoteCollector')
    yield ConfigVariable(
        name='votecollector_seats_grey',
        default_value=False,
        input_type='boolean',
        label='Show grey seats on seating plan',
        help_text=
        'Incoming votes will be shown in grey on seating plan. You can see only WHICH seat has voted but not HOW.',
        weight=660,
        group='VoteCollector')
Exemple #25
0
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(
        name='general_event_name',
        default_value='OpenSlides',
        label='Event name',
        weight=110,
        group='General',
        subgroup='Event',
        validators=(MaxLengthValidator(100),))

    yield ConfigVariable(
        name='general_event_description',
        default_value='Presentation and assembly system',
        label='Short description of event',
        weight=115,
        group='General',
        subgroup='Event',
        validators=(MaxLengthValidator(100),))

    yield ConfigVariable(
        name='general_event_date',
        default_value='',
        label='Event date',
        weight=120,
        group='General',
        subgroup='Event')

    yield ConfigVariable(
        name='general_event_location',
        default_value='',
        label='Event location',
        weight=125,
        group='General',
        subgroup='Event')

    yield ConfigVariable(
        name='general_event_legal_notice',
        default_value='<a href="http://www.openslides.org">OpenSlides</a> is a '
                      'free web based presentation and assembly system for '
                      'visualizing and controlling agenda, motions and '
                      'elections of an assembly.',
        input_type='markupText',
        label='Legal notice',
        weight=132,
        group='General',
        subgroup='Event')

    yield ConfigVariable(
        name='general_event_welcome_title',
        default_value='Welcome to OpenSlides',
        label='Front page title',
        weight=134,
        group='General',
        subgroup='Event')

    yield ConfigVariable(
        name='general_event_welcome_text',
        default_value='[Space for your welcome text.]',
        input_type='markupText',
        label='Front page text',
        weight=136,
        group='General',
        subgroup='Event')

    # General System

    yield ConfigVariable(
        name='general_system_enable_anonymous',
        default_value=False,
        input_type='boolean',
        label='Allow access for anonymous guest users',
        weight=138,
        group='General',
        subgroup='System')

    yield ConfigVariable(
        name='general_login_info_text',
        default_value='',
        label='Show this text on the login page',
        weight=140,
        group='General',
        subgroup='System')

    # General export settings

    yield ConfigVariable(
        name='general_csv_separator',
        default_value=',',
        label='Separator used for all csv exports and examples',
        weight=142,
        group='General',
        subgroup='Export')

    yield ConfigVariable(
        name='general_export_pdf_pagenumber_alignment',
        default_value='center',
        input_type='choice',
        label='Page number alignment in PDF',
        choices=(
            {'value': 'left', 'display_name': 'Left'},
            {'value': 'center', 'display_name': 'Center'},
            {'value': 'right', 'display_name': 'Right'}),
        weight=144,
        group='General',
        subgroup='Export')

    yield ConfigVariable(
        name='general_export_pdf_fontsize',
        default_value='10',
        input_type='choice',
        label='Standard font size in PDF',
        choices=(
            {'value': '10', 'display_name': '10'},
            {'value': '11', 'display_name': '11'},
            {'value': '12', 'display_name': '12'}),
        weight=146,
        group='General',
        subgroup='Export')

    # Projector

    yield ConfigVariable(
        name='projector_language',
        default_value='browser',
        input_type='choice',
        label='Projector language',
        choices=(
            {'value': 'browser', 'display_name': 'Current browser language'},
            {'value': 'en', 'display_name': 'English'},
            {'value': 'de', 'display_name': 'Deutsch'},
            {'value': 'fr', 'display_name': 'Français'},
            {'value': 'es', 'display_name': 'Español'},
            {'value': 'pt', 'display_name': 'Português'},
            {'value': 'cs', 'display_name': 'Čeština'},
            {'value': 'ru', 'display_name': 'русский'}),
        weight=150,
        group='Projector')

    yield ConfigVariable(
        name='projector_enable_logo',
        default_value=True,
        input_type='boolean',
        label='Show logo on projector',
        help_text='You can replace the logo by uploading an image and set it as '
                  'the "Projector logo" in "files".',
        weight=152,
        group='Projector')

    yield ConfigVariable(
        name='projector_enable_clock',
        default_value=True,
        input_type='boolean',
        label='Show the clock on projector',
        weight=154,
        group='Projector')

    yield ConfigVariable(
        name='projector_enable_title',
        default_value=True,
        input_type='boolean',
        label='Show title and description of event on projector',
        weight=155,
        group='Projector')

    yield ConfigVariable(
        name='projector_enable_header_footer',
        default_value=True,
        input_type='boolean',
        label='Display header and footer',
        weight=157,
        group='Projector')

    yield ConfigVariable(
        name='projector_header_backgroundcolor',
        default_value='#317796',
        input_type='colorpicker',
        label='Background color of projector header and footer',
        weight=160,
        group='Projector')

    yield ConfigVariable(
        name='projector_header_fontcolor',
        default_value='#F5F5F5',
        input_type='colorpicker',
        label='Font color of projector header and footer',
        weight=165,
        group='Projector')

    yield ConfigVariable(
        name='projector_h1_fontcolor',
        default_value='#317796',
        input_type='colorpicker',
        label='Font color of projector headline',
        weight=170,
        group='Projector')

    yield ConfigVariable(
        name='projector_default_countdown',
        default_value=60,
        input_type='integer',
        label='Predefined seconds of new countdowns',
        weight=185,
        group='Projector')

    yield ConfigVariable(
        name='projector_blank_color',
        default_value='#FFFFFF',
        input_type='colorpicker',
        label='Color for blanked projector',
        weight=190,
        group='Projector')

    yield ConfigVariable(
        name='projector_broadcast',
        default_value=0,
        input_type='integer',
        label='Projector which is broadcasted',
        weight=200,
        group='Projector',
        hidden=True)

    yield ConfigVariable(
        name='projector_currentListOfSpeakers_reference',
        default_value=1,
        input_type='integer',
        label='Projector reference for list of speakers',
        weight=201,
        group='Projector',
        hidden=True)

    # Logos.
    yield ConfigVariable(
        name='logos_available',
        default_value=[
            'logo_projector_main',
            'logo_projector_header',
            'logo_web_header',
            'logo_pdf_header',
            'logo_pdf_footer',
            'logo_pdf_ballot_paper'],
        weight=300,
        group='Logo',
        hidden=True)

    yield ConfigVariable(
        name='logo_projector_main',
        default_value={
            'display_name': 'Projector logo',
            'path': ''},
        input_type='logo',
        weight=301,
        group='Logo',
        hidden=True)

    yield ConfigVariable(
        name='logo_projector_header',
        default_value={
            'display_name': 'Projector header image',
            'path': ''},
        input_type='logo',
        weight=302,
        group='Logo',
        hidden=True)

    yield ConfigVariable(
        name='logo_web_header',
        default_value={
            'display_name': 'Web interface header logo',
            'path': ''},
        input_type='logo',
        weight=303,
        group='Logo',
        hidden=True)

    # PDF logos
    yield ConfigVariable(
        name='logo_pdf_header',
        default_value={
            'display_name': 'PDF header logo',
            'path': ''},
        input_type='logo',
        weight=310,
        group='Logo',
        hidden=True)

    yield ConfigVariable(
        name='logo_pdf_footer',
        default_value={
            'display_name': 'PDF footer logo',
            'path': ''},
        input_type='logo',
        weight=311,
        group='Logo',
        hidden=True)

    yield ConfigVariable(
        name='logo_pdf_ballot_paper',
        default_value={
            'display_name': 'PDF ballot paper logo',
            'path': ''},
        input_type='logo',
        weight=312,
        group='Logo',
        hidden=True)

    # Custom translations
    yield ConfigVariable(
        name='translations',
        label='Custom translations',
        default_value=[],
        input_type='translations',
        weight=1000,
        group='Custom translations')
def get_config_variables():
    """
    Generator which yields all config variables of this app.

    It has to be evaluated during app loading (see apps.py).
    """

    # General

    yield ConfigVariable(
        name="agenda_start_event_date_time",
        default_value=None,
        input_type="datetimepicker",
        label="Begin of event",
        help_text="Input format: DD.MM.YYYY HH:MM",
        weight=200,
        group="Agenda",
        hidden=True,
    )

    # Numbering

    yield ConfigVariable(
        name="agenda_enable_numbering",
        label="Enable numbering for agenda items",
        input_type="boolean",
        default_value=True,
        weight=205,
        group="Agenda",
        subgroup="Numbering",
    )

    yield ConfigVariable(
        name="agenda_number_prefix",
        default_value="",
        label="Numbering prefix for agenda items",
        help_text="This prefix will be set if you run the automatic agenda numbering.",
        weight=206,
        group="Agenda",
        subgroup="Numbering",
        validators=(MaxLengthValidator(20),),
    )

    yield ConfigVariable(
        name="agenda_numeral_system",
        default_value="arabic",
        input_type="choice",
        label="Numeral system for agenda items",
        choices=(
            {"value": "arabic", "display_name": "Arabic"},
            {"value": "roman", "display_name": "Roman"},
        ),
        weight=207,
        group="Agenda",
        subgroup="Numbering",
    )

    # Visibility

    yield ConfigVariable(
        name="agenda_item_creation",
        label="Add to agenda",
        default_value="default_yes",
        input_type="choice",
        choices=(
            {"value": "always", "display_name": "Always"},
            {"value": "never", "display_name": "Never"},
            {"value": "default_yes", "display_name": "Ask, default yes"},
            {"value": "default_no", "display_name": "Ask, default no"},
        ),
        weight=210,
        group="Agenda",
        subgroup="Visibility",
    )

    yield ConfigVariable(
        name="agenda_new_items_default_visibility",
        default_value="2",
        input_type="choice",
        choices=(
            {"value": "1", "display_name": "Public item"},
            {"value": "2", "display_name": "Internal item"},
            {"value": "3", "display_name": "Hidden item"},
        ),
        label="Default visibility for new agenda items (except topics)",
        weight=211,
        group="Agenda",
        subgroup="Visibility",
    )

    yield ConfigVariable(
        name="agenda_hide_internal_items_on_projector",
        default_value=True,
        input_type="boolean",
        label="Hide internal items when projecting subitems",
        weight=212,
        group="Agenda",
        subgroup="Visibility",
    )

    yield ConfigVariable(
        name="agenda_show_subtitle",
        default_value=True,
        input_type="boolean",
        label="Show motion submitters in the agenda",
        weight=213,
        group="Agenda",
        subgroup="Visibility",
    )

    # List of speakers

    yield ConfigVariable(
        name="agenda_show_last_speakers",
        default_value=0,
        input_type="integer",
        label="Number of last speakers to be shown on the projector",
        weight=220,
        group="Agenda",
        subgroup="List of speakers",
        validators=(MinValueValidator(0),),
    )

    yield ConfigVariable(
        name="agenda_show_next_speakers",
        default_value=-1,
        input_type="integer",
        label="Number of the next speakers to be shown on the projector",
        help_text="Enter number of the next shown speakers. Choose -1 to show all next speakers.",
        weight=222,
        group="Agenda",
        subgroup="List of speakers",
        validators=(MinValueValidator(-1),),
    )

    yield ConfigVariable(
        name="agenda_countdown_warning_time",
        default_value=0,
        input_type="integer",
        label="Show orange countdown in the last x seconds of speaking time",
        help_text="Enter duration in seconds. Choose 0 to disable warning color.",
        weight=224,
        group="Agenda",
        subgroup="List of speakers",
        validators=(MinValueValidator(0),),
    )

    yield ConfigVariable(
        name="projector_default_countdown",
        default_value=60,
        input_type="integer",
        label="Predefined seconds of new countdowns",
        weight=226,
        group="Agenda",
        subgroup="List of speakers",
    )

    yield ConfigVariable(
        name="agenda_couple_countdown_and_speakers",
        default_value=True,
        input_type="boolean",
        label="Couple countdown with the list of speakers",
        help_text="[Begin speech] starts the countdown, [End speech] stops the countdown.",
        weight=228,
        group="Agenda",
        subgroup="List of speakers",
    )

    yield ConfigVariable(
        name="agenda_enable_point_of_order_speakers",
        default_value=False,
        input_type="boolean",
        label="Enable points of order",
        weight=229,
        group="Agenda",
        subgroup="List of speakers",
    )

    yield ConfigVariable(
        name="agenda_list_of_speakers_speaker_note_for_everyone",
        default_value=False,
        input_type="boolean",
        label="Everyone can see the request of a point of order (instead of managers for list of speakers only)",
        weight=230,
        group="Agenda",
        subgroup="List of speakers",
    )

    yield ConfigVariable(
        name="agenda_hide_amount_of_speakers",
        default_value=False,
        input_type="boolean",
        label="Hide the amount of speakers in subtitle of list of speakers slide",
        weight=231,
        group="Agenda",
        subgroup="List of speakers",
    )

    yield ConfigVariable(
        name="agenda_present_speakers_only",
        default_value=False,
        input_type="boolean",
        label="Only present participants can be added to the list of speakers",
        weight=232,
        group="Agenda",
        subgroup="List of speakers",
    )

    yield ConfigVariable(
        name="agenda_show_first_contribution",
        default_value=False,
        input_type="boolean",
        label="Show hint »first speech« in the list of speakers management view",
        weight=234,
        group="Agenda",
        subgroup="List of speakers",
    )

    yield ConfigVariable(
        name="agenda_list_of_speakers_initially_closed",
        default_value=False,
        input_type="boolean",
        label="List of speakers is initially closed",
        weight=235,
        group="Agenda",
        subgroup="List of speakers",
    )

    yield ConfigVariable(
        name="agenda_list_of_speakers_enable_pro_contra_speech",
        default_value=False,
        input_type="boolean",
        label="Enable forspeech / counter speech",
        weight=240,
        group="Agenda",
        subgroup="List of speakers",
    )

    yield ConfigVariable(
        name="agenda_list_of_speakers_can_set_mark_self",
        default_value=False,
        input_type="boolean",
        label="Enable star icon to mark speaker (e.g. for contribution)",
        weight=245,
        group="Agenda",
        subgroup="List of speakers",
    )
def get_config_variables():
    """
    Generator which yields all config variables of this app.

    They are grouped in 'Sorting' and 'PDF'. The generator has to be evaluated
    during app loading (see apps.py).
    """
    # Sorting
    yield ConfigVariable(
        name='users_sort_by',
        default_value='first_name',
        input_type='choice',
        label='Sort name of participants by',
        choices=(
            {'value': 'first_name', 'display_name': 'Given name'},
            {'value': 'last_name', 'display_name': 'Surname'}),
        weight=510,
        group='Participants',
        subgroup='General')

    yield ConfigVariable(
        name='users_enable_presence_view',
        default_value=False,
        input_type='boolean',
        label='Enable participant presence view',
        weight=511,
        group='Participants',
        subgroup='General')

    # PDF

    yield ConfigVariable(
        name='users_pdf_welcometitle',
        default_value='Welcome to OpenSlides',
        label='Title for access data and welcome PDF',
        weight=520,
        group='Participants',
        subgroup='PDF')

    yield ConfigVariable(
        name='users_pdf_welcometext',
        default_value='[Place for your welcome and help text.]',
        label='Help text for access data and welcome PDF',
        weight=530,
        group='Participants',
        subgroup='PDF')

    # TODO: Use Django's URLValidator here.
    yield ConfigVariable(
        name='users_pdf_url',
        default_value='http://example.com:8000',
        label='System URL',
        help_text='Used for QRCode in PDF of access data.',
        weight=540,
        group='Participants',
        subgroup='PDF')

    yield ConfigVariable(
        name='users_pdf_wlan_ssid',
        default_value='',
        label='WLAN name (SSID)',
        help_text='Used for WLAN QRCode in PDF of access data.',
        weight=550,
        group='Participants',
        subgroup='PDF')

    yield ConfigVariable(
        name='users_pdf_wlan_password',
        default_value='',
        label='WLAN password',
        help_text='Used for WLAN QRCode in PDF of access data.',
        weight=560,
        group='Participants',
        subgroup='PDF')

    yield ConfigVariable(
        name='users_pdf_wlan_encryption',
        default_value='',
        input_type='choice',
        label='WLAN encryption',
        help_text='Used for WLAN QRCode in PDF of access data.',
        choices=(
            {'value': '', 'display_name': '---------'},
            {'value': 'WEP', 'display_name': 'WEP'},
            {'value': 'WPA', 'display_name': 'WPA/WPA2'},
            {'value': 'nopass', 'display_name': 'No encryption'}),
        weight=570,
        group='Participants',
        subgroup='PDF')

    # Email

    yield ConfigVariable(
        name='users_email_sender',
        default_value='*****@*****.**',
        input_type='string',
        label='Email sender',
        weight=600,
        group='Participants',
        subgroup='Email')

    yield ConfigVariable(
        name='users_email_subject',
        default_value='Your login for {event_name}',
        input_type='string',
        label='Email subject',
        help_text='You can use {event_name} as a placeholder.',
        weight=605,
        group='Participants',
        subgroup='Email')

    yield ConfigVariable(
        name='users_email_body',
        default_value=dedent('''\
            Dear {name},

            this is your OpenSlides login for the event {event_name}:

                {url}
                username: {username}
                password: {password}

            This email was generated automatically.'''),
        input_type='text',
        label='Email body',
        help_text='Use these placeholders: {name}, {event_name}, {url}, {username}, {password}. The url referrs to the system url.',
        weight=610,
        group='Participants',
        subgroup='Email')
def get_config_variables():
    """
    Generator which yields all config variables of this app.

    They are grouped in 'Sorting' and 'PDF'. The generator has to be evaluated
    during app loading (see apps.py).
    """
    # Sorting
    yield ConfigVariable(
        name="users_sort_by",
        default_value="first_name",
        input_type="choice",
        label="Sort name of participants by",
        choices=(
            {
                "value": "first_name",
                "display_name": "Given name"
            },
            {
                "value": "last_name",
                "display_name": "Surname"
            },
            {
                "value": "number",
                "display_name": "Participant number"
            },
        ),
        weight=510,
        group="Participants",
    )

    yield ConfigVariable(
        name="users_enable_presence_view",
        default_value=False,
        input_type="boolean",
        label="Enable participant presence view",
        weight=511,
        group="Participants",
    )

    yield ConfigVariable(
        name="users_allow_self_set_present",
        default_value=False,
        input_type="boolean",
        label="Allow users to set themselves as present",
        help_text="e.g. for online meetings",
        weight=512,
        group="Participants",
    )

    yield ConfigVariable(
        name="users_activate_vote_weight",
        default_value=False,
        input_type="boolean",
        label="Activate vote weight",
        weight=513,
        group="Participants",
    )

    # PDF

    yield ConfigVariable(
        name="users_pdf_welcometitle",
        default_value="Welcome to OpenSlides",
        label="Title for access data and welcome PDF",
        weight=520,
        group="Participants",
        subgroup="PDF export",
    )

    yield ConfigVariable(
        name="users_pdf_welcometext",
        default_value="[Place for your welcome and help text.]",
        label="Help text for access data and welcome PDF",
        weight=530,
        group="Participants",
        subgroup="PDF export",
    )

    # TODO: Use Django's URLValidator here.
    yield ConfigVariable(
        name="users_pdf_url",
        default_value=os.getenv("INSTANCE_DOMAIN",
                                default="http://example.com:8000"),
        label="System URL",
        help_text="Used for QRCode in PDF of access data.",
        weight=540,
        group="Participants",
        subgroup="PDF export",
    )

    yield ConfigVariable(
        name="users_pdf_wlan_ssid",
        default_value="",
        label="WLAN name (SSID)",
        help_text="Used for WLAN QRCode in PDF of access data.",
        weight=550,
        group="Participants",
        subgroup="PDF export",
    )

    yield ConfigVariable(
        name="users_pdf_wlan_password",
        default_value="",
        label="WLAN password",
        help_text="Used for WLAN QRCode in PDF of access data.",
        weight=560,
        group="Participants",
        subgroup="PDF export",
    )

    yield ConfigVariable(
        name="users_pdf_wlan_encryption",
        default_value="",
        input_type="choice",
        label="WLAN encryption",
        help_text="Used for WLAN QRCode in PDF of access data.",
        choices=(
            {
                "value": "",
                "display_name": "---------"
            },
            {
                "value": "WEP",
                "display_name": "WEP"
            },
            {
                "value": "WPA",
                "display_name": "WPA/WPA2"
            },
            {
                "value": "nopass",
                "display_name": "No encryption"
            },
        ),
        weight=570,
        group="Participants",
        subgroup="PDF export",
    )

    # Email

    yield ConfigVariable(
        name="users_email_sender",
        default_value="OpenSlides",
        input_type="string",
        label="Sender name",
        help_text=
        "The sender address is defined in the OpenSlides server settings and should modified by administrator only.",
        weight=600,
        group="Participants",
        subgroup="Email",
    )

    yield ConfigVariable(
        name="users_email_replyto",
        default_value="",
        input_type="string",
        label="Reply address",
        weight=601,
        group="Participants",
        subgroup="Email",
    )

    yield ConfigVariable(
        name="users_email_subject",
        default_value="OpenSlides access data",
        input_type="string",
        label="Email subject",
        help_text="You can use {event_name} and {username} as placeholder.",
        weight=605,
        group="Participants",
        subgroup="Email",
    )

    yield ConfigVariable(
        name="users_email_body",
        default_value=dedent("""\
            Dear {name},

            this is your personal OpenSlides login:

                {url}
                username: {username}
                password: {password}

            This email was generated automatically."""),
        input_type="text",
        label="Email body",
        help_text=
        "Use these placeholders: {name}, {event_name}, {url}, {username}, {password}. The url referrs to the system url.",
        weight=610,
        group="Participants",
        subgroup="Email",
    )
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(
        name="general_event_name",
        default_value="OpenSlides",
        label="Event name",
        weight=110,
        group="General",
        subgroup="Event",
        validators=(MaxLengthValidator(100), ),
    )

    yield ConfigVariable(
        name="general_event_description",
        default_value="Presentation and assembly system",
        label="Short description of event",
        weight=115,
        group="General",
        subgroup="Event",
        validators=(MaxLengthValidator(100), ),
    )

    yield ConfigVariable(
        name="general_event_date",
        default_value="",
        label="Event date",
        weight=120,
        group="General",
        subgroup="Event",
    )

    yield ConfigVariable(
        name="general_event_location",
        default_value="",
        label="Event location",
        weight=125,
        group="General",
        subgroup="Event",
    )

    yield ConfigVariable(
        name="general_event_legal_notice",
        default_value='<a href="http://www.openslides.org">OpenSlides</a> is a '
        "free web based presentation and assembly system for "
        "visualizing and controlling agenda, motions and "
        "elections of an assembly.",
        input_type="markupText",
        label="Legal notice",
        weight=132,
        group="General",
        subgroup="Event",
    )

    yield ConfigVariable(
        name="general_event_privacy_policy",
        default_value="",
        input_type="markupText",
        label="Privacy policy",
        weight=132,
        group="General",
        subgroup="Event",
    )

    yield ConfigVariable(
        name="general_event_welcome_title",
        default_value="Welcome to OpenSlides",
        label="Front page title",
        weight=134,
        group="General",
        subgroup="Event",
    )

    yield ConfigVariable(
        name="general_event_welcome_text",
        default_value="[Space for your welcome text.]",
        input_type="markupText",
        label="Front page text",
        weight=136,
        group="General",
        subgroup="Event",
    )

    # General System

    yield ConfigVariable(
        name="general_system_enable_anonymous",
        default_value=False,
        input_type="boolean",
        label="Allow access for anonymous guest users",
        weight=138,
        group="General",
        subgroup="System",
    )

    yield ConfigVariable(
        name="general_login_info_text",
        default_value="",
        label="Show this text on the login page",
        weight=140,
        group="General",
        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"
            },
        ),
        weight=141,
        group="General",
        subgroup="System",
    )

    # General export settings

    yield ConfigVariable(
        name="general_csv_separator",
        default_value=",",
        label="Separator used for all csv exports and examples",
        weight=142,
        group="General",
        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=143,
        group="General",
        subgroup="Export",
    )

    yield ConfigVariable(
        name="general_export_pdf_pagenumber_alignment",
        default_value="center",
        input_type="choice",
        label="Page number alignment in PDF",
        choices=(
            {
                "value": "left",
                "display_name": "Left"
            },
            {
                "value": "center",
                "display_name": "Center"
            },
            {
                "value": "right",
                "display_name": "Right"
            },
        ),
        weight=144,
        group="General",
        subgroup="Export",
    )

    yield ConfigVariable(
        name="general_export_pdf_fontsize",
        default_value="10",
        input_type="choice",
        label="Standard font size in PDF",
        choices=(
            {
                "value": "10",
                "display_name": "10"
            },
            {
                "value": "11",
                "display_name": "11"
            },
            {
                "value": "12",
                "display_name": "12"
            },
        ),
        weight=146,
        group="General",
        subgroup="Export",
    )

    # Projector

    yield ConfigVariable(
        name="projector_language",
        default_value="browser",
        input_type="choice",
        label="Projector language",
        choices=(
            {
                "value": "browser",
                "display_name": "Current browser language"
            },
            {
                "value": "en",
                "display_name": "English"
            },
            {
                "value": "de",
                "display_name": "Deutsch"
            },
            {
                "value": "fr",
                "display_name": "Français"
            },
            {
                "value": "es",
                "display_name": "Español"
            },
            {
                "value": "pt",
                "display_name": "Português"
            },
            {
                "value": "cs",
                "display_name": "Čeština"
            },
            {
                "value": "ru",
                "display_name": "русский"
            },
        ),
        weight=150,
        group="Projector",
    )

    yield ConfigVariable(
        name="projector_default_countdown",
        default_value=60,
        input_type="integer",
        label="Predefined seconds of new countdowns",
        weight=185,
        group="Projector",
    )

    yield ConfigVariable(
        name="projector_currentListOfSpeakers_reference",
        default_value=1,
        input_type="integer",
        label="Projector reference for list of speakers",
        weight=201,
        group="Projector",
        hidden=True,
    )

    # Logos.
    yield ConfigVariable(
        name="logos_available",
        default_value=[
            "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",
        ],
        weight=300,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_projector_main",
        default_value={
            "display_name": "Projector logo",
            "path": ""
        },
        input_type="static",
        weight=301,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_projector_header",
        default_value={
            "display_name": "Projector header image",
            "path": ""
        },
        input_type="static",
        weight=302,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_web_header",
        default_value={
            "display_name": "Web interface header logo",
            "path": ""
        },
        input_type="static",
        weight=303,
        group="Logo",
        hidden=True,
    )

    # PDF logos
    yield ConfigVariable(
        name="logo_pdf_header_L",
        default_value={
            "display_name": "PDF header logo (left)",
            "path": ""
        },
        input_type="static",
        weight=310,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_pdf_header_R",
        default_value={
            "display_name": "PDF header logo (right)",
            "path": ""
        },
        input_type="static",
        weight=311,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_pdf_footer_L",
        default_value={
            "display_name": "PDF footer logo (left)",
            "path": ""
        },
        input_type="static",
        weight=312,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_pdf_footer_R",
        default_value={
            "display_name": "PDF footer logo (right)",
            "path": ""
        },
        input_type="static",
        weight=313,
        group="Logo",
        hidden=True,
    )

    yield ConfigVariable(
        name="logo_pdf_ballot_paper",
        default_value={
            "display_name": "PDF ballot paper logo",
            "path": ""
        },
        input_type="static",
        weight=314,
        group="Logo",
        hidden=True,
    )

    # Fonts
    yield ConfigVariable(
        name="fonts_available",
        default_value=[
            "font_regular", "font_italic", "font_bold", "font_bold_italic"
        ],
        weight=320,
        group="Font",
        hidden=True,
    )

    yield ConfigVariable(
        name="font_regular",
        default_value={
            "display_name": "Font regular",
            "default": "assets/fonts/fira-sans-latin-400.woff",
            "path": "",
        },
        input_type="static",
        weight=321,
        group="Font",
        hidden=True,
    )

    yield ConfigVariable(
        name="font_italic",
        default_value={
            "display_name": "Font italic",
            "default": "assets/fonts/fira-sans-latin-400italic.woff",
            "path": "",
        },
        input_type="static",
        weight=321,
        group="Font",
        hidden=True,
    )

    yield ConfigVariable(
        name="font_bold",
        default_value={
            "display_name": "Font bold",
            "default": "assets/fonts/fira-sans-latin-500.woff",
            "path": "",
        },
        input_type="static",
        weight=321,
        group="Font",
        hidden=True,
    )

    yield ConfigVariable(
        name="font_bold_italic",
        default_value={
            "display_name": "Font bold italic",
            "default": "assets/fonts/fira-sans-latin-500italic.woff",
            "path": "",
        },
        input_type="static",
        weight=321,
        group="Font",
        hidden=True,
    )

    # Custom translations
    yield ConfigVariable(
        name="translations",
        label="Custom translations",
        default_value=[],
        input_type="translations",
        weight=1000,
        group="Custom translations",
    )
def get_config_variables():
    """
    Generator which yields all config variables of this app.
    It has to be evaluated during app loading (see apps.py).
    """
    # General
    yield ConfigVariable(name='voting_enable_proxies',
                         default_value=False,
                         input_type='boolean',
                         label='Enable proxies and absentee votes',
                         weight=615,
                         group='OpenSlides-Voting',
                         subgroup='General')
    yield ConfigVariable(name='voting_enable_principles',
                         default_value=False,
                         input_type='boolean',
                         label='Enable voting shares',
                         weight=617,
                         group='OpenSlides-Voting',
                         subgroup='General')
    choices = [{'value': c[0], 'display_name': c[1]} for c in POLLTYPES]
    yield ConfigVariable(name='voting_default_voting_type',
                         default_value='analog',
                         input_type='choice',
                         label='Default voting type',
                         choices=choices,
                         weight=620,
                         group='OpenSlides-Voting',
                         subgroup='General')
    yield ConfigVariable(
        name='voting_auto_countdown',
        default_value=False,
        input_type='boolean',
        label='Use countdown timer',
        help_text=
        'Auto-start and stop a countdown timer when voting starts and stops.',
        weight=630,
        group='OpenSlides-Voting',
        subgroup='General')
    yield ConfigVariable(name='voting_start_prompt_motions',
                         default_value=ugettext_noop('Please vote now!'),
                         label='Projector message for running motion voting',
                         weight=635,
                         group='OpenSlides-Voting',
                         subgroup='General')
    yield ConfigVariable(name='voting_start_prompt_assignments',
                         default_value=ugettext_noop('Please vote now!'),
                         label='Projector message for running election',
                         weight=640,
                         group='OpenSlides-Voting',
                         subgroup='General')

    # VoteCollector
    yield ConfigVariable(name='voting_enable_votecollector',
                         default_value=False,
                         input_type='boolean',
                         label='Enable VoteCollector',
                         weight=650,
                         group='OpenSlides-Voting',
                         subgroup='VoteCollector')
    yield ConfigVariable(
        # TODO: Use URL validator.
        name='voting_votecollector_uri',
        default_value='http://localhost:8030',
        label='VoteCollector URL',
        help_text='Example: http://localhost:8030',
        weight=655,
        group='OpenSlides-Voting',
        subgroup='VoteCollector')

    # Delegate board
    yield ConfigVariable(
        name='voting_show_delegate_board',
        default_value=True,
        input_type='boolean',
        label='Show delegate board',
        help_text='Show incoming votes in a table on projector.',
        weight=660,
        group='OpenSlides-Voting',
        subgroup='Delegate board')
    yield ConfigVariable(name='voting_delegate_board_columns',
                         default_value=10,
                         input_type='integer',
                         label='Number of columns of delegate board',
                         weight=670,
                         group='OpenSlides-Voting',
                         subgroup='Delegate board')
    yield ConfigVariable(name='voting_delegate_board_name',
                         default_value='short_name',
                         input_type='choice',
                         label='Delegate name format used for delegate board',
                         choices=(
                             {
                                 'value': 'short_name',
                                 'display_name': 'Short name (e.g. "JoSm")'
                             },
                             {
                                 'value': 'last_name',
                                 'display_name': 'Last name (e.g. "Smith")'
                             },
                             {
                                 'value': 'full_name',
                                 'display_name':
                                 'Full name (e.g. "John Smith")'
                             },
                         ),
                         weight=680,
                         group='OpenSlides-Voting',
                         subgroup='Delegate board')
    yield ConfigVariable(
        name='voting_anonymous',
        default_value=False,
        input_type='boolean',
        label='Vote anonymously',
        help_text=
        'Keep individual voting behaviour secret on delegate board by using a single colour.',
        weight=690,
        group='OpenSlides-Voting',
        subgroup='Delegate board')