superdesk/superdesk-client-core

View on GitHub
scripts/core/auth/reset-password.html

Summary

Maintainability
Test Coverage
<div class="login-screen">
    <div class="login-form-container">

        <div class="logo-handler">
            <img src="images/superdesk-logo.svg" width="290" alt="Superdesk Logo">
        </div>

        <div class="form-handler">

            <form name="sendTokenForm" ng-submit="sendToken()" ng-show="flowStep == 1">
                <p class="reset-info"><i class="icon-info-sign icon--white"></i> <span translate>Provide your email in order to get 'Reset Token'. Once you get it, use it to reset your password.</span></p>
                <fieldset class="inputs">
                    <input type="email" id="user-email" ng-model="email" placeholder="{{ 'Email'|translate }}" class="fullwidth-input" required />
                </fieldset>
                <fieldset class="buttons">
                    <button ng-disabled="isSending || sendTokenForm.$invalid" type="submit" class="btn btn--sd-green">
                        {{ 'Get token' | translate }}
                        <div class="spinner" ng-show="isSending">
                          <div class="dot1"></div>
                          <div class="dot2"></div>
                        </div>
                    </button>
                </fieldset>
            </form>

            <div class="error-handler" ng-switch on="sendTokenError">
                <p class="error" ng-switch-when="400" translate>Oops! Invalid user Email.<br />Please try again.</p>
                <p class="error" ng-switch-when="403" translate>Sorry, but your account has been suspended.</p>
                <p class="error" ng-show="sendTokenError" ng-switch-default translate>Sorry, but can't reach the server now.<br />Please try again later.</p>

                <div class="network-error red" ng-show="serverStatus == 1">
                    <span class="icon-unplug"></span>
                    <p translate>No server response so far.<br />Let me try again.</p>
                </div>

                <div class="network-error yellow" ng-show="serverStatus > 1">
                    <span class="icon-unplug"></span>
                    <p translate>Trying to reconnect...<br />Please wait.</p>
                </div>
            </div>

            <div ng-show="flowStep == 2">
                <p class="reset-info"><i class="icon-info-sign icon--white"></i> <span translate>A link was sent to the specified email address. Please use it to reset your password. It is valid a limited amount of time.</span></p>
            </div>

            <form name="resetForm" ng-submit="resetPassword()"  ng-show="flowStep == 3">
                <fieldset class="inputs">
                    <input type="password" sd-password-strength name="password" ng-model="password" placeholder="{{ 'Enter new password'|translate }}" class="fullwidth-input" required />
                </fieldset>
                <fieldset class="inputs">
                    <input type="password" name="passwordConfirm" ng-model="passwordConfirm" placeholder="{{ 'Confirm new password'|translate }}" class="fullwidth-input" sd-password-confirm data-password="password" required />
                    <i ng-show="userForm.passwordConfirm.$error.required" class="required-asteriks">*</i>
                    <div ng-show="resetForm.passwordConfirm.$error.confirm" sd-valid-info>
                        <i class="icon-info-sign-warning"></i>
                        <span translate>passwords must be same</span>
                    </div>
                </fieldset>
                <fieldset class="buttons">
                    <button ng-disabled="isReseting || resetForm.$invalid" type="submit" class="btn btn--sd-green">
                        {{ 'Reset password' | translate }}
                        <div class="spinner" ng-show="isReseting">
                          <div class="dot1"></div>
                          <div class="dot2"></div>
                        </div>
                    </button>
                </fieldset>
            </form>

            <div class="links">
                <a href="/#/" class="text" translate>Have password? Sign in.</a>
                <a href="" ng-click="flowStep = 1" class="text" ng-show="flowStep === 2" translate>Don't have token? Get it.</a>
            </div>

            <div class="error-handler" ng-switch on="setPasswordError">
                <p class="error" ng-switch-when="400" translate>The activation token is not valid.</p>
                <p class="error" ng-switch-when="403" translate>Sorry, but your account has been suspended.</p>
                <p class="error" ng-show="setPasswordError" ng-switch-default translate>Sorry, but can't reach the server now.<br />Please try again later.</p>

                <div class="network-error red" ng-show="serverStatus == 1">
                    <span class="icon-unplug"></span>
                    <p translate>No server response so far.<br />Let me try again.</p>
                </div>

                <div class="network-error yellow" ng-show="serverStatus > 1">
                    <span class="icon-unplug"></span>
                    <p translate>Trying to reconnect...<br />Please wait.</p>
                </div>
            </div>
        </div>
    </div>
</div>