<html>
<head>
    <title>Reset Password Request</title>
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/1000hz-bootstrap-validator/0.11.9/validator.js"></script>
    <style>
        body {
            background-image: url(/images/bg.png);
            background-repeat: no-repeat;
            background-position: center;
            background-attachment: fixed;
            padding-top: 80px;
        }

        .whiteText {
            color: white;
        }

        .Bold {
            font-weight: bold
        }
    </style>
</head>
<body>
<div class="container whiteText">
    <div class="col-sm-6 col-sm-offset-3">
        <div id="imgDiv">
            <img class="center-block" id="logo" alt="logo"
                 style="height: 140px; width: 140px; object-fit: contain;margin-top: 40px"
                 src="/images/logo_cloud_land.png">
        </div>
        <h2 class="center-block"><%= resetPasswordLabel %></h2>

        <!-- show any messages that come back with the privios reset password request -->
        <% if (message && message.length > 0) { %>
        <div id="errorDiv" class="alert alert-danger"><%= message %></div>
        <% } %>

        <form role="form" data-toggle="validator" id="reset_password_form"
              action="/reset_password/submit?language=<%= language %>" autocomplete="off"
              method="post"
              onsubmit="onSubmit();">
            <div class="form-group center-block">
                <label for="new_password"><%= newPassword %></label>
                <input id="new_password" type="password"
                       class="form-control"
                       name="new_password"
                       required>
                <div class="help-block with-errors"></div>
            </div>
            <span class="help-block"></span>
            <div class="form-group center-block">
                <label for="confirmed_new_password"><%= reEnterNewPassword %></label>
                <input id="confirmed_new_password" type="password"
                       class="form-control"
                       name="confirmed_new_password"
                       required>
                <div class="help-block with-errors"></div>
            </div>
            <span class="help-block"></span>

            <div class="form-group">
                <input type="hidden" name="uuid" value="<%= uuid %>">
                <input type="hidden" name="code" value="<%= code %>">
                <button id="reset_password_button" type="submit"
                        class="btn btn-lg btn-primary center-block btn-login cloudDirecoryButton">
                    <%= saveChangesButton %>
                </button>
            </div>
        </form>

    </div>
</div>
<script>
	function onSubmit() {
		var isDisabled = $('#reset_password_button').hasClass("disabled");
		if (!isDisabled) {
			document.getElementById("reset_password_button").disabled = true;
		}
	}
</script>
</body>
</html>