{% extends "layout.html" %} {% from "macros/form_inputs.html" import input_csrf_token with context %} {% from "macros/general.html" import set_account_status_img, display_number_of_account_limited, display_progress_bar, display_filter_by_first_char, display_add_domain, show_pages, display_remove_mailbox_days with context %} {% from "macros/msg_handlers.html" import domain_msg_handler with context %} {% block title %}{{ _('Domains and Accounts') }}{% endblock %} {% block navlinks_domains %}class="active"{% endblock %} {% block main %} {# Show system message #} {{ domain_msg_handler(msg) }} {{ display_filter_by_first_char(baseurl=ctx.homepath + '/domains', first_char=first_char, available_chars=all_first_chars, account_type='domain', disabled_only=disabled_only) }} {# List all domains under control. #}
{% if session.get('is_global_admin') or session.get('create_new_domains') %} {% endif %}

{{ _('All domains under your control.') }} {% if disabled_only %}({{ _('Disabled') }}){% endif %} {% if total is defined and all_domain_profiles | length > 0 %} ({{ (cur_page-1) * page_size_limit + 1 }}-{{ (cur_page-1) * page_size_limit + all_domain_profiles | length}}/{{ total }}) {% endif %}

{{ input_csrf_token() }} {% if session.get('is_global_admin') or session.get('create_new_domains') %} {% endif %} {% if all_domain_profiles %} {% for r in all_domain_profiles %} {% set domain = r.domain |e %} {% if session.get('is_global_admin') or session.get('create_new_domains') %} {% endif %} {#-- Domain Quota --#} {#-- Users --#} {% endfor %} {% else %} {% if session.get('is_global_admin') or session.get('create_new_domains') %} {% else %} {% endif %} {% endif %}
{{ _('Domain') }} {{ _('Display Name') }} {{ _('Quota') }} {{ _('Users') }}
{{ domain }} {{ set_account_status_img(status=r.active, account_type='domain') }} {% if r.description %}{{ r.description |cut_string |e }}{% endif %} {% set used_quota = domain_used_quota.get(domain, {}).get('size', 0) %} {{ used_quota | file_size_format }} / {{ r.quota_count |file_size_format(base_mb=True) }} {% if r.num_existing_users %} {% set num_existing_users = r.num_existing_users | int %} {% else %} {% set num_existing_users = 0 %} {% endif %} {% if r.mailboxes > 0 %} {% set percentOfNumberOfUsers = num_existing_users |convert_to_percentage(r.mailboxes) %} {{ percentOfNumberOfUsers }}% ({% if num_existing_users is not sameas none %}{{ num_existing_users }}{% else %}0{% endif %} {{ display_number_of_account_limited(r.mailboxes) }}) {{ display_progress_bar(percentOfNumberOfUsers, style='thin') }} {% elif r.mailboxes == -1 %} {{ _('DISABLED') }} {% else %} {% if num_existing_users is not sameas none %}{{ num_existing_users }}{% else %}0{% endif %} {% endif %}
{{ _('No mail domain available.') }} {% if not (first_char or disabled_only) %} {{ _('Add one') }}? {% endif %} {{ _('No mail domain available.') }}
{% endblock main %}