Skip to content

Commit d4ea995

Browse files
author
JLRR2019
committed
Merge branch 'Andrea' of https://github.com/CodeURJC-DAW-2021-22/webapp9 into JuanFase3
2 parents 1eeb285 + f1ae815 commit d4ea995

18 files changed

+234
-63
lines changed

frontend/src/app/app.module.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ import { ShowNewsComponent } from './components/news/showNews.component';
1616

1717
@NgModule({
1818
declarations: [AppComponent, LoginComponent, HeadComponent, NewsComponent, NavBarComponent, FooterComponent, NewsTemplateComponent, ShowNewsComponent],
19+
import { NavBarComponent } from './components/navBar/navBar.component'
20+
import { HomeComponent } from './components/home/home.component';
21+
22+
23+
@NgModule({
24+
declarations: [AppComponent, LoginComponent, HeaderComponent, NewsComponent, NavBarComponent, HomeComponent],
1925
imports: [BrowserModule, FormsModule, HttpClientModule, routing],
2026
bootstrap: [AppComponent]
2127
})
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<header class="bg-dark py-5">
2+
<div class="container px-5">
3+
<div class="row gx-5 align-items-center justify-content-center">
4+
<div class="col-lg-8 col-xl-7 col-xxl-6">
5+
<div class="my-5 text-center text-xl-start">
6+
<h1 class="display-5 fw-bolder text-white mb-2">Tienda y noticiero de videojuegos</h1>
7+
<p class="lead fw-normal text-white-50 mb-4">Tu lugar para informarte de los avances en tus videojuegos favoritos y donde poder obtenerlos.</p><p class="lead fw-normal text-white-50 mb-4">Como el esperado Elden Ring, un mundo abierto que promete jugabilidad parecida al dark souls con nuevas mecanicas y más.</p>
8+
</div>
9+
</div>
10+
<div class="col-xl-5 col-xxl-6 d-none d-xl-block text-center">
11+
<img class="img-fluid rounded-3 my-5" src="assets/images/eldenRing.webp" alt="..." />
12+
</div>
13+
</div>
14+
</div>
15+
</header>
16+
<!-- Features section-->
17+
<section class="py-5" id="features">
18+
<div class="container px-5 my-5" >
19+
<div class="row gx-5">
20+
<div class="col-lg-12 mb-5 mb-lg-0" style="padding-bottom: 3em;"><h2 class="fw-bolder mb-0" style="text-align: center;">Nuestros videojuegos destacados.</h2></div>
21+
<div class="col-lg-12 align-self-center">
22+
23+
<home *ngIf="images">
24+
<ng-template ngbSlide>
25+
<div class="picsum-img-wrapper">
26+
<img [src]="images[0]" alt="Random first slide">
27+
</div>
28+
<div class="carousel-caption">
29+
<h3>Lost Ark</h3>
30+
<p>Adentrate a un mundo de fantasia con tus amigos y lucha por la paz de Arkadia</p>
31+
</div>
32+
</ng-template>
33+
<ng-template ngbSlide>
34+
<div class="picsum-img-wrapper">
35+
<img [src]="images[1]" alt="Random second slide">
36+
</div>
37+
<div class="carousel-caption">
38+
<h3>Archeage 2</h3>
39+
<p>Si te gustó Archeage, este es tu juego</p>
40+
</div>
41+
</ng-template>
42+
<ng-template ngbSlide>
43+
<div class="picsum-img-wrapper">
44+
<img [src]="images[2]" alt="Random third slide">
45+
</div>
46+
<div class="carousel-caption">
47+
<h3>Leyendas Pokemon Arceus</h3>
48+
<p>Pokemon + mundo abierto, no hay nada más que decir.</p>
49+
</div>
50+
</ng-template>
51+
</home>
52+
53+
</div>
54+
</div>
55+
</div>
56+
</section>
57+
<!-- Testimonial section-->
58+
<div class="py-5 bg-purple">
59+
<div class="container px-5 my-5">
60+
<div class="row gx-5 justify-content-center">
61+
<div class="col-lg-10 col-xl-7">
62+
<div class="text-center">
63+
<div class="fs-4 mb-4 fst-italic text-white">"Un sitio para gamers. Creado, mantenido y cuidado por gamers."</div>
64+
<div class="d-flex align-items-center justify-content-center">
65+
<div class="fw-bold text-white-50">
66+
Andrea Acuña, Carlos Fuentes, Jhostin Ortiz, Juan Rico, Mani Patel.
67+
<span class="fw-bold text-primary mx-1">/</span>
68+
CEOS de GameLink
69+
</div>
70+
</div>
71+
</div>
72+
</div>
73+
</div>
74+
</div>
75+
</div>
76+
<!-- Blog preview section-->
77+
<section class="py-5">
78+
<div class="container px-5 my-5">
79+
<div id="moreImages" class="row gx-5 justify-content-center">
80+
<!-- AQUÍ VA EL NEWS TEMPLATE -->
81+
</div>
82+
83+
</div>
84+
</section>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'home',
5+
templateUrl: './home.component.html'
6+
})
7+
8+
9+
export class HomeComponent{
10+
images = ["assets/images/ lostark.jpg", "assets/images/archeAge.jpg", "assets/images/pokemonArceus.jpg"]
11+
}

