{% extends "layout_user.html" %} {% from "macros/form_inputs.html" import input_submit, input_csrf_token with context %} {% from "macros/general.html" import display_subnav, set_account_activity_img, display_progress_bar, display_input_cn, display_preferred_language, display_timezones, display_account_status, display_reset_password, display_random_password, display_user_forwarding with context %} {% from "macros/msg_handlers.html" import user_msg_handler with context %} {% block title %}{{ _('Preferences') }}{% endblock %} {% block navlinks_preferences %}class="active"{% endblock %} {% block main %} {# Show system message #} {% if msg %} {% if msg.startswith('PW_') %} {% set _pw_errors = msg.split(',') %} {% for _err in _pw_errors %} {{ user_msg_handler(_err) }} {% endfor %} {% else %} {{ user_msg_handler(msg) }} {% endif %} {% endif %} {% set navlinks = [('general', _('General'), [true]), ('forwarding', _('Forwarding'), ['forwarding' not in disabled_user_preferences]), ('password', _('Password'), ['password' not in disabled_user_preferences])] %}
    {% for nav in navlinks %} {% if not false in nav[2] and not none in nav[2] %}
  • {{ nav[1] }}
  • {% endif %} {% endfor %}

{{ _('Preferences') }}

{{ input_csrf_token() }}
{% if 'personal_info' not in disabled_user_preferences %} {{ display_input_cn(value=profile.name) }} {% endif %} {{ display_preferred_language(value=profile.get('language'), languagemaps=languagemaps) }} {{ display_timezones(value=user_settings.get('timezone'), timezones=timezones) }}
{% if profile.quota %}
{% set percent = used_quota_bytes |convert_to_percentage(profile.quota |int * 1024 * 1024) %}

{{ _('Mailbox Quota') }} ({{ profile.quota | file_size_format(base_mb=True) }}, {{ percent }}% {{ _('Used') }})

{{ display_progress_bar(percent, style='thin', show_zero=true, width='70%') }}
 
{% endif %}
{{ input_submit() }}
{% if 'forwarding' not in disabled_user_preferences %}
{{ input_csrf_token() }}
{{ display_user_forwarding(mail=mail, enabled=profile.alias_active, forwarding_addresses=profile.forwardings) }}
{#-- .columns --#} {{ input_submit() }}
{% endif %} {% if 'password' not in disabled_user_preferences %}
{{ input_csrf_token() }}
{{ display_reset_password(show_confirmpw=true, min_passwd_length=min_passwd_length, max_passwd_length=max_passwd_length, store_password_in_plain_text=store_password_in_plain_text) }}
{{ display_random_password(password_length=min_passwd_length, password_policies=password_policies) }}
{{ input_submit() }}
{% endif %}
{% endblock main %} {% block extra_js %} {% endblock extra_js %}