{% extends "layout.html" %} {% from "macros/form_inputs.html" import input_csrf_token with context %} {% from "macros/general.html" import display_subnav, display_input_cn with context %} {% from "macros/mlmmj.html" import display_maillist_basic_profile with context %} {% from "macros/msg_handlers.html" import maillist_msg_handler with context %} {% block title %}{{ _('Add mailing list') }}{% 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 #} {{ maillist_msg_handler(msg) }} {% set createNewAccount = true %} {% set numberOfSpareAccounts = profile.maillists - num_existing_maillists %} {% if profile.maillists == -1 %} {% set createNewAccount = false %} {% set whyDisabledCreation = _('Not allowed to create mailing list under this domain.') %} {% elif profile.maillists > 0 and numberOfSpareAccounts <= 0 %} {% set createNewAccount = false %} {% set whyDisabledCreation = _('Already exceed max number of account limit (%d).') |format(profile.maillists |int) %} {% endif %} {% if not createNewAccount %}

{{ _('Error:') }} {{ _("You can't create mailing lists under domain %s.") |format('' + cur_domain + '') }} {{ whyDisabledCreation }}

{% else %} {% if profile.maillists > 0 and numberOfSpareAccounts > 0 %}

{{ _('You can create %d more mailing list(s) under domain %s.') |format(numberOfSpareAccounts |int, '' + cur_domain + '') }}

{% endif %} {% endif %}
{{ input_csrf_token() }}

{{ _('Add mailing list under domain') }} *

{{ _('Mail Address') }} *

@{{ cur_domain }}
{{ display_input_cn(value=cn, input_name='name', enable_input=createNewAccount) }} {{ display_maillist_basic_profile(profile=default_creation_settings) }}

 

{# .columns #}
{# .box-wrap #}
{# .content-box #}
{# .box-body #} {% endblock main %}