frontend/src/app/components/login/login.component.html

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
<!DOCTYPE html>
2-
<html lang="en">
3-
<body class="d-flex flex-column">
4-
<main class="flex-shrink-0">
5-
<!-- Pricing section-->
61
<section class="bg-light py-5">
72
<div class="container px-5 my-5">
83
<div class="text-center mb-5">
94
<h1 class="fw-bolder text-white">Inicio de sesión</h1>
105
<p class="lead fw-normal text-white-75 mb-0">Bienvenido cliente, ¡te estábamos esperando!</p>
116
</div>
127
<div class="row gx-10 justify-content-center">
13-
<!-- modificar ofertas-->
148
<div class="col-lg-12">
159
<div class="card mb-5 mb-xl-0">
1610
<div class="card-body p-5">
@@ -48,6 +42,3 @@ <h3 class="card-title text-center">Login</h3>
4842
</div>
4943
</div>
5044
</section>
51-
</main>
52-
</body>
53-
</html>

frontend/src/app/components/login/signUp.component.html

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
<!DOCTYPE html>
2-
<html lang="en">
3-
<body class="d-flex flex-column">
4-
<main class="flex-shrink-0">
51
<section class="bg-light py-5">
62
<div class="container px-5 my-5">
73
<div class="text-center mb-5">
@@ -44,7 +40,7 @@ <h3 class="card-title text-center">Registro</h3>
4440
<input #pass type="password" class="form-control form-control-sm" id="inputPassword2" onkeyup="check()" required>
4541
<span id="passwordMessage"></span>
4642
</div>
47-
<button type="submit" (click)="signup($event, nick.value, name.value, lastName.value, email.value,
43+
<button type="submit" (click)="createUser($event, nick.value, name.value, lastName.value, email.value,
4844
pass.value)" class="btn btn-default">registrarse</button>
4945
</form>
5046
</div>
@@ -57,6 +53,3 @@ <h3 class="card-title text-center">Registro</h3>
5753
</div>
5854
</div>
5955
</section>
60-
</main>
61-
</body>
62-
</html>
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
import { Component } from '@angular/core';
2-
import { UseroService } from '../../services/Usero.service';
2+
import { UseroService } from '../../services/usero.service';
3+
import { Usero } from './../../models/usero.model';
34

