<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>${metadata.alias!}</title>
    <style type="text/css">
        .right{float:right;}
    </style>
</head>
<body>
    <header data-diy="page">
        <h1>${(site.name)!}</h1>
    </header>
    <nav data-diy="category">
        <a href="${site.dynamicPath}">Home</a>
<@cms.categoryList>
    <#list page.list as a>
        <a href="${a.url!}" target="_blank" data-diy-item="${a.id}">${a.name}</a>
    </#list>
</@cms.categoryList>
    </nav>
    <main>
        <h3 data-diy="user" data-diy-id="${user.id}">Change password</h3>
        <form action="${site.dynamicPath}user/changePassword" method="post" class="text-center">
            <input type="hidden" name="_csrf" value="<@tools.csrfToken/>"/>
            <p><label>Old password</label><input type="password" name="oldpassword" placeholder="Old password" title="Old password"/></p>
            <p><label>New password</label><input type="password" name="password" placeholder="New password" title="New password"/></p>
            <p><label>Repeat Password</label><input type="password" name="repassword" placeholder="Repeat Password" title="Repeat Password"/></p>
            <p>
                <input type="submit" class="button" value="Submit"/>
            </p>
            <#macro message code>${springMacroRequestContext.getMessage(code)}</#macro>
            <#if error?has_content>
                <p class="message red"><@message error/></p>
            </#if>
            <#if message?has_content>
                <p class="message"><@message "message."+message/></p>
                <#if 'needReLogin'=message>
                    <form name="logout" action="${site.dynamicPath}doLogout" method="post">
                        <input type="hidden" name="userId" value="${(user.id)!}"/>
                        <input type="hidden" name="returnUrl" value="${returnUrl!site.sitePath!}"/>
                    </form>
                    <script>setTimeout("$('form[name]').trigger('submit');",1000);</script>
                </#if>
            </#if>
        </form>
    </main>
    <footer>
        Copyright &copy; ${.now?string('yyyy')}
    </footer>
    <script>
    var itemString="itemType=user&itemId=${user.id}";
    var templatePath='${.current_template_name?keep_after('/')}';
    </script>
    <script src="${site.dynamicPath}resource/js/cms.support.js"></script>
    <script>
        var ca = cmsAnalytics();
        var url='${site.dynamicPath}api/visit/record';
        if("string" ==typeof itemString){
            url=url+"?"+itemString;
        }
        ca.setDomain('${site.sitePath?keep_after('//')?keep_before('/')?keep_before(':')}');
        ca.setPath('/');
        ca.report(url);
    </script>
</body>
</html>