{% extends "layout.html" %} {% from "macros/general.html" import load_jquery, display_csrf_token, display_number_of_account_limited, set_account_status_img, display_csrf_token, display_add_domain, show_pages, with context %} {% from "macros/msgHandlers.html" import domainMsgHandler, with context %} {% block title %}{{ _('Domains and Accounts') }}{% endblock %} {% block navlinks_active_domains %}class="active"{% endblock %} {% block main %} {# Show system message #} {{ domainMsgHandler(msg) }} {# List all domains under control. #}

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

{{ display_csrf_token() }} {% if session.get('domainGlobalAdmin') is sameas true %} {% endif %} {% if allDomains is not string and allDomains |length != 0 %} {# List domain attributes/avalues. #} {% for (dn, entries) in allDomains %} {% set domain = entries.get('domainName')[0] |string |e %} {% set cn = entries.get('cn', [domain])[0].decode('utf-8') |e %} {% set accountStatus = entries.get('accountStatus', ['disabled'])[0] |e %} {% set accountSetting = allAccountSettings.get(domain, {}) %} {# Get domain quota size & unit #} {% set domainQuota = accountSetting.get('domainQuota', '0:GB') |e %} {% set domainQuotaSize, domainQuotaUnit = domainQuota.split(':') %} {% if domainQuotaUnit == 'TB' %} {% set domainQuotaBytes = domainQuotaSize |int * 1024 * 1024 * 1024 * 1024 %} {% elif domainQuotaUnit == 'GB' %} {% set domainQuotaBytes = domainQuotaSize |int * 1024 * 1024 * 1024 %} {% else %} {% set domainQuotaBytes = domainQuotaSize |int * 1024 * 1024 %} {% endif %} {# Get account limits. #} {% set numberOfUsers = accountSetting.get('numberOfUsers', '0') |int %} {# Get number of current accounts #} {% set domainCurrentUserNumber = entries.get('domainCurrentUserNumber', ['0'])[0] |int %} {% if session.get('domainGlobalAdmin') is sameas true %} {% endif %} {# Mail user count #} {% endfor %} {% else %} {% if session.get('domainGlobalAdmin') is sameas true %} {% else %} {% endif %} {% endif %}
{{ _('Domain') }} {{ _('Name') }} {{ _('Quota') }} {{ _('Users') }}
{{ set_account_status_img(accountStatus) }} {{ domain }} {% if cn != '' and cn != domain %}{{ cn |cut_string }}{% endif %} {{ _('Unlimited') }} {{domainCurrentUserNumber}}
{{ _('No mail domain available.') }} {{ _('Add one') }}? {{ _('No mail domain available.') }}
{% endblock main %} {% block js %} {% if session.get('domainGlobalAdmin') is sameas true %} {% set nonSortedCols = [0] %} {% else %} {% set nonSortedCols = [] %} {% endif %} {{ load_jquery(['tablesorter'], nonSortedCols=nonSortedCols) }} {% endblock js %}