<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" data-ng-click="close()" aria-hidden="true">×</button>
    <h5 class="modal-title">修改密码</h5>
</div>
<div class="modal-body clearfix">
    <form name="adminForm" class="form-horizontal no-margin" id="type-constraint" data-validate="parsley" novalidate>
        <div class="form-group"
             ng-class="adminForm.oldPassword.$invalid && adminForm.oldPassword.$dirty ? 'has-error': ''">
            <label class="control-label col-lg-3">旧密码:</label>
            <div class="col-lg-9">
                <input name="oldPassword" ng-model="admin.oldPassword" type="password" class="form-control"
                       placeholder="旧密码" required>
                <label class="control-label" ng-show="adminForm.oldPassword.$invalid && adminForm.oldPassword.$dirty">旧密码不能为空</label>
            </div>
        </div>
        <div class="form-group"
             ng-class="adminForm.newPassword.$invalid && adminForm.newPassword.$dirty ? 'has-error': ''">
            <label class="control-label col-lg-3">新密码:</label>
            <div class="col-lg-9">
                <input name="newPassword" ng-model="admin.newPassword" type="password" class="form-control" placeholder="新密码" required>
                <label class="control-label" ng-show="adminForm.newPassword.$invalid && adminForm.newPassword.$dirty">新密码不能为空</label>
            </div>
        </div>
        <div class="form-group"
             ng-class="adminForm.confirmNewPassword.$invalid && adminForm.confirmNewPassword.$dirty || (adminForm.confirmNewPassword.$dirty && admin.confirmNewPassword!=admin.newPassword) ? 'has-error': ''">
            <label class="control-label col-lg-3">确认新密码:</label>
            <div class="col-lg-9">
                <input name="confirmNewPassword" ng-model="admin.confirmNewPassword" type="password"
                       class="form-control" placeholder="确认新密码" required>
                <label class="control-label"
                       ng-show="adminForm.confirmNewPassword.$invalid && adminForm.confirmNewPassword.$dirty">确认新密码不能为空</label>
                <label class="control-label has-error"
                       ng-show="(admin.confirmNewPassword!=admin.newPassword) && adminForm.confirmNewPassword.$dirty">两次输入的密码不相同</label>
            </div>
        </div>
    </form>
</div>
<div class="modal-footer">
    <button ng-click="save(admin)" class="btn btn-primary" ng-disabled="adminForm.$invalid || admin.confirmNewPassword!=admin.newPassword">保存</button>
</div>
