class CitadelSettingsForm(IndicoForm): search_backend_url = URLField( _('Citadel URL'), [DataRequired(), URL(require_tld=False)], description=_('The URL of the Citadel server')) search_backend_token = IndicoPasswordField( _('Citadel API token'), [DataRequired()], toggle=True, description=_('The authentication token to access Citadel')) file_extensions = TextListField( _('File extensions'), description=_('File extensions to upload for full-text search')) max_file_size = IntegerField( _('Max. file size'), [DataRequired(), NumberRange(min=1)], description= _('Maximum size (in MB) to upload for full-text search. Note that ' 'increasing this after the initial export will upload all files ' 'for indexing that have not been uploaded before during the next queue ' 'run, which may take a long time on larger instances. You may want ' 'to run a manual upload for the new file size first!')) num_threads_records = IntegerField( _('Parallel threads (records)'), [NumberRange(min=1, max=500)], description=_('Number of threads to use when uploading records.')) num_threads_records_initial = IntegerField( _('Parallel threads (records, initial export)'), [NumberRange(min=1, max=500)], description=_('Number of threads to use when uploading records during ' 'the initial export.')) num_threads_files = IntegerField( _('Parallel threads (files)'), [NumberRange(min=1, max=500)], description=_('Number of threads to use when uploading files.')) num_threads_files_initial = IntegerField( _('Parallel threads (files, initial export)'), [NumberRange(min=1, max=500)], description=_('Number of threads to use when uploading files during ' 'the initial export.')) disable_search = BooleanField( _('Disable search'), widget=SwitchWidget(), description= _('This disables the search integration of the plugin. When this option ' 'is used, the internal Indico search interface will be used. This may ' 'be useful when you are still running a larger initial export and do ' 'not want people to get incomplete search results during that time.' ))
class SettingsForm(IndicoForm): maintenance = BooleanField( _('Maintenance'), widget=SwitchWidget(), description=_( 'Temporarily disable submitting files. The tasks will be kept and once ' 'this setting is disabled the files will be submitted.')) server_url = URLField( _('Server URL'), [DataRequired()], description=_( "The URL to the conversion server's uploadFile.py script.")) valid_extensions = TextListField( _('Extensions'), filters=[ lambda exts: sorted( {ext.lower().lstrip('.').strip() for ext in exts}) ], description=_('File extensions for which PDF conversion is supported. ' 'One extension per line.'))
class PluginSettingsForm(VCPluginSettingsFormBase): _fieldsets = [ (_('API Credentials'), ['api_key', 'api_secret', 'webhook_token']), (_('Zoom Account'), [ 'user_lookup_mode', 'email_domains', 'authenticators', 'enterprise_domain', 'allow_webinars' ]), (_('Room Settings'), [ 'mute_audio', 'mute_host_video', 'mute_participant_video', 'join_before_host', 'waiting_room' ]), (_('Notifications'), ['creation_email_footer', 'send_host_url', 'notification_emails']), (_('Access'), ['managers', 'acl']) ] api_key = StringField(_('API Key'), [DataRequired()]) api_secret = IndicoPasswordField(_('API Secret'), [DataRequired()], toggle=True) webhook_token = IndicoPasswordField( _('Webhook Token'), toggle=True, description=_("Specify Zoom's webhook token if you want live updates")) user_lookup_mode = IndicoEnumSelectField( _('User lookup mode'), [DataRequired()], enum=UserLookupMode, description=_('Specify how Indico should look up the zoom user that ' 'corresponds to an Indico user.')) email_domains = TextListField( _('E-mail domains'), [ HiddenUnless('user_lookup_mode', UserLookupMode.email_domains), DataRequired() ], description= _('List of e-mail domains which can use the Zoom API. Indico attempts ' 'to find Zoom accounts using all email addresses of a user which use ' 'those domains.')) authenticators = TextListField( _('Indico identity providers'), [ HiddenUnless('user_lookup_mode', UserLookupMode.authenticators), DataRequired() ], description= _('Identity providers from which to get usernames. ' 'Indico queries those providers using the email addresses of the user ' 'and attempts to find Zoom accounts having an email address with the ' 'format username@enterprise-domain.')) enterprise_domain = StringField( _('Enterprise domain'), [ HiddenUnless('user_lookup_mode', UserLookupMode.authenticators), DataRequired() ], description=_( 'The domain name used together with the usernames from the Indico ' 'identity provider')) allow_webinars = BooleanField( _('Allow Webinars (Experimental)'), widget=SwitchWidget(), description=_( 'Allow webinars to be created through Indico. Use at your own risk.' )) mute_audio = BooleanField( _('Mute audio'), widget=SwitchWidget(), description=_('Participants will join the VC room muted by default ')) mute_host_video = BooleanField( _('Mute video (host)'), widget=SwitchWidget(), description=_('The host will join the VC room with video disabled')) mute_participant_video = BooleanField( _('Mute video (participants)'), widget=SwitchWidget(), description=_( 'Participants will join the VC room with video disabled')) join_before_host = BooleanField( _('Join Before Host'), widget=SwitchWidget(), description=_( 'Allow participants to join the meeting before the host starts the ' 'meeting. Only used for scheduled or recurring meetings.')) waiting_room = BooleanField( _('Waiting room'), widget=SwitchWidget(), description=_( 'Participants may be kept in a waiting room by the host')) creation_email_footer = TextAreaField( _('Creation email footer'), widget=CKEditorWidget(), description=_( 'Footer to append to emails sent upon creation of a VC room')) send_host_url = BooleanField( _('Send host URL'), widget=SwitchWidget(), description=_( 'Whether to send an e-mail with the Host URL to the meeting host upon ' 'creation of a meeting')) def validate_authenticators(self, field): invalid = set(field.data) - set(multipass.identity_providers) if invalid: raise ValidationError( _('Invalid identity providers: {}').format( escape(', '.join(invalid))))