diff --git a/interfaceServices/loginInterface.php b/interfaceServices/loginInterface.php index 5ee690e..faca087 100644 --- a/interfaceServices/loginInterface.php +++ b/interfaceServices/loginInterface.php @@ -45,6 +45,7 @@ if( $data == false ){ $userDatap["firstName"] = $data['firstName']; $userDatap["lastName"] = $data['lastName']; $userDatap["email"] = $data['email']; + $userDatap["art"] = $data['art']; $userDatap["token"] = (string)$token; echo( json_encode( $userDatap ) ); diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 91f409e..bc4e6fa 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -5,6 +5,7 @@ import { GameGridComponent } from './game-grid/game-grid.component' import { ViewCardComponent } from './view-card/view-card.component' import { LoginComponent } from './login/login.component' import { RegisterComponent } from './register/register.component' +import { UserComponent } from './user/user.component' import { AuthGuard } from './_guards/index'; const routes: Routes = [ @@ -13,9 +14,8 @@ const routes: Routes = [ { path: 'view-card', component: ViewCardComponent, canActivate: [AuthGuard] }, { path: 'view-card/:gid', component: ViewCardComponent, canActivate: [AuthGuard] }, { path: 'login', component: LoginComponent }, - { path: 'register', component: RegisterComponent } - - + { path: 'register', component: RegisterComponent }, + { path: 'user', component: UserComponent } ]; @NgModule({ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 0228a8d..f64e0f7 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -38,6 +38,7 @@ import { fakeBackendProvider } from './_helpers/index'; import { AlertComponent } from './_directives/index'; import { AuthGuard } from './_guards/index'; import { AlertService, AuthenticationService, UserService } from './_services/index'; +import { UserComponent } from './user/user.component'; @@ -49,6 +50,7 @@ import { AlertService, AuthenticationService, UserService } from './_services/in LoginComponent, RegisterComponent, AlertComponent, + UserComponent, ], imports: [ BrowserModule, diff --git a/src/app/game-grid/game-grid.component.html b/src/app/game-grid/game-grid.component.html index c0660b4..4634f73 100644 --- a/src/app/game-grid/game-grid.component.html +++ b/src/app/game-grid/game-grid.component.html @@ -7,7 +7,7 @@ - @@ -15,8 +15,6 @@ - - diff --git a/src/app/user/user.component.css b/src/app/user/user.component.css new file mode 100644 index 0000000..6dacbf8 --- /dev/null +++ b/src/app/user/user.component.css @@ -0,0 +1,51 @@ + +.button-center{ + margin: 2px auto; + text-align:center; + display: block; +} + +.example-fill-remaining-space { + /* This fills the remaining space, by using flexbox. + Every toolbar row uses a flexbox row layout. */ + flex: 1 1 auto; +} + +.menuButton{ + margin-right: 10px; +} + +.userButton{ + +} +.userButton img{ + width:35px; + height:35px; + border-radius: 50%; +} + +.gameSearchInput{ + margin-left:25px; + border: 0; + border-radius: 4px; + color: #555; + font-size: 16px; + font-weight: 600; + height: 50%; + line-height: 20px; + outline: none; + padding: 0 0 0 15px; + width: 80%; +} + +.app-toolbar { + position: sticky; + position: -webkit-sticky; /* For macOS/iOS Safari */ + top: 0; /* Sets the sticky toolbar to be on top */ + z-index: 1000; /* Ensure that your app's content doesn't overlap the toolbar */ +} + +.card-img-top{ + width:250px; + height:auto; +} \ No newline at end of file diff --git a/src/app/user/user.component.html b/src/app/user/user.component.html new file mode 100644 index 0000000..20ac5f8 --- /dev/null +++ b/src/app/user/user.component.html @@ -0,0 +1,61 @@ + + videogame_asset + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ + + + + +
+
+ +
+ + +
+
+
+
+ +
+
+
+
+
+
+ +
+ +
+
\ No newline at end of file diff --git a/src/app/user/user.component.spec.ts b/src/app/user/user.component.spec.ts new file mode 100644 index 0000000..dd3b1d7 --- /dev/null +++ b/src/app/user/user.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UserComponent } from './user.component'; + +describe('UserComponent', () => { + let component: UserComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ UserComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(UserComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/user/user.component.ts b/src/app/user/user.component.ts new file mode 100644 index 0000000..bceae0d --- /dev/null +++ b/src/app/user/user.component.ts @@ -0,0 +1,49 @@ +import { Component, OnInit } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; + +@Component({ + selector: 'app-user', + templateUrl: './user.component.html', + styleUrls: ['./user.component.css'] +}) +export class UserComponent implements OnInit { + + currentUser; + + constructor( + private route: ActivatedRoute, + private router: Router + ){ + } + + ngOnInit(){ + this.currentUser = JSON.parse(localStorage.getItem('currentUser')); + buildForm(); + } + + buildForm(){ + + const formGroup = {}; + + formGroup["firstName"] = new FormControl( this.currentUser.firstName, this.mapValidators({ required: true }) ); + formGroup["lastName"] = new FormControl( this.currentUser.lastName, this.mapValidators({ required: true }) ); + formGroup["email"] = new FormControl( this.currentUser.email, this.mapValidators({ required: true }) ); + formGroup["art"] = new FormControl( this.currentUser.art, this.mapValidators({ required: false }) ); + + + this.form = new FormGroup(formGroup); + + if( this.currentUser.art.length != 0 ){ + //this.imageSample = "http://pugludos.com/community/uploads/"+this.currentUser.art+"/" + this.userData.Art + ".png"; + }else{ + + } + + } + + + isEmptyObject(obj) { + return (obj != undefined); + } + +} \ No newline at end of file diff --git a/src/app/view-card/view-card.component.html b/src/app/view-card/view-card.component.html index 17539f6..4c0dc97 100644 --- a/src/app/view-card/view-card.component.html +++ b/src/app/view-card/view-card.component.html @@ -5,7 +5,7 @@ - @@ -52,14 +52,14 @@
- - +
@@ -186,18 +186,18 @@ [formControlName]="'Genre'" [id]="'Genre'"> - sports - platformer - lightgun - fighter - rpg - strategy - adventure - racing - fps - action - simulation - card + sports + platformer + lightgun + fighter + rpg + strategy + adventure + racing + fps + action + simulation + card @@ -216,21 +216,20 @@ + [id]="'System'"> - SNES - N64 - PS1 - PS2 - GB - GBA - DS - NES - GC - PSP - 360 - WII + SNES + N64 + PS1 + PS2 + GB + GBA + DS + NES + GC + PSP + 360 + WII diff --git a/src/app/view-card/view-card.component.ts b/src/app/view-card/view-card.component.ts index 8165c7b..c0fad78 100644 --- a/src/app/view-card/view-card.component.ts +++ b/src/app/view-card/view-card.component.ts @@ -21,6 +21,7 @@ export class ViewCardComponent implements OnInit { imageSample = "http://lazypug.net/globalAssets/images/temp1.png"; overlay; currentUser; + notNewGame; constructor( @@ -35,10 +36,12 @@ export class ViewCardComponent implements OnInit { this.overlay = false; if( this.gid != null ){ this.gameSubscription = this.gamesService.getGameById( this.gid, this.currentUser.token, this.currentUser.id ).subscribe( data => { + this.notNewGame = true; this.gameData = data; this.buildForm(); }); }else{ + this.notNewGame = false; this.gameData = new Game(); this.buildForm(); } @@ -89,6 +92,7 @@ export class ViewCardComponent implements OnInit { this.router.navigateByUrl("/game-grid"); }); }else{ + console.log( form ); this.gameSubscription = this.gamesService.putGameById( form, this.gid, this.currentUser.token ).subscribe( data => { this.router.navigateByUrl("/game-grid"); });