<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<div class="x-form-wrap">
	<form class="form-horizontal x-form" novalidate>
		<div class="x-form-set-wrap">
			<div class="x-form-set-header">
				<h4>管理员密码设置</h4>
			</div>
			<div>
				<span class="small">请设置管理员账户的登录密码</span>
			</div>
			<div class="x-form-set">
				<input type="hidden" name="pageToken" value="${pageToken}">
				<input type="hidden" name="adminTel" value="${content.adminTel}">
				<c:choose>
					<c:when test="${adminExist}">
						<div class="form-group">
							<label class="control-label col-sm-2 x-required">账户密码：</label>
							<div class="col-sm-5 x-has-feedback-left">
								<input type="text" id="oldPassword" class="form-control x-input"
									name="oldPassword" required="required"
									placeholder="该手机号已注册，请输入原密码验证" x-error-by="oldPassword_err"
									x-help-by="password_help" x-maxlength="20" x-minlength="6"
								    x-error-text="请输入正确的原密码" x-pattern="^[A-Za-z0-9]+$"
									autofocus>
							</div>
							<div class="x-input-addon col-sm-5">
								<div class="x-text-help" id="password_help">
									您的登录账户是${content.adminTel} <a class="x-text-link"
										href="https://account.ubtob.com/user/pwd?" target="_blank">
										忘记密码?</a>
								</div>
								<div class="x-text-error" id="oldPassword_err"
									style="display: none">请输入原密码进行验证</div>
							</div>
							<input type="hidden" id="password" class="form-control x-input"
								name="password" required="required"
								x-error-by="passwordvalid_err" x-help-by="password_help"
								x-maxlength="20" x-minlength="6">
							<input
								type="hidden" id="passwordConfirm" class="form-control x-input"
								name="passwordConfirm" required="required" x-maxlength="20"
								x-minlength="6">
						</div>
					</c:when>
					<c:otherwise>
						<div class="form-group">
							<label class="control-label col-sm-2 x-required">账户密码：</label>
							<div class="col-sm-5 x-has-feedback-left">
								<input type="text" id="password" class="form-control x-input"
									name="password" required="required" x-error-by="password_err"
									x-help-by="password_help" x-maxlength="20" x-minlength="6"
									autofocus x-pattern="^[A-Za-z0-9]+$">
							</div>
							<div class="x-input-addon col-sm-5">
								<div class="x-text-help" id="password_help">您的登录账户是${content.adminTel}</div>
								<div class="x-text-error" id="password_err"
									style="display: none">请输入6-20长度的英文、数字混合密码</div>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-2 x-required">确认密码：</label>
							<div class="col-sm-5 x-has-feedback-left">
								<input type="text" id="passwordConfirm"
									class="form-control x-input" name="passwordConfirm"
									required="required" placeholder="再次输入密码确认" x-maxlength="20"
									x-minlength="6" x-error-by="passwordConfirm_err" x-pattern="^[A-Za-z0-9]+$">
							</div>
							<div class="x-input-addon col-sm-5">
								<div class="x-text-error" id="passwordConfirm_err"
									style="display: none">请再次输入密码，两次密码需要一致</div>
							</div>
						</div>
					</c:otherwise>
				</c:choose>
				<div class="form-group">
					<div class="col-sm-4">
						<a class="btn x-btn-primary x-btn-submit"
							style="width: 180px; margin: 15px 60px"> 完成注册 </a>
					</div>
				</div>
			</div>
		</div>
	</form>
</div>