<!--

    Copyright © 2016-2018 The Thingsboard Authors

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<md-content layout="row" layout-align="center center" style="width: 100%;">
    <md-card flex="initial" class="tb-login-card" md-theme="tb-dark">
        <md-card-title>
            <img src="{{vm.logoSvg}}" aria-label="logo" class="tb-login-logo"/>
        </md-card-title>
        <md-progress-linear class="md-warn" style="z-index: 1; max-height: 0px; width: inherit;"
                            md-mode="indeterminate" ng-disabled="!$root.loading" ng-show="$root.loading"></md-progress-linear>
        <md-card-content>
            <form class="login-form" ng-submit="vm.login()">
                <div layout="column" layout-padding="" id="toast-parent">
                    <span style="height: 50px;"></span>
                    <md-input-container class="md-block">
                        <label translate>login.username</label>
                        <md-icon aria-label="{{ 'login.username' | translate }}" class="material-icons">
                            email
                        </md-icon>
                        <input id="username-input" type="email" autofocus ng-model="vm.user.name"/>
                    </md-input-container>
                    <md-input-container class="md-block">
                        <label translate>common.password</label>
                        <md-icon aria-label="{{ 'common.password' | translate }}" class="material-icons">
                            lock
                        </md-icon>
                        <input id="password-input" type="password" ng-model="vm.user.password"/>
                    </md-input-container>
                    <div layout-gt-sm="column" layout-align="space-between stretch">
                        <div layout-gt-sm="column" layout-align="space-between end">
                            <md-button ui-sref="login.resetPasswordRequest">{{ 'login.forgot-password' | translate }}
                            </md-button>
                        </div>
                    </div>
                    <md-button class="md-raised" type="submit">{{ 'login.login' | translate }}</md-button>
                </div>
            </form>
        </md-card-content>
    </md-card>
</md-content>
