{% extends "base.html" %} {% block title %}{{ _('Preferences') }} — {{ service_name }}{% endblock %} {% block sidebar %} {% endblock %} {% block content %}

{{ _('Preferences') }}

{{ _('Account Information') }}

{{ change_user_form.csrf_token() }}
{% if change_user_form.name.errors %} {{ change_user_form.name.errors[0] }} {% elif config['ENFORCE_SPLIT_NAMES'] and current_user.type.name.lower() == "person" and (change_user_form.name.data is none or ', ' not in change_user_form.name.data[1:-1]) %} {{ _("Please enter your name as: surname, given names.") }} {% endif %}
{% if change_user_form.email.errors %} {{ _('Please enter your email address.') }} {% endif %}
https://orcid.org/
{% if change_user_form.orcid.errors %} {{ _('Please enter your ORCID iD or leave this field blank.') }} {% endif %}
{% if change_user_form.affiliation.errors %} {{ _('Please enter your affiliation or leave this field blank.') }} {% endif %}
{% if change_user_form.role.errors %} {{ _('Please enter your role or leave this field blank.') }} {% endif %}
{% for extra_field_id, extra_field in EXTRA_USER_FIELDS.items() %}
{% endfor %}

{{ _('Authentication Methods')}}

{% for authentication in authentications %} {% endfor %}
{{ _('Username / Email') }} {{ _('Authentication Method')}}
{{authentication.login.get('login', authentication.login.get('description', ''))}} {{ {'ldap': 'LDAP', 'email': _('Email'), 'other': _('Other'), 'fido2_passkey': _('FIDO2 Passkey')}[authentication.type.name.lower()] }}
{{ authentication_method_form.csrf_token() }} {% if error %} {{error}} {%endif%} {% if authentications|length > 1 %} {% if confirmed_authentication_methods > 1 %} {% if authentication.type.name.lower() != 'ldap' and authentication.type.name.lower() != 'fido2_passkey' %} {% endif %} {% else %} {% if authentication.confirmed %} {% if authentication.type.name.lower() != 'ldap' and authentication.type.name.lower() != 'fido2_passkey' %} {% endif %} {% else %} {% endif %} {% endif %} {% else %} {% if authentication.confirmed and authentication.type.name.lower() != 'ldap' and authentication.type.name.lower() != 'fido2_passkey' %} {% endif %} {% endif %}

{{ _('API Tokens')}}

{{ _('Note:')}} {{ _('API tokens are an authentication method for use with the HTTP API.')}}

{% if api_tokens %} {% for authentication in api_tokens %} {% endfor %} {% endif %}
{{ _('Description') }}
{{ authentication.login['description'] }} {{ _('View Log')}}
{{ authentication_method_form.csrf_token() }}
{% if api_access_tokens %}

{{ _('API Access Tokens')}}

{{ _('Note:')}} {{ _('API access tokens are short-lived tokens for the use by interactive applications or scripts to authenticate with the HTTP API.')}}

{% for authentication in api_access_tokens %} {% endfor %}
{{ _('Description') }} {{ _('Expiration Datetime') }}
{{ authentication.login['description'] }} {{ authentication.login['expiration_utc_datetime'] | babel_format_datetime }} {{ _('View Log')}}
{{ authentication_method_form.csrf_token() }}
{% endif %}

{{ _('Two-Factor Authentication') }}

{% if two_factor_authentication_methods %} {% for method in two_factor_authentication_methods %} {% endfor %}
{{ _('Description') }}
{% if method.data.description %} {{ method.data.description }} {% elif method.data.type == 'totp' %} {{ _('TOTP-based Two-Factor Authentication') }} {% elif method.data.type == 'fido2_passkey' %} {{ _('FIDO2 Passkey') }} {% else %} {{ _('Unknown Two-Factor Authentication Method') }} {% endif %}
{{ manage_two_factor_authentication_method_form.hidden_tag() }} {% if method.active %} {% else %} {% endif %}
{% endif %}
{{ _('Set up TOTP-based Two-Factor Authentication') }} {{ _('Set up FIDO2 Passkey for Two-Factor Authentication') }}
{% if may_use_webhooks %}

{{ _('Webhooks') }}

{{ _('Note:')}} {{ _('Webhooks allow you to subscribe to the object log, as described in the documentation.')}}

{% if webhooks | length == 0 %} {{ _('You have not yet created any webhooks.') }} {% else %} {% for webhook in webhooks %} {% endfor %} {% endif %}
{{ _('Name') }} {{ _('Address') }} {{ _('Last Contact') }}
{{ webhook.name }} {{ webhook.target_url }} {% if not webhook.last_contact %}—{% else %}{{ webhook.last_contact }}{% endif %}
{{ remove_webhook_form.csrf_token() }}
{% endif %}

{{ _('Notification Settings')}}

