{# @allDomains @allAccountSettings @msg #} {% extends "layout.html" %} {% from "macros/general.html" import load_jquery, set_account_status_img, display_number_of_account_limited, display_progress_bar, 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) * session['pageSizeLimit'] + 1 }}-{{ (cur_page-1) * session['pageSizeLimit'] + allDomains|length}}/{{ total }}) {% endif %}

{% if session.get('domainGlobalAdmin') is sameas true %} {% endif %} {% if session.get('domainGlobalAdmin') is sameas true %} {% endif %} {% if allDomains is not string and allDomains |length != 0 %} {# List domain attributes/avalues. #} {% for d in allDomains %} {% set entries = d[1] %} {% set domain = entries.get('domainName')[0] |string%} {% set cn = entries.get('cn', [domain])[0].decode('utf-8') %} {% set accountStatus = entries.get('accountStatus', ['disabled'])[0] %} {% set accountSetting = allAccountSettings.get(domain, {}) %} {# Get account limits. #} {% set numberOfUsers = accountSetting.get('numberOfUsers', '0') |int %} {% set numberOfLists = accountSetting.get('numberOfLists', '0') |int %} {% set numberOfAliases = accountSetting.get('numberOfAliases', '0') |int %} {# Get number of current accounts #} {% set domainCurrentUserNumber = entries.get('domainCurrentUserNumber', ['0'])[0] |int %} {% set domainCurrentListNumber = entries.get('domainCurrentListNumber', ['0'])[0] |int %} {% set domainCurrentAliasNumber = entries.get('domainCurrentAliasNumber', ['0'])[0] |int %} {% set timestamp = entries.get('createTimestamp', ['--------------'])[0] %} {# Get domain quota size & unit #} {% set domainQuota = accountSetting.get('domainQuota', '0:GB') %} {% set domainQuotaSize, domainQuotaUnit = domainQuota.split(':') %} {% set domainCurrentQuotaSize = entries.get('domainCurrentQuotaSize', ['0'])[0] |int %} {% 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 %} {% if session.get('domainGlobalAdmin') is sameas true %} {% endif %} {# Domain quota#} {# Mail user count #} {# Mail list count #} {# Mail alias count #} {# Show number of domain admins #} {% if session.get('domainGlobalAdmin') is sameas true %} {% endif %} {% endfor %} {% else %} {% if session.get('domainGlobalAdmin') is sameas true %} {% else %} {% endif %} {% endif %}
{{ _('Domain') }} {{ _('Name') }} {{ _('Quota') }} {{ _('Users') }} {{ _('Lists') }} {{ _('Aliases') }}{{ _('Admins') }}{{ _('Created') }}
{{ set_account_status_img(accountStatus) }} {{ domain }} {% if cn != '' and cn != domain %}{{ cn |cutString }}{% endif %} {% if domainQuotaBytes > 0 %} {% set percentOfDomainQuotaBytes = domainCurrentQuotaSize |getPercentage(domainQuotaBytes) %}
{{ percentOfDomainQuotaBytes }}% {# Add link to domain profile page #} {% if session.get('domainGlobalAdmin') is sameas true %} ({{ domainCurrentQuotaSize |filesizeformat }}/{{ domainQuotaBytes |filesizeformat }}) {% else %} ({{ domainCurrentQuotaSize |filesizeformat }}/{{ domainQuotaBytes |filesizeformat }}) {% endif %}
{{ display_progress_bar(percentOfDomainQuotaBytes, show_zero=true, width="60%", style='thin') }} {% else %} {% if session.get('domainGlobalAdmin') is sameas true %} {{ _('Unlimited') }} {% else %} {{ _('Unlimited') }} {% endif %} {% endif %}
{{domainCurrentUserNumber}} {{ display_number_of_account_limited(numberOfUsers) }} {% if numberOfUsers > 0 %} {% set percentOfNumberOfUsers = domainCurrentUserNumber |getPercentage(numberOfUsers) %} {{ display_progress_bar(percentOfNumberOfUsers, style='thin') }} {% endif %} {{domainCurrentListNumber}} {{ display_number_of_account_limited(numberOfLists) }} {% if numberOfLists > 0 %} {% set percentOfNumberOfLists = domainCurrentListNumber |getPercentage(numberOfLists) %} {{ display_progress_bar(percentOfNumberOfLists, style='thin') }} {% endif %} {{domainCurrentAliasNumber}} {{display_number_of_account_limited(numberOfAliases)}} {% if numberOfAliases > 0 %} {% set percentOfNumberOfAliases = domainCurrentAliasNumber |getPercentage(numberOfAliases) %} {{ display_progress_bar(percentOfNumberOfAliases, style='thin') }} {% endif %} {{ entries.get('domainAdmin', []) |length }}{{ timestamp |setDatetimeFormat(hour=False) }}
{{ _('No domain available.') }} {{ _('Add one') }}? {{ _('No domain available.') }}
{% endblock main %} {% block js %} {% if session.get('domainGlobalAdmin') is sameas true %} {% set sortFirstCol = false %} {% else %} {% set sortFirstCol = true %} {% endif %} {{ load_jquery(['tablesorter'], sortFirstCol=sortFirstCol) }} {% endblock js %}