<@sys.user id=id absoluteURL=false replaceSensitive=false>
    <#assign a=object/>
</@sys.user>
<form action="sysUser/update?callbackType=closeCurrent" method="post" autocomplete="off" class="pageForm required-validate" onsubmit="return validateCallback(this, ${(target?has_content&&'dialog'=target)?then('dialogAjaxDone','navTabAjaxDone')});">
    <input type="hidden" name="_csrf" value="<@tools.csrfToken admin=true/>"/>
    <div class="formBar card">
        <ul>
            <li><button type="submit" class="buttonActive" title="ctrl+s"><@t.page 'button.save'/></button></li>
            <li><button type="button" class="button close"><@t.page 'button.close'/></button></li>
        </ul>
    </div>
    <div class="card">
        <div class="pageFormContent" layoutH>
            <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 'cover'/>:</dt>
                <dd>
                    <input name="cover" class="preview" value="${(a.cover)!}" maxlength="300" size="50" type="text"/>
                    <a class="btnAttach" href="common/upload.html?field=cover&fileTypes=image" lookupGroup="" width="1000" height="600"><@t.page 'cover'/></a>
                    <a class="view icon-eye-open" ref="cover" data-prefix="${getFileUploadPrefix()}" href="javascript:void(0);" target="_blank"><@t.page 'button.view'/></a>
                </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>
            <dl class="nowrap">
                <dt><@t.page 'login.2fa'/>:</dt>
                <dd>
                    <a class="button bindbtn unbind" href="otpSetting/unbind?_csrf=<@tools.csrfToken admin=true/>" target="ajaxTodo" callback="${(target?has_content&&'dialog'=target)?then('$.pdialog.closeCurrent()','navTab.reloadFlag(\'myself/profile\')')}"><@t.page 'button.unbind'/></a>
                    <a class="button bindbtn bind" href="myself/otpsettings.html" target="dialog" mask="true"><@t.page 'button.bind'/></a>
                </dd>
            </dl>
            <dl class="nowrap">
                <dt><@t.page 'password'/>:</dt>
                <dd>
                    <a class="button" href="myself/password.html" target="dialog" width="450" height="320" mask="true"><@t.page 'change_password'/></a>
                </dd>
            </dl>
        </div>
    </div>
</form>
<script>
$.ajax({
    url:'otpSetting/check',
    type: 'POST',
    dataType: "json",
    async: false,
    success: function (result) {
        $('.bindbtn', ${(target?has_content&&'dialog'=target)?then('$.pdialog.getCurrent()','navTab.getCurrentPanel()')}).hide();
        if(result){
            $('.bind', ${(target?has_content&&'dialog'=target)?then('$.pdialog.getCurrent()','navTab.getCurrentPanel()')}).show();
        } else {
            $('.unbind', ${(target?has_content&&'dialog'=target)?then('$.pdialog.getCurrent()','navTab.getCurrentPanel()')}).show();
        }
    }
});
</script>