{% extends "layout.html" %} {% from "macros/form_inputs.html" import input_csrf_token with context %} {% from "macros/general.html" import display_subnav, display_input_cn, display_list_access_policies with context %} {% from "macros/msg_handlers.html" import alias_msg_handler, warning_info with context %} {% block title %}{{ _('Add mail alias') }}{% endblock title %} {% block navlinks_create %}class="active"{% endblock %} {% block breadcrumb %} {% set crumbs = [ (ctx.homepath + '/domains', _('All domains')), (ctx.homepath + '/profile/domain/general/' + cur_domain, cur_domain), (ctx.homepath + '/users/' + cur_domain, _('Users')), (ctx.homepath + '/mls/' + cur_domain, _('Mailing Lists')), (ctx.homepath + '/aliases/' + cur_domain, _('Aliases')), (ctx.homepath + '/admins/' + cur_domain, _('Admins')), ] %} {% if backend != "pgsql" %} {% set crumbs = crumbs + [(ctx.homepath + '/users/' + cur_domain + '/last_logins', _('Last Logins'))] %} {% endif %} {{ display_subnav(crumbs) }} {% endblock %} {% block main %} {# Show system message #} {{ alias_msg_handler(msg) }} {% set createNewAccount = true %} {% set numberOfSpareAccounts = profile.aliases - num_existing_aliases %} {% if profile.aliases == -1 %} {% set createNewAccount = false %} {% set whyDisabledCreation = _('Not allowed to create mail alias under this domain.') %} {% elif profile.aliases > 0 and numberOfSpareAccounts <= 0 %} {% set createNewAccount = false %} {% set whyDisabledCreation = _('Already exceed max number of account limit (%d).') |format(profile.aliases |int) %} {% endif %} {% if not createNewAccount %}
{{ _('Error:') }} {{ _("You can't create mail aliases under domain %s.") |format('' + cur_domain + '') }} {{ whyDisabledCreation }}
{{ _('You can create %d more mail alias(es) under domain %s.') |format(numberOfSpareAccounts |int, '' + cur_domain + '') }}