45
@Component({
56
selector: 'signup',
6-
templateUrl: './usero.component.html'
7+
templateUrl: './signUp.component.html'
78
})
89
export class SignUpComponent {
910

1011
constructor(public useroService: UseroService) { }
1112

12-
signup(event: any, nick: String, name: String, lastName: String, email: String, pass: String) {
13+
createUser(event: any, nick: string, name: string, lastName: string, email: string, pass: String) {
1314

1415
event.preventDefault();
15-
16-
this.useroService.signup(nick, name, lastName, email, pass);
16+
var user: Usero = { nick, name, lastName, email, creditCard: "",image: false, roles: ['USERO']}
17+
this.useroService.createUser(user);
1718
}
1819

1920
}
Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
<!DOCTYPE html>
2-
<html lang="en">
3-
<body class="d-flex flex-column h-100">
4-
<main class="flex-shrink-0">
5-
<div class="container rounded bg-white mt-5 mb-5">
1+
2+
<div *ngIf="user" class="container rounded bg-white mt-5 mb-5">
63
<div class="row">
74
<div class="col-md-3 border-right">
85
<div class="d-flex flex-column align-items-center text-center p-3 py-5"><img
@@ -22,31 +19,33 @@ <h4 class="text-right">Mi perfil: "{{user.nick}}"</h4>
2219
</div>
2320
<div class="row mt-2">
2421
<div class="col-md-6"><label class="labels">Nombre</label>
25-
<h3>"{{user.username}}"</h3>
22+
<h3>"{{user.name}}"</h3>
2623
</div>
2724
<div class="col-md-6"><label class="labels">Apellido(s)</label>
2825
<h3>"{{user.lastName}}"</h3>
2926
</div>
3027
</div>
3128
<div class="row mt-3">
29+
3230
<div class="col-md-12"><label class="labels">Nombre de usuario</label>
33-
<input name="nick" type="text" class="form-control" placeholder="RodPerez"
34-
[(ngModel)]="{{user.nick}}">
31+
<input name="nick" type="text" class="form-control" placeholder="RodPerez" [(ngModel)]="user.nick">
3532
</div>
33+
3634
<div class="col-md-12"><label class="labels">Email</label>
37-
<input name="email" type="email" class="form-control"
38-
placeholder="[email protected]" [(ngModel)]="{{user.email}}">
35+
<input name="email" type="email" class="form-control" placeholder="[email protected]" [(ngModel)]="user.email">
3936
</div>
4037

4138

4239
<div class="col-md-12"><label class="labels">Número de tarjeta</label>
43-
<input *ngIf="user.creditCard" name="creditCard" type="text" class="form-control" placeholder="123456789A" [(ngModel)]="{{user?.creditCard}}">
40+
<input *ngIf="user.creditCard" name="creditCard" type="text" class="form-control" placeholder="123456789A" [(ngModel)]="user.creditCard">
4441
</div>
4542

4643
<div class="col-md-12">
4744
<p>Imagen de perfil</p>
4845
<input #file type='file' name='imageField' accept=".jpg, .jpeg, .png, .svg" />
4946
</div>
47+
48+
</div>
5049
</form>
5150
</div>
5251

@@ -57,16 +56,16 @@ <h3>"{{user.lastName}}"</h3>
5756
</div>
5857
<div class="col-md-4">
5958
<div class="p-3 py-5">
60-
<h4 class="text-right">Mis compras</h4>
59+
<h4 *ngIf="user.videogame" class="text-right">Mis compras</h4>
6160
<div class="d-flex justify-content-between align-items-center mb-3">
6261
<ul>
6362
<li>
6463
<div class="row">
6564
<div class="col-md-4">
66-
<img class="img-fluid rounded-3 my-5" src="/usero/{{id}}/image" alt="..." />
65+
<img class="img-fluid rounded-3 my-5" [src]="videogameImage()"/>
6766
</div>
6867
<div class="col-md-8 align-self-center">
69-
<p>"{{videogame?.title}}"</p>
68+
<p>"{{user.videogame.title}}"</p>
7069
</div>
7170
</div>
7271
</li>
@@ -76,9 +75,4 @@ <h4 class="text-right">Mis compras</h4>
7675
</div>
7776
</div>
7877
<button class="btn btn-primary profile-button m-3" (click)="logOut()" type="button">Log Out</button>
79-
</div>
80-
</div>
81-
</div>
82-
</main>
83-
</body>
84-
</html>
78+

frontend/src/app/components/user/userProfile.component.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
import { Component, ViewChild } from '@angular/core';
22
import { ActivatedRoute, Router } from '@angular/router';
33

4-
import { Usero } from 'src/app/models/usero.model';
4+
import { Usero } from './../../models/usero.model';
55
import { UseroService } from '../../services/usero.service';
6+
import { LoginService } from '../../services/login.service';
67

78
@Component({
89
selector: 'userProfile',
9-
templateUrl: './usero.component.html'
10+
templateUrl: './userProfile.component.html'
1011
})
1112
export class UserProfile {
1213

13-
user? : Usero;
14-
// FALTA AÑADIR VIDEOJUEGO Y TAMBIÉN UN MÉTODO DE IMAGEN DE VIDEOJUEGO...E IGUAL ALGO MÁS PARA MOSTRARLO BIEN
14+
user!: Usero;
1515
@ViewChild("file")
1616
file: any;
1717
removeImage? :boolean;
1818

19-
constructor(private router: Router, activatedRoute: ActivatedRoute,public useroService: UseroService) {
19+
constructor(private router: Router, activatedRoute: ActivatedRoute,public useroService: UseroService, public loginservice : LoginService) {
2020
const id = activatedRoute.snapshot.params['id'];
2121
if (id) {
2222
useroService.getUser(id).subscribe(
23-
(user: Usero) => this.user = user,
23+
(user: Usero) => user = user,
2424
(error: any) => console.error(error)
2525
);
26-
}
2726
}
27+
}
2828

2929

3030
save(){
3131
this.useroService.updateUser(this.user).subscribe(
32-
(user: Usero) => this.uploadImage(user),
32+
(user: any) => this.uploadImage(user),
3333
(error: string) => alert('Error al guardar los datos: ' + error)
3434
);
3535
}
@@ -59,4 +59,12 @@ export class UserProfile {
5959
return this.user?.image? '/api/user/' + this.user?.id + '/image' : '/assets/images/defaultProfilePhoto';
6060
}
6161

62+
videogameImage() {
63+
64+
}
65+
66+
logOut(){
67+
this.loginservice.logOut();
68+
}
69+
6270
}
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)