def setup_motion_config(sender, **kwargs): """ Motion config variables. """ # General motion_workflow = ConfigVariable( name='motion_workflow', default_value=1, form_field=forms.ChoiceField( widget=forms.Select(), label=ugettext_lazy('Workflow of new motions'), required=True, choices=[(workflow.pk, ugettext_lazy(workflow.name)) for workflow in Workflow.objects.all()])) motion_identifier = ConfigVariable( name='motion_identifier', default_value='per_category', form_field=forms.ChoiceField( widget=forms.Select(), required=True, label=ugettext_lazy('Identifier'), choices=[('per_category', ugettext_lazy('Numbered per category')), ('serially_numbered', ugettext_lazy('Serially numbered')), ('manually', ugettext_lazy('Set it manually'))])) motion_preamble = ConfigVariable( name='motion_preamble', default_value=_('The assembly may decide,'), translatable=True, form_field=forms.CharField(widget=forms.TextInput(), required=False, label=ugettext_lazy('Motion preamble'))) motion_stop_submitting = ConfigVariable( name='motion_stop_submitting', default_value=False, form_field=forms.BooleanField(label=ugettext_lazy( 'Stop submitting new motions by non-staff users'), required=False)) motion_allow_disable_versioning = ConfigVariable( name='motion_allow_disable_versioning', default_value=False, form_field=forms.BooleanField( label=ugettext_lazy('Allow to disable versioning'), required=False)) group_general = ConfigGroup( title=ugettext_lazy('General'), variables=(motion_workflow, motion_identifier, motion_preamble, motion_stop_submitting, motion_allow_disable_versioning)) # Supporters motion_min_supporters = ConfigVariable( name='motion_min_supporters', default_value=0, form_field=forms.IntegerField( widget=forms.TextInput(attrs={'class': 'small-input'}), label=ugettext_lazy( 'Number of (minimum) required supporters for a motion'), min_value=0, help_text=ugettext_lazy( 'Choose 0 to disable the supporting system.'))) motion_remove_supporters = ConfigVariable( name='motion_remove_supporters', default_value=False, form_field=forms.BooleanField(label=ugettext_lazy( 'Remove all supporters of a motion if a submitter edits his motion in early state' ), required=False)) group_supporters = ConfigGroup(title=ugettext_lazy('Supporters'), variables=(motion_min_supporters, motion_remove_supporters)) # Voting and ballot papers motion_poll_100_percent_base = ConfigVariable( name='motion_poll_100_percent_base', default_value='WITHOUT_INVALID', form_field=forms.ChoiceField( widget=forms.Select(), required=False, label=ugettext_lazy( 'The 100 % base of a voting result consists of'), choices=PERCENT_BASE_CHOICES)) motion_pdf_ballot_papers_selection = ConfigVariable( name='motion_pdf_ballot_papers_selection', default_value='CUSTOM_NUMBER', form_field=forms.ChoiceField( widget=forms.Select(), required=False, label=ugettext_lazy('Number of ballot papers (selection)'), choices=[('NUMBER_OF_DELEGATES', ugettext_lazy('Number of all delegates')), ('NUMBER_OF_ALL_PARTICIPANTS', ugettext_lazy('Number of all participants')), ('CUSTOM_NUMBER', ugettext_lazy("Use the following custom number"))])) motion_pdf_ballot_papers_number = ConfigVariable( name='motion_pdf_ballot_papers_number', default_value=8, form_field=forms.IntegerField( widget=forms.TextInput(attrs={'class': 'small-input'}), required=False, min_value=1, label=ugettext_lazy('Custom number of ballot papers'))) group_ballot_papers = ConfigGroup( title=ugettext_lazy('Voting and ballot papers'), variables=(motion_poll_100_percent_base, motion_pdf_ballot_papers_selection, motion_pdf_ballot_papers_number)) # PDF motion_pdf_title = ConfigVariable( name='motion_pdf_title', default_value=_('Motions'), translatable=True, form_field=forms.CharField( widget=forms.TextInput(), required=False, label=ugettext_lazy('Title for PDF document (all motions)'))) motion_pdf_preamble = ConfigVariable( name='motion_pdf_preamble', default_value='', form_field=forms.CharField( widget=forms.Textarea(), required=False, label=ugettext_lazy( 'Preamble text for PDF document (all motions)'))) motion_pdf_paragraph_numbering = ConfigVariable( name='motion_pdf_paragraph_numbering', default_value=False, form_field=forms.BooleanField( label=ugettext_lazy('Show paragraph numbering (only in PDF)'), required=False)) group_pdf = ConfigGroup(title=ugettext_lazy('PDF'), variables=(motion_pdf_title, motion_pdf_preamble, motion_pdf_paragraph_numbering)) return ConfigGroupedCollection(title=ugettext_noop('Motion'), url='motion', required_permission='config.can_manage', weight=30, groups=(group_general, group_supporters, group_ballot_papers, group_pdf))
def setup_projector_config(sender, **kwargs): """ Projector config variables for OpenSlides. They are not shown on a config view. """ # The active slide. The config-value is a dictonary with at least the entry # 'callback'. projector = ConfigVariable(name='projector_active_slide', default_value={'callback': None}) projector_message = ConfigVariable(name='projector_message', default_value='') countdown_time = ConfigVariable(name='countdown_time', default_value=60) countdown_start_stamp = ConfigVariable(name='countdown_start_stamp', default_value=0) countdown_pause_stamp = ConfigVariable(name='countdown_pause_stamp', default_value=0) countdown_state = ConfigVariable(name='countdown_state', default_value='inactive') projector_scale = ConfigVariable(name='projector_scale', default_value=0) projector_scroll = ConfigVariable(name='projector_scroll', default_value=0) projector_js_cache = ConfigVariable(name='projector_js_cache', default_value={}) projector_active_overlays = ConfigVariable( name='projector_active_overlays', default_value=[]) projector_pdf_fullscreen = ConfigVariable(name='pdf_fullscreen', default_value=False) return ConfigCollection( required_permission=None, variables=(projector, projector_message, countdown_time, countdown_start_stamp, countdown_pause_stamp, countdown_state, projector_scale, projector_scroll, projector_active_overlays, projector_js_cache, projector_pdf_fullscreen))
def setup_agenda_config(sender, **kwargs): """ Agenda config variables. """ # TODO: Insert validator for the format or use other field carefully. agenda_start_event_date_time = ConfigVariable( name='agenda_start_event_date_time', default_value='', form_field=forms.CharField( validators=[ validate_start_time, ], widget=forms.DateTimeInput(format='%d.%m.%Y %H:%M'), required=False, label=ugettext_lazy('Begin of event'), help_text=ugettext_lazy('Input format: DD.MM.YYYY HH:MM'))) agenda_show_last_speakers = ConfigVariable( name='agenda_show_last_speakers', default_value=1, form_field=forms.IntegerField( min_value=0, label=ugettext_lazy( 'Number of last speakers to be shown on the projector'))) agenda_couple_countdown_and_speakers = ConfigVariable( name='agenda_couple_countdown_and_speakers', default_value=False, form_field=forms.BooleanField( label=ugettext_lazy('Couple countdown with the list of speakers'), help_text=ugettext_lazy( '[Begin speach] starts the countdown, [End speach] stops the countdown.' ), required=False)) agenda_number_prefix = ConfigVariable( name='agenda_number_prefix', default_value='', form_field=forms.CharField( label=ugettext_lazy('Numbering prefix for agenda items'), max_length=20, required=False)) agenda_numeral_system = ConfigVariable( name='agenda_numeral_system', default_value='arabic', form_field=forms.ChoiceField( label=ugettext_lazy('Numeral system for agenda items'), widget=forms.Select(), choices=(('arabic', ugettext_lazy('Arabic')), ('roman', ugettext_lazy('Roman'))), required=False)) extra_stylefiles = ['css/jquery-ui-timepicker.css'] extra_javascript = [ 'js/jquery/jquery-ui-timepicker-addon.min.js', 'js/jquery/jquery-ui-sliderAccess.min.js', 'js/jquery/datepicker-config.js' ] return ConfigCollection( title=ugettext_noop('Agenda'), url='agenda', weight=20, variables=(agenda_start_event_date_time, agenda_show_last_speakers, agenda_couple_countdown_and_speakers, agenda_number_prefix, agenda_numeral_system), extra_context={ 'extra_stylefiles': extra_stylefiles, 'extra_javascript': extra_javascript })
def setup_general_config(sender, **kwargs): """ General config variables for OpenSlides. They are grouped in 'Event', 'Welcome Widget' and 'System'. """ event_name = ConfigVariable(name='event_name', default_value='OpenSlides', form_field=forms.CharField( widget=forms.TextInput(), label=ugettext_lazy('Event name'), max_length=50)) event_description = ConfigVariable( name='event_description', default_value=_('Presentation and assembly system'), translatable=True, form_field=forms.CharField( widget=forms.TextInput(), label=ugettext_lazy('Short description of event'), required=False, max_length=100)) event_date = ConfigVariable(name='event_date', default_value='', form_field=forms.CharField( widget=forms.TextInput(), label=ugettext_lazy('Event date'), required=False)) event_location = ConfigVariable(name='event_location', default_value='', form_field=forms.CharField( widget=forms.TextInput(), label=ugettext_lazy('Event location'), required=False)) event_organizer = ConfigVariable( name='event_organizer', default_value='', form_field=forms.CharField(widget=forms.TextInput(), label=ugettext_lazy('Event organizer'), required=False)) projector_enable_logo = ConfigVariable( name='projector_enable_logo', default_value=True, form_field=forms.BooleanField( label=ugettext_lazy('Show logo on projector'), help_text=ugettext_lazy( 'You can find and replace the logo under "openslides/projector/static/img/logo-projector.png".' ), required=False)) projector_enable_title = ConfigVariable( name='projector_enable_title', default_value=True, form_field=forms.BooleanField(label=ugettext_lazy( 'Show title and description of event on projector'), required=False)) projector_backgroundcolor1 = ConfigVariable( name='projector_backgroundcolor1', default_value='#444444', form_field=forms.CharField( widget=forms.TextInput(), label=ugettext_lazy('Background color of projector header'), help_text=ugettext_lazy( 'Use web color names like "red" or hex numbers like "#ff0000".' ), required=True)) projector_backgroundcolor2 = ConfigVariable( name='projector_backgroundcolor2', default_value='#222222', form_field=forms.CharField( widget=forms.TextInput(), label=ugettext_lazy( 'Second (optional) background color for linear color gradient' ), help_text=ugettext_lazy( 'Use web color names like "red" or hex numbers like "#ff0000".' ), required=False)) projector_fontcolor = ConfigVariable( name='projector_fontcolor', default_value='#F5F5F5', form_field=forms.CharField( widget=forms.TextInput(), label=ugettext_lazy('Font color of projector header'), help_text=ugettext_lazy( 'Use web color names like "red" or hex numbers like "#ff0000".' ), required=True)) welcome_title = ConfigVariable( name='welcome_title', default_value=_('Welcome to OpenSlides'), translatable=True, form_field=forms.CharField( widget=forms.TextInput(), label=ugettext_lazy('Title'), help_text=ugettext_lazy( 'Also used for the default welcome slide.'), required=False), on_change=update_projector) welcome_text = ConfigVariable( name='welcome_text', default_value=_('[Place for your welcome text.]'), translatable=True, form_field=forms.CharField(widget=forms.Textarea(), label=ugettext_lazy('Welcome text'), required=False)) system_enable_anonymous = ConfigVariable( name='system_enable_anonymous', default_value=False, form_field=forms.BooleanField( label=ugettext_lazy('Allow access for anonymous guest users'), required=False)) group_event = ConfigGroup(title=ugettext_lazy('Event'), variables=(event_name, event_description, event_date, event_location, event_organizer)) group_projector = ConfigGroup( title=ugettext_lazy('Projector'), variables=(projector_enable_logo, projector_enable_title, projector_backgroundcolor1, projector_backgroundcolor2, projector_fontcolor)) group_welcome_widget = ConfigGroup(title=ugettext_lazy('Welcome Widget'), variables=(welcome_title, welcome_text)) group_system = ConfigGroup(title=ugettext_lazy('System'), variables=(system_enable_anonymous, )) return ConfigGroupedCollection(title=ugettext_noop('General'), url='general', required_permission='config.can_manage', weight=10, groups=(group_event, group_projector, group_welcome_widget, group_system))
def setup_general_config_page(sender, **kwargs): """ General config variables for OpenSlides. They are grouped in 'Event', 'Welcome Widget' and 'System'. """ event_name = ConfigVariable(name='event_name', default_value='OpenSlides', form_field=forms.CharField( widget=forms.TextInput(), label=ugettext_lazy('Event name'), max_length=50)) event_description = ConfigVariable( name='event_description', default_value=_('Presentation and assembly system'), form_field=forms.CharField( widget=forms.TextInput(), label=ugettext_lazy('Short description of event'), required=False, max_length=100)) event_date = ConfigVariable(name='event_date', default_value='', form_field=forms.CharField( widget=forms.TextInput(), label=ugettext_lazy('Event date'), required=False)) event_location = ConfigVariable(name='event_location', default_value='', form_field=forms.CharField( widget=forms.TextInput(), label=ugettext_lazy('Event location'), required=False)) event_organizer = ConfigVariable( name='event_organizer', default_value='', form_field=forms.CharField(widget=forms.TextInput(), label=ugettext_lazy('Event organizer'), required=False)) welcome_title = ConfigVariable(name='welcome_title', default_value=_('Welcome to OpenSlides'), form_field=forms.CharField( widget=forms.TextInput(), label=ugettext_lazy('Title'), required=False)) welcome_text = ConfigVariable( name='welcome_text', default_value=_('[Place for your welcome text.]'), form_field=forms.CharField(widget=forms.Textarea(), label=ugettext_lazy('Welcome text'), required=False)) system_enable_anonymous = ConfigVariable( name='system_enable_anonymous', default_value=False, form_field=forms.BooleanField( label=ugettext_lazy('Allow access for anonymous guest users'), required=False)) group_event = ConfigGroup(title=ugettext_lazy('Event'), variables=(event_name, event_description, event_date, event_location, event_organizer)) group_welcome_widget = ConfigGroup(title=ugettext_lazy('Welcome Widget'), variables=(welcome_title, welcome_text)) group_system = ConfigGroup(title=ugettext_lazy('System'), variables=(system_enable_anonymous, )) return ConfigGroupedPage(title=ugettext_noop('General'), url='general', required_permission='config.can_manage', weight=10, groups=(group_event, group_welcome_widget, group_system))
def setup_assignment_config(sender, **kwargs): """ Assignment config variables. """ # Ballot and ballot papers assignment_poll_vote_values = ConfigVariable( name='assignment_poll_vote_values', default_value='auto', form_field=forms.ChoiceField( widget=forms.Select(), required=False, label=ugettext_lazy('Election method'), choices=(('auto', ugettext_lazy('Automatic assign of method')), ('votes', ugettext_lazy('Always one option per candidate')), ('yesnoabstain', ugettext_lazy('Always Yes-No-Abstain per candidate'))))) assignment_poll_100_percent_base = ConfigVariable( name='assignment_poll_100_percent_base', default_value='WITHOUT_INVALID', form_field=forms.ChoiceField( widget=forms.Select(), required=False, label=ugettext_lazy( 'The 100 % base of an election result consists of'), choices=PERCENT_BASE_CHOICES)) assignment_pdf_ballot_papers_selection = ConfigVariable( name='assignment_pdf_ballot_papers_selection', default_value='CUSTOM_NUMBER', form_field=forms.ChoiceField( widget=forms.Select(), required=False, label=ugettext_lazy('Number of ballot papers (selection)'), choices=(('NUMBER_OF_DELEGATES', ugettext_lazy('Number of all delegates')), ('NUMBER_OF_ALL_PARTICIPANTS', ugettext_lazy('Number of all participants')), ('CUSTOM_NUMBER', ugettext_lazy('Use the following custom number'))))) assignment_pdf_ballot_papers_number = ConfigVariable( name='assignment_pdf_ballot_papers_number', default_value=8, form_field=forms.IntegerField( widget=forms.TextInput(attrs={'class': 'small-input'}), required=False, min_value=1, label=ugettext_lazy('Custom number of ballot papers'))) assignment_publish_winner_results_only = ConfigVariable( name='assignment_publish_winner_results_only', default_value=False, form_field=forms.BooleanField( required=False, label=ugettext_lazy( 'Publish election result for elected candidates only ' '(projector view)'))) group_ballot = ConfigGroup( title=ugettext_lazy('Ballot and ballot papers'), variables=(assignment_poll_vote_values, assignment_poll_100_percent_base, assignment_pdf_ballot_papers_selection, assignment_pdf_ballot_papers_number, assignment_publish_winner_results_only)) # PDF assignment_pdf_title = ConfigVariable( name='assignment_pdf_title', default_value=_('Elections'), translatable=True, form_field=forms.CharField( widget=forms.TextInput(), required=False, label=ugettext_lazy('Title for PDF document (all elections)'))) assignment_pdf_preamble = ConfigVariable( name='assignment_pdf_preamble', default_value='', form_field=forms.CharField( widget=forms.Textarea(), required=False, label=ugettext_lazy( 'Preamble text for PDF document (all elections)'))) group_pdf = ConfigGroup(title=ugettext_lazy('PDF'), variables=(assignment_pdf_title, assignment_pdf_preamble)) return ConfigGroupedCollection(title=ugettext_noop('Elections'), url='assignment', weight=40, groups=(group_ballot, group_pdf))
def set_simple_config_page_disabled_page(sender, **kwargs): return ConfigPage(title='Ho5iengaoon5Hoht', url='testsimplepage3', required_permission='No permission required', variables=(ConfigVariable(name='hidden_config_var_2', default_value=''), ))
def setup_assignment_config_page(sender, **kwargs): """ Assignment config variables. """ assignment_publish_winner_results_only = ConfigVariable( name='assignment_publish_winner_results_only', default_value=False, form_field=forms.BooleanField( required=False, label=ugettext_lazy('Only publish voting results for selected ' 'winners (Projector view only)'))) assignment_pdf_ballot_papers_selection = ConfigVariable( name='assignment_pdf_ballot_papers_selection', default_value='CUSTOM_NUMBER', form_field=forms.ChoiceField( widget=forms.Select(), required=False, label=ugettext_lazy('Number of ballot papers (selection)'), choices=( ('NUMBER_OF_DELEGATES', ugettext_lazy('Number of all delegates')), ('NUMBER_OF_ALL_PARTICIPANTS', ugettext_lazy('Number of all participants')), ('CUSTOM_NUMBER', ugettext_lazy('Use the following custom number'))))) assignment_pdf_ballot_papers_number = ConfigVariable( name='assignment_pdf_ballot_papers_number', default_value=8, form_field=forms.IntegerField( widget=forms.TextInput(attrs={'class': 'small-input'}), required=False, min_value=1, label=ugettext_lazy('Custom number of ballot papers'))) assignment_pdf_title = ConfigVariable( name='assignment_pdf_title', default_value=_('Elections'), form_field=forms.CharField( widget=forms.TextInput(), required=False, label=ugettext_lazy('Title for PDF document (all elections)'))) assignment_pdf_preamble = ConfigVariable( name='assignment_pdf_preamble', default_value='', form_field=forms.CharField( widget=forms.Textarea(), required=False, label=ugettext_lazy('Preamble text for PDF document (all elections)'))) assignment_poll_vote_values = ConfigVariable( name='assignment_poll_vote_values', default_value='auto', form_field=forms.ChoiceField( widget=forms.Select(), required=False, label=ugettext_lazy('Election method'), choices=( ('auto', ugettext_lazy('Automatic assign of method')), ('votes', ugettext_lazy('Always one option per candidate')), ('yesnoabstain', ugettext_lazy('Always Yes-No-Abstain per candidate'))))) return ConfigPage(title=ugettext_noop('Elections'), url='assignment', required_permission='config.can_manage', weight=40, variables=(assignment_publish_winner_results_only, assignment_pdf_ballot_papers_selection, assignment_pdf_ballot_papers_number, assignment_pdf_title, assignment_pdf_preamble, assignment_poll_vote_values))
def setup_participant_config(sender, **kwargs): """ Participant config variables. """ # General participant_sort_users_by_first_name = ConfigVariable( name='participant_sort_users_by_first_name', default_value=False, form_field=forms.BooleanField( required=False, label=ugettext_lazy('Sort participants by first name'), help_text=ugettext_lazy('Disable for sorting by last name'))) group_general = ConfigGroup( title=ugettext_lazy('Sorting'), variables=(participant_sort_users_by_first_name, )) # PDF participant_pdf_welcometitle = ConfigVariable( name='participant_pdf_welcometitle', default_value=_('Welcome to OpenSlides!'), translatable=True, form_field=forms.CharField( widget=forms.Textarea(), required=False, label=ugettext_lazy('Title for access data and welcome PDF'))) participant_pdf_welcometext = ConfigVariable( name='participant_pdf_welcometext', default_value=_('[Place for your welcome and help text.]'), translatable=True, form_field=forms.CharField( widget=forms.Textarea(), required=False, label=ugettext_lazy('Help text for access data and welcome PDF'))) participant_pdf_url = ConfigVariable( name='participant_pdf_url', default_value='http://example.com:8000', form_field=forms.CharField( widget=forms.TextInput(), required=False, label=ugettext_lazy('System URL'), help_text=ugettext_lazy('Used for QRCode in PDF of access data.'))) participant_pdf_wlan_ssid = ConfigVariable( name='participant_pdf_wlan_ssid', default_value='', form_field=forms.CharField( widget=forms.TextInput(), required=False, label=ugettext_lazy('WLAN name (SSID)'), help_text=ugettext_lazy( 'Used for WLAN QRCode in PDF of access data.'))) participant_pdf_wlan_password = ConfigVariable( name='participant_pdf_wlan_password', default_value='', form_field=forms.CharField( widget=forms.TextInput(), required=False, label=ugettext_lazy('WLAN password'), help_text=ugettext_lazy( 'Used for WLAN QRCode in PDF of access data.'))) participant_pdf_wlan_encryption = ConfigVariable( name='participant_pdf_wlan_encryption', default_value='', form_field=forms.ChoiceField( widget=forms.Select(), required=False, label=ugettext_lazy('WLAN encryption'), help_text=ugettext_lazy( 'Used for WLAN QRCode in PDF of access data.'), choices=(('', '---------'), ('WEP', 'WEP'), ('WPA', 'WPA/WPA2'), ('nopass', ugettext_lazy('No encryption'))))) group_pdf = ConfigGroup( title=ugettext_lazy('PDF'), variables=(participant_pdf_welcometitle, participant_pdf_welcometext, participant_pdf_url, participant_pdf_wlan_ssid, participant_pdf_wlan_password, participant_pdf_wlan_encryption)) return ConfigGroupedCollection(title=ugettext_noop('Participant'), url='participant', required_permission='config.can_manage', weight=50, groups=(group_general, group_pdf))