This commit is contained in:
crusader 2018-01-29 20:58:12 +09:00
parent 0508d64fca
commit b872838576
12 changed files with 139 additions and 9 deletions

View File

@ -0,0 +1,2 @@
export interface State {
}

View File

@ -6,7 +6,7 @@ import {
MatSlideToggleModule, MatInputModule, MatCheckboxModule,
MatToolbarModule, MatSnackBarModule, MatSidenavModule,
MatTabsModule, MatSelectModule, MatRadioModule,
MatAutocompleteModule, MatFormFieldModule,
MatAutocompleteModule, MatFormFieldModule
} from '@angular/material';
const MATERIAL_MODULES: any[] = [

View File

@ -1 +1,24 @@
<div>signin</div>
<mat-card>
<mat-card-title>Signin
<a class="redirect" [routerLink]="['/auth/sigup']">Register an account</a>
</mat-card-title>
<mat-card-content>
<form fxLayout="column" fxLayoutAlign="start stretch" [formGroup]="signinForm" (ngSubmit)="login()">
<mat-form-field class="full-width">
<input type="email" id="email" class="input" placeholder="Please enter your email"
formControlName="email" required matInput>
</mat-form-field>
<div *ngIf="formErrors.email" class="help is-danger">
{{ formErrors.email }}
</div>
<mat-form-field class="full-width">
<input type="password" id="password" class="input" placeholder="please enter your password"
formControlName="password" required matInput>
</mat-form-field>
<div *ngIf="formErrors.password" class="help is-danger">
{{ formErrors.password }}
</div>
<button mat-raised-button color="primary" type="submit" [disabled]="!signinForm.valid" (click)="login()">log in</button>
</form>
</mat-card-content>
</mat-card>

View File

@ -0,0 +1,37 @@
$gray-lighter: #eceeef !default;
$image_path: "/assets/images/" !default;
$prefix: 'sigin';
.#{$prefix} {
&-conainer {
min-height: 100%;
background-size: cover;
padding: 100px;
}
&-main {
position: relative;
margin: 0 auto;
width: 500px;
}
}
.full-width {
width: 100%;
}
.help {
}
.is-danger {
}
.redirect {
font-size: 14px;
margin-left: 10px;
color: #00AAAA;
}

View File

@ -1,4 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
@Component({
selector: 'of-member-signin',
@ -7,9 +9,35 @@ import { Component, OnInit } from '@angular/core';
})
export class SigninComponent implements OnInit {
constructor() { }
signinForm: FormGroup;
formErrors = {
'email': '',
'password': ''
};
constructor(
private router: Router,
private formBuilder: FormBuilder
) { }
ngOnInit() {
this.initForm();
}
initForm() {
this.signinForm = this.formBuilder.group({
'email': ['', [
Validators.required,
Validators.email
]
],
'password': ['', [
Validators.pattern('^(?=.*[0-9])(?=.*[a-zA-Z])([a-zA-Z0-9]+)$'),
Validators.minLength(6),
Validators.maxLength(25)
]
],
});
}
}

View File

@ -1,17 +1,25 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { SigninComponent } from './signin.component';
import { MaterialModule } from 'app/commons/ui/material/material.module';
@NgModule({
imports: [
CommonModule,
RouterModule,
FormsModule,
ReactiveFormsModule,
MaterialModule,
],
declarations: [
SigninComponent,
],
exports: [
SigninComponent
SigninComponent,
]
})
export class SigninModule { }

View File

@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ModifyModule } from 'app/packages/member/components/modify/modify.module';
import { SigninModule } from 'app/packages/member/components/signin/signin.module';
import { SignupModule } from 'app/packages/member/components/signup/signup.module';
import { ResetPasswordModule } from 'app/packages/member/components/reset-password/reset-password.module';
import { MemberService } from 'app/packages/member/services/member.service';
@NgModule({
imports: [
CommonModule,
ModifyModule,
SigninModule,
SignupModule,
ResetPasswordModule,
],
providers: [
MemberService,
]
})
export class MemberModule { }

View File

@ -2,13 +2,13 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ResetPasswordPageRoutingModule } from './reset-password-page-routing.module';
import { ResetPasswordPageComponent } from './reset-password-page.component';
import { ResetPasswordModule } from 'app/packages/member/components/reset-password/reset-password.module';
import { MemberModule } from 'app/packages/member/member.module';
@NgModule({
imports: [
CommonModule,
ResetPasswordPageRoutingModule,
ResetPasswordModule
MemberModule
],
declarations: [
ResetPasswordPageComponent,

View File

@ -1 +1,12 @@
<of-member-signin></of-member-signin>
<div fxLayout="column" fxFlexFill fxLayoutAlign="center center" style="background-image:url('../../../../../assets/images/login11.jpg');
margin-top: 10px;
height: 100%;
background-repeat: no-repeat;
background-position: center;
background-size: cover; ">
<div fxLayout="column" >
<div class=" mat-elevation-z4">
<of-member-signin></of-member-signin>
</div>
</div>
</div>

View File

@ -2,13 +2,13 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SignupPageRoutingModule } from './signup-page-routing.module';
import { SignupPageComponent } from './signup-page.component';
import { SignupModule } from 'app/packages/member/components/signup/signup.module';
import { MemberModule } from 'app/packages/member/member.module';
@NgModule({
imports: [
CommonModule,
SignupPageRoutingModule,
SignupModule
MemberModule
],
declarations: [
SignupPageComponent,

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 KiB