<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <!--Let browser know website is optimized for mobile-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <title>登录-后台管理系统</title>
    <link rel="shortcut icon" href="/static/manage/favicon.ico" type="image/ico"/>
</head>
<style>
    * {
        margin: 0px;
        padding: 0px;
    }

    html, body {
        height: 100%;
    }

    body {
        background-color: #fefefe;
        color: #717379;
    }

    li {
        list-style: none;
    }
    .flex{
        display: flex;
    }
    .page {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100%;
    }

    .page header{
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        top: 0px;
        left: 0px;
        right: 0px;
        height: 50px;
        padding: 0px 10px;
        border-bottom: 1px solid #dedede;
        color: #fff;
    }
    .material-half-bg {
        height: 50%;
        background: linear-gradient(to bottom, #263c4e, #263c4e);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: -1;
    }

    #login-page {
        width: 95%;
        max-width: 400px;
    }

    #login-page h1 {
        font-size: 30px;
        color: #FFF;
        margin: 20px;
        text-align: center;
    }

    #login-form {
        position: relative;
        padding: 50px 50px 30px;
        background-color: #FFF;
        box-shadow: 0px 29px 147.5px 102.5px rgba(0, 0, 0, 0.05), 0px 29px 95px 0px rgba(0, 0, 0, 0.16);
    }

    #login-form label {
        font-size: 14px;
    }

    #login-form ul {
        padding: 32px;
        color: #747474;
    }

    #login-form li {
        padding: 24px 0px 0px 0px;
    }

    #login-form input {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
        margin-top: 5px;
        padding: 10px 0px;
        width: 100%;
        font-size: 16px;
        text-indent: 10px;
        border: none;
        border-radius: 0;
    }

    #login-form input:focus {
        outline: none;
    }

    #login-form input[type='checkbox'] {
        width: 18px;
        height: 18px;
        border: 1px solid #ddd;
        margin: 2px 4px 2px 0px;
    }

    #login-form input[type='submit'] {
        -webkit-appearance: none;
        margin: 20px 0px;
        color: #fff;
        background-color: #263c4e;
        text-indent: 10px;
        border: 0px;
        border-radius: 2px;
        cursor: pointer;
    }

    #login-form input[type='submit']:hover {
        color: #fff;
        background-color: #303b5b;
    }

    .form-group {
        display: flex;
        border-bottom: 1px solid #dfdddf;
        margin-bottom: 20px;
    }

    .form-group label {
        display: inline-block;
        margin-right: 10px;
    }

    .label-username {
        width: 24px;
        background: url('/static/manage/images/username.png') no-repeat center;
        background-size: contain;
    }

    .label-password {
        width: 24px;
        background: url('/static/manage/images/password.png') no-repeat center;
        background-size: contain;
    }

    .label-password.new {
        width: 24px;
        background: url('/static/manage/images/key.png') no-repeat center;
        background-size: contain;
    }

    #footer {
        font-size: 14px;
        text-align: center;
        position: fixed;
        bottom: 88px;
        left: 0px;
        right: 0px;
    }

    .fl {
        float: left;
    }

    .no-border {
        border: none;
    }

    /*提示弹框*/
    .m-pop {
        position: fixed;
        top: -60px;
        width: 400px;
        left: 50%;
        margin-left: -200px;
        z-index: 10000;
        overflow: hidden;
        transition: all .3s;
        text-align: center;
    }

    .m-pop .pop-msg.error {
        background: #ffcc66;
        padding: 10px 20px;
        font-size: 16px;
        color: #fff;
        min-width: 130px;
        display: inline-block;
    }
</style>
<script>
    window.onload = function () {
        var pop = document.getElementById("m-pop-error");
        var error = document.getElementById("msg");
        if (!error.textContent) {
            return false;
        }
        pop.style.top = "0px";
        setTimeout(function () {
            pop.style.top = "-60px";
        }, 2000);
    }
</script>
<body>
<div class="page">
    <div class="material-half-bg"></div>
    <div id="login-page">
        <h1>首次登录请修改密码</h1>
        <form id="login-form" action="{% url 'manage_first_login' %}" method="post">
            {% csrf_token %}
            <input type="hidden" name="next" value="{{ next_url }}"/>
            <div class="form-group">
                <label class="label-password"></label>
                <input type="password" name="old_password" maxlength="32" placeholder="旧密码">
            </div>
            <div class="form-group">
                <label class="label-password new"></label>
                <input type="password" name="new_password1" maxlength="32" placeholder="新密码">
            </div>
            <div class="form-group">
                <label class="label-password new"></label>
                <input type="password" name="new_password2" maxlength="32" placeholder="确认新密码">
            </div>
            <div class="form-group no-border">
                <input type="submit" value="提&nbsp;交">
            </div>
        </form>
    </div>
    <div id="footer">
        <p>无法登录? 推荐浏览器 Chrome 或 FireFox</p>
    </div>
</div>
<div class="m-pop" id="m-pop-error">
    <div class="pop-msg error" id="msg">{{ message }}</div>
</div>
</body>
</html>