<form name="ldapPasswordForm" ng-submit="changePassword()" novalidate>
    <div class="modal-header">
        <h4 class="modal-title">
            <span translate>profile.modal.changePassword.header</span>
        </h4>
    </div>
    <div class="modal-body">
        <div class="form-group" ng-class="{ 'has-error' : authError && ldapPasswordForm.$invalid}">
            <label for="currentPassword">
                <span translate>Current password</span>
                <span class="required-asterisk">*</span>
            </label>
            <input id="currentPassword" ng-model="currentPassword" type="password" class="form-control" placeholder="Enter your password"
                    required>
            <p class="help-block" ng-show="authError && ldapPasswordForm.$invalid">
                {{ authError }} </p>
        </div>
        <div class="form-group" ng-class="{ 'has-error' : errorMessage}">
            <label for="newPass">
                <span translate>profile.buttons.message</span>
                <span class="required-asterisk">*</span>
            </label>
            <input id="newPass" ng-model="newPassword" type="password" class="form-control"
                    placeholder="{{'profile.buttons.message'| translate}}" name="newPassword" required>
            <p class="help-block" ng-bind-html="errorMessage"></p>
        </div>
        <div class="form-group">
            <label for="confirmNewPassword">
                <span translate>profile.buttons.confirmation</span>
                <span class="required-asterisk">*</span>
            </label>
            <input id="confirmNewPassword" ng-model="confirmNewPassword" type="password" class="form-control"
                    placeholder="{{'profile.buttons.confirmation'| translate}}" name="confirmNewPassword" password-check
                    new-password="newPassword" confirm-new-password="confirmNewPassword" error-messages="passwordErrorMessages"
                    new-password-validation="newPassword" confirm-new-password-validation="confirmNewPassword" required>
            <p class="help-block" ng-show="ldapPasswordForm.newPassword.$error.notSamePasswords">
                <span class="text-danger" translate>{{passwordErrorMessages.notSamePasswordsMessage}}</span>
            </p>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-secondary" ng-click="$dismiss()">
            <span translate>profile.buttons.cancel</span>
        </button>
        <button type="submit" class="btn btn-primary" ng-disabled="ldapPasswordForm.$invalid || loading">
            <i class="fa fa-circle-o-notch fa-spin" ng-if="loading"></i>
            <span translate>profile.buttons.save</span>
        </button>
    </div>
</form>