{{ _('Note:')}} {{ _('%(service_name)s will notify you about various events. By default, these notifications will be sent using the %(service_name)s notification system, but you can also chose to receive them via email or decide to ignore some notification types.', service_name=service_name) }}

{{ notification_mode_form.csrf_token }} {% set notification_types = { NotificationType.ANNOUNCEMENT: (_("Announcements"), False), NotificationType.ASSIGNED_AS_RESPONSIBLE_USER: (_("Becoming responsible for an object"), True), NotificationType.RESPONSIBILITY_ASSIGNMENT_DECLINED: (_("Responsibility for an object being declined"), True), NotificationType.INVITED_TO_GROUP: (_("Being invited to a basic group"), False), NotificationType.INVITED_TO_PROJECT: (_("Being invited to a project group"), False), NotificationType.RECEIVED_OBJECT_PERMISSIONS_REQUEST: (_("Receiving object permission requests"), False), NotificationType.INSTRUMENT_LOG_ENTRY_CREATED: (_("Receiving a new instrument log entry"), True), NotificationType.INSTRUMENT_LOG_ENTRY_EDITED: (_("Receiving an edit to an instrument log"), True), NotificationType.REFERENCED_BY_OBJECT_METADATA: (_("Being referenced in object metadata"), True), NotificationType.REMOTE_OBJECT_IMPORT_FAILED: (_("Failure of importing an object into another database"), False), NotificationType.REMOTE_OBJECT_IMPORT_NOTES: (_("Receiving notes after importing an object into another database"), True), NotificationType.AUTOMATIC_USER_FEDERATION: (_("Being automatically linked with a user from another database"), True), NotificationType.OTHER: (_("Other"), False) } %} {% set instrument_related_notification_types = [NotificationType.INSTRUMENT_LOG_ENTRY_CREATED, NotificationType.INSTRUMENT_LOG_ENTRY_EDITED]%} {% for notification_type in notification_types %} {% set notification_description = notification_types[notification_type][0] %} {% set notification_can_be_ignored = notification_types[notification_type][1] %} {% if notification_type not in instrument_related_notification_types %} {% for notification_mode in [NotificationMode.IGNORE, NotificationMode.WEBAPP, NotificationMode.EMAIL] %} {% endfor %} {% endif %} {% endfor %}
{{ _('Notification Type')}} {{ _('Ignore') }} {{ _('Web') }} {{ _('Email') }}
{{ notification_description }} {% if notification_mode != NotificationMode.IGNORE or notification_can_be_ignored %} {% endif %}

{{ _('Default Permissions')}}

{{ _('Note:') }} {{ _('These permissions will be used for objects that you create in the future. To change the permissions for an already existing object, please use the Edit permissions button on the object\'s site.') }}

{% set user_may_edit = not current_user.is_readonly %} {% set form_url = url_for('.user_preferences', user_id=current_user.id) %} {% set permissions_form = default_permissions_form %} {% set fixed_user_permissions = {current_user.id: Permissions.GRANT} %} {% set show_administrators = True %} {% set show_instrument_scientists = True %} {% set show_all_users = True %} {% set read_permissions_description = _('Permission to view objects and their properties, files and comments.') %} {% set write_permissions_description = _('Permission to edit objects and their properties and add files and comments. Includes Read permissions.') %} {% set grant_permissions_description = _('Permission to grant permissions to other users. Includes Write permissions.') %} {% include "permissions/permissions.html" %}

{{ _('Other Settings') }}

{% if user_settings['DATAVERSE_API_TOKEN'] %}
{% endif %}
{{ other_settings_form.csrf_token }}
{% if not config['TIMEZONE'] %}
{% endif %}
{% if user.is_admin %}

{{ _('Administrator Settings') }}

{% endif %}
{% for authentication in authentications %} {% endfor %} {% if created_api_token %} {% endif %} {% if may_use_webhooks %} {% if webhook_secret %} {% endif %} {% endif %} {% endblock %} {% block template_values %} {% do set_template_value("fido2_options", dict(options)) %} {% do set_template_value("translations.passkey_failed", _('The passkey failed to register with the following error: ')) %} {% do set_template_value("translations.enter_at_least_1_character", _('Please enter at least 1 character.')) %} {% do set_template_value("translations.copied", _('Copied!')) %} {% do set_template_value("translations.could_not_copy", _('Could not copy to clipboard, please use Ctrl+C.')) %} {% do set_template_value("config.timezone_not_set", not config['TIMEZONE']) %} {% do set_template_value("has_created_api_token", created_api_token is not none) %} {% do set_template_value("show_api_token_modal", create_api_token_form.description.errors | length > 0) %} {% do set_template_value("show_add_webhook_form", show_add_form) %} {% do set_template_value("has_created_webhook_secret", webhook_secret is not none) %} {{ super() }} {% endblock %} {% block scripts %} {{ super() }} {% endblock %} {% block stylesheets %} {{ super() }} {% endblock %}