{% extends "base.html" %} {% block title %}{{ _('Preferences') }} — {{ service_name }}{% 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['login']}} {{ {'ldap': 'LDAP', 'email': _('Email'), 'other': _('Other')}[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' %} {% endif %} {% else %} {% if authentication.confirmed %} {% if authentication.type.name.lower() != 'ldap' %} {% endif %} {% else %} {% endif %} {% endif %} {% else %} {% if authentication.confirmed and authentication.type.name.lower() != 'ldap' %} {% 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() }}

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

{% if two_factor_authentication_methods %} {% for method in two_factor_authentication_methods %} {% endfor %}
{{ _('Description') }}
{% if method.data.type == 'totp' %} {{ _('TOTP-based Two Factor Authentication') }} {% 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') }}

{{ _('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.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.OTHER: (_("Other"), False) } %} {% for notification_type in notification_types %} {% set notification_description = notification_types[notification_type][0] %} {% set notification_can_be_ignored = notification_types[notification_type][1] %} {% for notification_mode in [NotificationMode.IGNORE, NotificationMode.WEBAPP, NotificationMode.EMAIL] %} {% endfor %} {% endfor %}
{{ _('Notification Type')}} {{ _('Ignore') }} {{ _('Web') }} {{ _('Email') }}
{{ notification_description }} {% if notification_mode != NotificationMode.IGNORE or notification_can_be_ignored %} {% endif %}
{% if not current_user.is_readonly %}

{{ _('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.') }}

{{ default_permissions_form.csrf_token }} {% for possible_permissions in [Permissions.GRANT] %} {% endfor %} {% for possible_permissions in [Permissions.GRANT] %} {% endfor %} {% for possible_permissions in [Permissions.NONE, Permissions.READ] %} {% endfor %} {% if default_permissions_form.group_permissions | length > 0 %} {% endif %} {% for group_permissions_form in default_permissions_form.group_permissions %} {% set group_id = group_permissions_form.group_id.data | int %} {% set group = get_group(group_id) %} {% for possible_permissions in [Permissions.NONE, Permissions.READ, Permissions.WRITE, Permissions.GRANT] %} {% endfor %} {% endfor %} {% if default_permissions_form.project_permissions | length > 0 %} {% endif %} {% for project_permissions_form in default_permissions_form.project_permissions %} {% set project_id = project_permissions_form.project_id.data | int %} {% set project = get_project(project_id) %} {% for possible_permissions in [Permissions.NONE, Permissions.READ, Permissions.WRITE, Permissions.GRANT] %} {% endfor %} {% endfor %} {% if default_permissions_form.user_permissions | length > 0 %} {% endif %} {% for user_permissions_form in default_permissions_form.user_permissions %} {% set user_id = user_permissions_form.user_id.data | int %} {% set user = get_user(user_id) %} {% set permissions = user_permissions.get(user_id, Permissions.NONE) %} {% if user.id == current_user.id %} {% endif %} {% for possible_permissions in [Permissions.NONE, Permissions.READ, Permissions.WRITE, Permissions.GRANT] %} {% endfor %} {% endfor %}
{{ _('Special Groups') }} {{ _('None') }} {{ _('Read') }} {{ _('Write') }} {{ _('Grant') }}
{{ _('Administrators') }}
{{ _('Instrument Scientists')}}
{{ _('Everyone') }}
{{ _('Basic Groups') }}
{{ group.name | get_translated_text }} {{ group_permissions_form.csrf_token }}
{{ _('Project Groups') }}
{{ project.name | get_translated_text }} {{ project_permissions_form.csrf_token }}
{{ _('Users') }}
{{ user.name }} {{ user_permissions_form.csrf_token }}
{% if users %}

{{ _('Add User')}}

{{ add_user_permissions_form.csrf_token }} {% for possible_permissions in [Permissions.NONE, Permissions.READ, Permissions.WRITE, Permissions.GRANT] %} {% endfor %}
{{ _('User') }} {{ _('None') }} {{ _('Read') }} {{ _('Write') }} {{ _('Grant') }}
{% endif %} {% if groups %}

{{ _('Add Basic Group') }}

{{ add_group_permissions_form.csrf_token }} {% for possible_permissions in [Permissions.NONE, Permissions.READ, Permissions.WRITE, Permissions.GRANT] %} {% endfor %}
{{ _('Basic Group') }} {{ _('None') }} {{ _('Read') }} {{ _('Write') }} {{ _('Grant') }}
{% endif %} {% if projects %}

{{ _('Add Project Group') }}

{{ add_project_permissions_form.csrf_token }} {% for possible_permissions in [Permissions.NONE, Permissions.READ, Permissions.WRITE, Permissions.GRANT] %} {% endfor %}
{{ _('Project Group') }} {{ _('None') }} {{ _('Read') }} {{ _('Write') }} {{ _('Grant') }}
{% endif %} {% endif %}

{{ _('Other Settings') }}

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

{{ _('Administrator Settings') }}

{% endif %}
{% for authentication in authentications %} {% endfor %} {% if created_api_token %} {% endif %} {% endblock %} {% block scripts %} {{ super() }} {% if created_api_token %} {% endif %} {% if create_api_token_form.description.errors %} {% endif %} {% endblock %} {% block stylesheets %} {{ super() }} {% endblock %}