<section class="row" ng-controller="ChangePasswordController">
  <div class="col-xs-offset-1 col-xs-10 col-md-offset-4 col-md-4">
    <form name="passwordForm" ng-submit="changeUserPassword(passwordForm.$valid)" class="signin" novalidate autocomplete="off">
      <fieldset>
        <div class="form-group" show-errors>
          <label for="currentPassword">Current Password</label>
          <input type="password" id="currentPassword" name="currentPassword" class="form-control" ng-model="passwordDetails.currentPassword" placeholder="Current Password" required>
          <div ng-messages="passwordForm.currentPassword.$error" role="alert">
            <p class="help-block error-text" ng-message="required">Your current password is required.</p>
          </div>
        </div>
        <div class="form-group" show-errors>
          <label for="newPassword">New Password</label>
          <input type="password" id="newPassword" name="newPassword" class="form-control" ng-model="passwordDetails.newPassword" placeholder="New Password" popover="{{popoverMsg}}" popover-trigger="focus" password-validator required>
          <div ng-messages="passwordForm.newPassword.$error" role="alert">
            <p class="help-block error-text" ng-message="required">Enter a new password.</p>
            <div ng-repeat="passwordError in passwordErrors">
              <p class="help-block error-text" ng-show="passwordForm.newPassword.$error.requirements">{{passwordError}}</p>
            </div>
          </div>
        </div>
        <div class="form-group" show-errors>
          <label for="verifyPassword">Verify Password</label>
          <input type="password" id="verifyPassword" name="verifyPassword" class="form-control" ng-model="passwordDetails.verifyPassword" placeholder="Verify Password" password-verify="passwordDetails.newPassword" required>
          <div ng-messages="passwordForm.verifyPassword.$error" role="alert">
            <p class="help-block error-text" ng-message="required">Verify your new password.</p>
            <p class="help-block error-text" ng-show=passwordForm.verifyPassword.$error.passwordVerify>Passwords do not match.</p>
          </div>
        </div>
        <div class="form-group" ng-show="!passwordForm.newPassword.$error.required">
          <label>Password Requirements</label>
          <progressbar value="requirementsProgress" type="{{requirementsColor}}"><span style="color:white; white-space:nowrap;">{{requirementsProgress}}%</span></progressbar>
        </div>
        <div class="text-center form-group">
          <button type="submit" class="btn btn-primary">Save Password</button>
        </div>
        <div ng-show="success" class="text-center text-success">
          <strong>Password Changed Successfully</strong>
        </div>
        <div ng-show="error" class="text-center text-danger">
          <strong ng-bind="error"></strong>
        </div>
      </fieldset>
    </form>
  </div>
</section>
