Source

iredadmin-ose / templates / default / mysql / user / create.html

Full commit
{% extends "layout.html" %}

{% from "macros/general.html" import
        display_csrf_token,
        display_input_cn,
        display_reset_password,
        display_random_password,
        display_quota,
        with context
        %}
{% from "macros/msgHandlers.html" import userMsgHandler with context %}

{% block title %}{{ _('Add user under domain: %s') |format(cur_domain) }}{% endblock title %}
{% block navlinks_active_create %}class="active"{% endblock %}


{% block main %}
{# Show system message #}
{{ userMsgHandler(msg) }}

{# -- Allow to create new account --#}
{% set createNewAccount = true %}

    <div class="content-box">
        <div class="box-body">
            <div class="box-header clear">
                <ul class="tabs clear">
                    <li><a href="{{ctx.homepath}}/users/{{cur_domain}}">{{ _('Users') }}</a></li>
                    <li class="active"><a href="#user_add"><img src="{{ctx.homepath}}/static/{{skin}}/images/ico_add_12.png" /> {{ _('User') }}</a>
                </ul>

                <h2>
                    {{ _('Add user under domain: %s') |format(cur_domain) }}
                    <a href="{{ctx.homepath}}/profile/domain/general/{{cur_domain}}"><img src="{{ctx.homepath}}/static/{{skin}}/images/action_edit.png" title="{{ _('Edit domain profile') }}" class="vcenter"/></a>
                </h2>
            </div>

            <div id="user_add" class="box-wrap clear">
                <form name="create" method="post" action="{{ctx.homepath}}/create/user/{{cur_domain}}">
                    {{ display_csrf_token() }}
                    <div class="columns clear">
                        <div class="col3-4">
                            <div class="form-field clear">
                                <h4 class="size-250 fl-space">{{ _('Mail Address') }} <span class="required">*</span></h4>
                                <span class="clean-padding">
                                    <input type="text" size="35" name="username" value="" class="text fl-space" {% if createNewAccount is sameas false %}disabled{% endif %}/>@
                                    <select name="domainName" onchange="changeUrl(this, baseurl='{{ctx.homepath}}/create/user/');">
                                        {% for d in allDomains %}
                                            <option value="{{ d |e }}" {% if d == cur_domain %}selected{%endif%}>{{ d |e }}</option>
                                        {% endfor %}
                                    </select>
                                </span>
                            </div>

                            <div class="bt-space5">&nbsp;</div>

                            {{ display_reset_password(
                                        min_passwd_length=profile.minpasswordlength |string,
                                        max_passwd_length=profile.maxpasswordlength |string,
                                        store_in_plain=true,
                                        )
                                        }}

                            <div class="bt-space5">&nbsp;</div>

                            {{ display_input_cn(cn=cn, accountType='user') }}
                            {{ display_quota(
                                            value=profile.defaultuserquota,
                                            show_value_in_input=true,
                                            show_used_quota=false,
                                            )
                            }}

                        </div>{# .col2-3 #}

                        <div class="col1-4 lastcol">
                            {{ display_random_password(profile.maxpasswordlength) }}
                        </div>
                    </div>{# .columns #}

                    <div class="rule2"></div>
                    <div class="form-field clear">
                        <h4 class="size-250 fl-space">&nbsp;</h4>
                        <span>
                            <input type="submit" value="{{ _('Add') }}" {% if createNewAccount is sameas false %}class="button grey" disabled{% else %}class="button green"{% endif %} />
                        </span>
                    </div>
                </form>
            </div>{# -- End box-wrap -- #}
        </div>{# -- End content-box -- #}
    </div>{# -- End box-body -- #}
{% endblock main %}