<!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="config" data-diy-id="email">Modify email</h3>
        <form action="${site.dynamicPath}user/saveEmail" method="post">
            <input type="hidden" name="_csrf" value="<@tools.csrfToken/>"/>
            <input type="hidden" name="returnUrl" value="${site.dynamicPath}email.html"/>
            <p><input type="email" name="email" placeholder="Email" title="Email" value="${user.email!}"/></p>
            <p>
                <input type="submit" class="button" value="Send verification email"/>
            </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>
        </form>
    </main>
    <footer>
        Copyright &copy; ${.now?string('yyyy')}
    </footer>
    <script src="${site.dynamicPath!}resource/plugins/jquery/jquery.min.js"></script>
    <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>