#151 Improve login component style

This commit is contained in:
mauriziovitale84
2016-06-07 17:11:13 +01:00
parent ba6aa5800f
commit 21fae1b2e5
9 changed files with 235 additions and 148 deletions

View File

@@ -1,32 +1,51 @@
<div class="login-card-wide mdl-card mdl-shadow--4dp">
<form [ngFormModel]="form" (submit)="onSubmit(form.value, $event)">
<div class="mdl-card__title">
<h2 class="mdl-card__title-text ">{{'LOGIN.LABEL.LOGIN' | translate }}</h2>
</div>
<div class="mdl-card__supporting-text">
<div [ngClass]="{'is-invalid': isErrorStyle(form.controls.username)}" class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label ">
<label for="username" class="mdl-textfield__label">{{'LOGIN.LABEL.USERNAME' | translate }}</label>
<input type="text" class="mdl-textfield__input" id="username" data-automation-id="username" ngControl="username" tabindex="1" />
<span class="mdl-tooltip mdl-tooltip--validation" for="username" *ngIf="formError.username">
<span id="username-error" data-automation-id="username-error">{{formError.username | translate }}</span>
</span>
</div>
<div class="content-grid mdl-grid content-layout">
<div class="login-card-wide mdl-card mdl-shadow--4dp">
<form [ngFormModel]="form" (submit)="onSubmit(form.value, $event)">
<div class="mdl-card__title">
<img class="center" [src]="__baseUrl + '/../assets/images/logo_for_light_bg_28.png'">
</div>
<div class="mdl-card__supporting-text">
<div class="error">
<div *ngIf="error" id="login-error" data-automation-id="login-error" class="mdl-card__supporting-text" style="color: red;">{{'LOGIN.MESSAGES.LOGIN-ERROR' | translate }}</div>
<div *ngIf="success" id="login-success" data-automation-id="login-success" class="mdl-card__supporting-text" style="color: blue;">{{'LOGIN.MESSAGES.LOGIN-SUCCESS' | translate }}</div>
</div>
<div [ngClass]="{'is-invalid': isErrorStyle(form.controls.username)}"
class="center mdl-textfield mdl-js-textfield mdl-textfield--floating-label ">
<label for="username" class="mdl-textfield__label">{{'LOGIN.LABEL.USERNAME' | translate }}</label>
<input type="text" class="mdl-textfield__input" id="username" data-automation-id="username" ngControl="username" tabindex="1" />
<span class="mdl-tooltip mdl-tooltip--validation" for="username" *ngIf="formError.username">
<span id="username-error" data-automation-id="username-error">{{formError.username | translate }}</span>
</span>
</div>
<div [ngClass]="{'is-invalid': isErrorStyle(form.controls.password)}" class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<label for="password" class="mdl-textfield__label">{{'LOGIN.LABEL.PASSWORD' | translate }}</label>
<input type="password" class="mdl-textfield__input" id="password" data-automation-id="password" ngControl="password" tabindex="2" />
<span class="mdl-tooltip mdl-tooltip--validation" for="password" *ngIf="formError.password">
<span id="password-required" data-automation-id="password-required">{{formError.password | translate }}</span>
</span>
<div [ngClass]="{'is-invalid': isErrorStyle(form.controls.password)}"
class="center mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<label for="password" class="mdl-textfield__label">{{'LOGIN.LABEL.PASSWORD' | translate }}</label>
<input type="password" class="mdl-textfield__input" id="password" data-automation-id="password" ngControl="password" tabindex="2" />
<span class="mdl-tooltip mdl-tooltip--validation" for="password" *ngIf="formError.password">
<span id="password-required" data-automation-id="password-required">{{formError.password | translate }}</span>
</span>
</div>
<br><br>
<button type="submit" class="center mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored"
data-automation-id="login-button" [disabled]="!form.valid">{{'LOGIN.BUTTON.LOGIN' | translate }}</button>
<br>
<div class="center">
<label class="center mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for="remember">
<input type="checkbox" id="remember" class="center mdl-checkbox__input">
<span class="mdl-checkbox__label">Remember</span>
</label>
</div>
</div>
</div>
<div class="mdl-card__actions mdl-card--border">
<button type="submit" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored" data-automation-id="login-button" [disabled]="!form.valid">{{'LOGIN.BUTTON.LOGIN' | translate }}</button>
<div *ngIf="error" id="login-error" data-automation-id="login-error" class="mdl-card__supporting-text" style="color: red;">{{'LOGIN.MESSAGES.LOGIN-ERROR' | translate }}</div>
<div *ngIf="success" id="login-success" data-automation-id="login-success" class="mdl-card__supporting-text" style="color: blue;">{{'LOGIN.MESSAGES.LOGIN-SUCCESS' | translate }}</div>
</div>
<div class="mdl-card__menu">
<div class="mdl-spinner mdl-js-spinner"></div>
</div>
</form>
</div>
<div class="mdl-card__actions mdl-card--border mdl-card__link">
<div class="login-action">
<div class="login-action-left"> <a href="">{{'LOGIN.ACTION.HELP' | translate }}</a> </div>
<div class="login-action-right"> <a href="">{{'LOGIN.ACTION.REGISTER' | translate }}</a> </div>
</div>
</div>
<div class="mdl-card__menu">
<div class="mdl-spinner mdl-js-spinner"></div>
</div>
</form>
</div>
</div>