<@_sysUser id=id>
    <#assign
        a=object
        deptId=(a.deptId)!''
    />
</@_sysUser>
<@_sysDept id=deptId!><#assign dept=object/></@_sysDept>
<form method="post" autocomplete="off" action="sysUser/save?callbackType=closeCurrent&navTabId=sysUser/list" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone);">
    <input name="id" type="hidden" value="${id!}" />
    <input type="hidden" name="_csrf" value="<@_csrfToken admin=true/>"/>
    <div class="formBar">
        <ul>
            <li><button type="submit" class="buttonActive"><@t.page 'button.save'/></button></li>
            <li><button type="button" class="button close"><@t.page 'button.close'/></button></li>
        </ul>
    </div>
    <div class="pageFormContent" layoutH>
        <dl class="nowrap">
            <dt><@t.page 'user.username'/>:</dt>
            <dd>
                <input class="required" name="name" type="text" maxlength="20" size="20" value="${(a.name)!}"/>
                <label><input name="superuserAccess" type="checkbox" onclick="if($(this).is(':checked')){$('.superuserAccess',navTab.getCurrentPanel()).show();}else{$('.superuserAccess',navTab.getCurrentPanel()).hide();}"/><@t.page 'admin'/></label>
                <label class="superuserAccess hide"><input name="ownsAllContent" type="checkbox"<#if !a?has_content||a.ownsAllContent> checked="true"</#if>/><@t.page 'user.own_all_content'/></label>
            </dd>
        </dl>
        <dl class="nowrap superuserAccess hide">
            <dt><@t.page 'dept'/>:</dt>
            <dd>
                <input name="deptId" type="hidden" value="${(dept.id)!}"/>
                <input readonly="readonly" name="deptName" type="text" size="10" value="${(dept.name)!}"/>
                <a class="btnLook" href="sysDept/lookup.html" width="920" lookupGroup=""><@t.page 'dept.select'/></a>
                <span class="info"><@t.page 'user.dept.description'/></span>
            </dd>
        </dl>
        <dl class="nowrap">
            <dt><@t.page 'password'/>:</dt>
            <dd>
                <input<#if !a??> class="required"</#if> name="password" type="password" maxlength="30" size="20" value=""/>
                <#if a??><span class="info"><@t.page 'user.password.description'/></span></#if>
            </dd>
        </dl>
        <dl class="nowrap">
            <dt><@t.page 'repeat_password'/>:</dt>
            <dd><input<#if !a??> class="required"</#if> name="repassword" type="password" maxlength="30" size="20" value=""/></dd>
        </dl>
        <dl class="nowrap">
            <dt><@t.page 'user.nickname'/>:</dt>
            <dd><input class="required" name="nickName" type="text" size="20" maxlength="30" value="${(a.nickName)!}"/></dd>
        </dl>
        <dl class="nowrap">
            <dt><@t.page 'email'/>:</dt>
            <dd><input name="email" type="text" size="30" maxlength="50" value="${(a.email)!}"/></dd>
        </dl>
        <fieldset class="superuserAccess hide">
            <legend><i class="icon-user-md icon-large"></i> <@t.page 'role'/></legend>
            <ul class="tree treeFolder treeCheck expand">
        <@_sysRoleList>
            <#list page.list as a>
                <li><a tname="roleIds" tvalue="${a.id}">${a.name}</a></li>
            </#list>
        </@_sysRoleList>
            </ul>
        </fieldset>
<#if a?has_content&&a.superuserAccess>
<script>
    $('input[name=superuserAccess]',navTab.getCurrentPanel()).click();
<#if a.roles?has_content>
    <#list a.roles?split(',') as role>
        $('.tree li a[tname=roleIds][tvalue=${role?js_string}]',navTab.getCurrentPanel()).prop('checked',true);
    </#list>
</#if>
</script>
</#if>
    </div>
</form>