{% extends "layout.html" %} {% from "macros/form_inputs.html" import input_csrf_token with context %} {% from "macros/general.html" import set_account_status_img, set_account_activity_img, set_alias_domain_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 --#} {#-- Mailing list --#} {#-- Aliases --#} {% endfor %} {% else %} {% if session.get('is_global_admin') or session.get('create_new_domains') %} {% else %} {% endif %} {% endif %}
{{ _('Domain') }} {{ _('Display Name') }} {{ _('Quota') }} {{ _('Users') }} {{ _('Mailing Lists') }} {{ _('Aliases') }}
{{ domain }} {% set _alias_domains = all_alias_domains.get(domain, []) %} {% set _pending_alias_domains = [] %} {% for d in _alias_domains %} {% if d in pending_domains %} {% do _pending_alias_domains.append(d) %} {% endif %} {% endfor %} {{ set_account_activity_img('sent', 'domain', domain) }} {# Check whether domain is a real backup mx #} {% set is_real_backupmx = false %} {% if r.backupmx == 1 and r.transport.startswith('relay:') %} {% set is_real_backupmx = true %} {% endif %} {{ set_account_status_img(status=r.active, account_type='domain', is_relay=r.transport not in local_transports, relay=r.transport, backupmx=r.backupmx, is_backupmx=is_real_backupmx) }} {{ set_alias_domain_img(alias_domains=_alias_domains) }} {% if (domain in pending_domains) or _pending_alias_domains %} {{ _('PLEASE VERIFY OWNERSHIP') }} {% endif %} {% if r.description %}{{ r.description |cut_string |e }}{% endif %} {% set used_quota = domain_used_quota.get(domain, {}).get('size', 0) %} {% if r.maxquota > 0 %} {% set percent_allocated = r.quota_count |convert_to_percentage(r.maxquota) %} {% set percent_used_quota = (used_quota/1024/1024) |convert_to_percentage(r.maxquota) %} {% if session.get('is_global_admin') %} {#-- Link to domain profile page. --#} {{ percent_allocated }}% ({{ used_quota | file_size_format }} / {{ r.quota_count |file_size_format(base_mb=True) }}) {{ display_number_of_account_limited(r.maxquota |file_size_format(base_mb=True)) }} {% else %} {{ percent_allocated }}% ({{ used_quota | file_size_format }} / {{ r.quota_count |file_size_format(base_mb=True) }}) {{ display_number_of_account_limited(r.maxquota |file_size_format(base_mb=True)) }} {% endif %} {{ display_progress_bar(percent_used_quota, tooltip=_('Used'), style='thin') }} {{ display_progress_bar(percent_allocated, tooltip=_('Allocated'), style='thin') }} {% else %} {% if session.get('is_global_admin') %} {{ used_quota | file_size_format }} / {{ r.quota_count |file_size_format(base_mb=True) }} / {{ _('Unlimited') }} {% else %} {{ used_quota | file_size_format }} / {{ r.quota_count |file_size_format(base_mb=True) }} / {{ _('Unlimited') }} {% endif %} {% endif %} {% 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 %} {% if r.num_existing_maillists %} {% set num_existing_maillists = r.num_existing_maillists | int %} {% else %} {% set num_existing_maillists = 0 %} {% endif %} {% if r.maillists > 0 %} {% set percentOfNumberOfMaillists= num_existing_maillists |convert_to_percentage(r.maillists) %} {{ percentOfNumberOfMaillists }}% ({{ num_existing_maillists }} {{ display_number_of_account_limited(r.maillists) }}) {{ display_progress_bar(percentOfNumberOfMaillists, style='thin') }} {% elif r.maillists == -1 %} {{ _('DISABLED') }} {% else %} {% if num_existing_maillists is not sameas none %}{{ num_existing_maillists }}{% else %}0{% endif %} {% endif %} {% if r.num_existing_aliases %} {% set num_existing_aliases = r.num_existing_aliases | int %} {% else %} {% set num_existing_aliases = 0 %} {% endif %} {% if r.aliases > 0 %} {% set percentOfNumberOfAliases = num_existing_aliases |convert_to_percentage(r.aliases) %} {{ percentOfNumberOfAliases }}% ({{ num_existing_aliases }} {{ display_number_of_account_limited(r.aliases) }}) {{ display_progress_bar(percentOfNumberOfAliases, style='thin') }} {% elif r.aliases == -1 %} {{ _('DISABLED') }} {% else %} {% if num_existing_aliases is not sameas none %}{{ num_existing_aliases }}{% else %}0{% endif %} {% endif %}
{{ _('No mail domain available.') }} {% if not (first_char or disabled_only) %} {{ _('Add one') }}? {% endif %} {{ _('No mail domain available.') }}
{% endblock main %}