{% extends "layout.html" %} {% from "macros/form_inputs.html" import input_csrf_token with context %} {% from "macros/general.html" import display_subnav, set_account_status_img, set_user_admin_type_img, highlight_username_in_mail, display_progress_bar, display_filter_by_first_char, show_pages, display_remove_mailbox_days with context %} {% from "macros/msg_handlers.html" import user_msg_handler with context %} {% block title %}{{ _('Mail Users') }}{% endblock %} {% block navlinks_domains %}class="active"{% endblock %} {% block breadcrumb %} {% if all_are_admins %} {% set crumbs = [ (ctx.homepath + '/domains', _('All domains')), (ctx.homepath + '/profile/domain/general/' + cur_domain, cur_domain), (ctx.homepath + '/users/' + cur_domain, _('Users')), ] %} {% else %} {% set crumbs = [ (ctx.homepath + '/domains', _('All domains')), (ctx.homepath + '/profile/domain/general/' + cur_domain, cur_domain), ('active', ctx.homepath + '/users/' + cur_domain, _('Users')), ] %} {% endif %} {{ display_subnav(crumbs) }} {% endblock %} {% block main %} {# Show system message #} {{ user_msg_handler(msg) }} {% if users is defined %} {% if users or (not users and first_char) %} {% if all_are_admins %} {{ display_filter_by_first_char(baseurl=ctx.homepath + '/admins/' + cur_domain, first_char=first_char, account_type='admin', disabled_only=disabled_only) }} {% else %} {{ display_filter_by_first_char(baseurl=ctx.homepath + '/users/' + cur_domain, available_chars=all_first_chars, first_char=first_char, account_type='user', disabled_only=disabled_only) }} {% endif %} {% endif %} {# List all users. #}

{% if all_are_admins %} {{ _('Admins under domain: %s') |format(cur_domain) }} {% else %} {{ _('Users under domain: %s') |format(cur_domain) }} {% endif %} {% if total is defined and users|length > 0 %} ({{ (cur_page-1) * page_size_limit + 1 }}-{{ (cur_page-1) * page_size_limit + users|length}}/{{ total }}) {% endif %}

{# Control whether we should redirect to /admins/[domain] or /usrs/[domain] #} {% if all_are_admins %} {% endif %} {{ input_csrf_token() }} {# #} {% if all_are_admins %} {% else %} {% endif %} {% if users %} {% for r in users %} {% set mail = r.username |e %} {# mail quota #} {% set usedQuotaBytes = used_quotas.get(mail, {}).get('bytes', 0) %} {% set usedQuotaMessages = used_quotas.get(mail, {}).get('messages', 0) %} {% if r.quota == 0 %} {% if session.get('show_used_quota') %} {% else %} {% endif %} {% else %} {% set percent = usedQuotaBytes |convert_to_percentage(r.quota |int * 1024 * 1024) %} {% endif %} {% endfor %} {% else %} {% if all_are_admins %} {% else %} {% endif %} {% endif %}
{{ _('Display Name') }} {{ _('Mail Address') }} {{ _('User/Employee ID') }}{{ _('Job Title') }}{{ _('Quota') }}{{ _('Quota') }}
{{ set_account_status_img(r.active) }} {% if r.isglobaladmin %} {{ set_user_admin_type_img('globaladmin') }} {% elif r.isadmin %} {{ set_user_admin_type_img('domainadmin') }} {% endif %} {% if r.name %}{{ r.name |cut_string |e }}{% else %}{{ mail.split('@', 1)[0] }}{% endif %} {{ highlight_username_in_mail(mail) }} {% if r.employeeid %}{{ r.employeeid |e }}{% endif %}{{ usedQuotaBytes |file_size_format }} / {{ _('Unlimited') }}{{ _('Unlimited') }}
{{ percent }}% ({{ usedQuotaMessages }} {{_('Emails') }} / {{ usedQuotaBytes |file_size_format }}) / {{ r.quota |file_size_format(base_mb=True) }}
{{ display_progress_bar(percent, show_zero=true, width='60%', style='thin') }}
{{ _('No mail admin assigned.') }}{{ _('No mail user available.') }} {% if not (first_char or disabled_only) %} {{ _('Add one') }}? {% endif %}
{% if users %} {% endif %}
{# #user_list #}
{# .box-wrapper #}
{# -- End id=user_list -- #}
{% endif %} {% endblock main %}