Skip to content

Commit 134e06c

Browse files
committed
Merge branch 'JuanFase4'
2 parents c062c73 + 57cbda5 commit 134e06c

11 files changed

+42
-240
lines changed

backend/gamelink/src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spring.mustache.suffix=.html
1010

1111
spring.datasource.url=jdbc:postgresql://localhost:5432/gamelink
1212
spring.datasource.username=postgres
13-
spring.datasource.password=password
13+
spring.datasource.password=Juanluis-123
1414
spring.jpa.hibernate.ddl-auto=create-drop
1515

1616
logging.level.org.springframework.security=DEBUG

backend/gamelink/target/classes/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spring.mustache.suffix=.html
1010

1111
spring.datasource.url=jdbc:postgresql://localhost:5432/gamelink
1212
spring.datasource.username=postgres
13-
spring.datasource.password=password
13+
spring.datasource.password=Juanluis-123
1414
spring.jpa.hibernate.ddl-auto=create-drop
1515

1616
logging.level.org.springframework.security=DEBUG

frontend/src/app/components/news/editNew.component.html

Lines changed: 0 additions & 6 deletions
This file was deleted.

frontend/src/app/components/news/editNew.component.ts

Lines changed: 0 additions & 29 deletions
This file was deleted.

frontend/src/app/components/news/editNewForm.component.html

Lines changed: 0 additions & 86 deletions
This file was deleted.

frontend/src/app/components/news/editNewForm.component.ts

Lines changed: 0 additions & 69 deletions
This file was deleted.

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

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -90,35 +90,7 @@ <h3>Nuevas noticias sobre The Witcher 4</h3>
9090

9191
<!-- The slideshow/carousel -->
9292

93-
<a *ngIf="imagesCarousel">
94-
<ng-template ngbSlide>
95-
<div class="picsum-img-wrapper">
96-
<img [src]="imagesCarousel[0]" alt="Random first slide">
97-
</div>
98-
<div class="carousel-caption">
99-
<h3>Diablo 4</h3>
100-
<p>Fecha de lanzamiento revelada</p>
101-
</div>
102-
</ng-template>
103-
<ng-template ngbSlide>
104-
<div class="picsum-img-wrapper">
105-
<img [src]="imagesCarousel[1]" alt="Random second slide">
106-
</div>
107-
<div class="carousel-caption">
108-
<h3>Overwatch 2</h3>
109-
<p>Se cancela definitivamente</p>
110-
</div>
111-
</ng-template>
112-
<ng-template ngbSlide>
113-
<div class="picsum-img-wrapper">
114-
<img [src]="imagesCarousel[2]" alt="Random third slide">
115-
</div>
116-
<div class="carousel-caption">
117-
<h3>Mario kart 9</h3>
118-
<p>Ya es una realidad, no te lo pierdas</p>
119-
</div>
120-
</ng-template>
121-
</a>
93+
<app-carousel></app-carousel>
12294

12395
</div>
12496
</div>

frontend/src/app/components/videogame/videogame-detail.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ <h1 class="display-5 fw-bolder text-white mb-2">{{videogame.title}}</h1>
1717
style="color: aliceblue !important; font-size: 2em !important;"> Precio: {{videogame.price}}€</p>
1818
<!--Button to pay-->
1919
<button class="btn btn-primary btn-lg px-4 me-sm-3" id="payButton" (click)="purchasevideogame()">
20-
Comprar ya
20+
Comprar ya
2121
<span style="color: grey;">{{videogame.price}}€</span>
2222
</button>
2323
</div>
@@ -33,7 +33,7 @@ <h1 class="display-5 fw-bolder text-white mb-2">{{videogame.title}}</h1>
3333
<div class="col-5 text-center" >
3434
<p class="lead fw-normal text-white-50 mb-4"
3535
style="color: aliceblue !important; font-size: 2em !important; margin-top: 5%;"> Admin Actions :
36-
<button class="btn btn-primary btn-lg px-4 me-sm-3" (click)="removeVideogame()" style="margin-top: auto;">Eliminar </button>
36+
<button class="btn btn-primary btn-lg px-4 me-sm-3" (click)="removeVideogame()" style="margin-top: auto;">Eliminar </button>
3737
<button class="btn btn-outline-light btn-lg px-4" (click)="editVideogame()" style="margin-top: auto;">Editar</button>
3838
</p>
3939

@@ -95,7 +95,7 @@ <h1 style="padding-bottom: 10px;">Noticias destacadas sobre este Titulo.</h1>
9595
<div class="container px-5 my-5" style="margin-bottom: 0px !important ;">
9696
<div class="row gx-5 justify-content-center">
9797

98-
<!-- {{>newsTemplate}} FALTA AÑADIR -->
98+
<newsTemplate class="col-lg-4 mb-5" *ngFor="let ng of news" [news]="ng"></newsTemplate>
9999

100100
</div>
101101
</div>

frontend/src/app/components/videogame/videogame-detail.component.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { Router,ActivatedRoute } from '@angular/router';
33
import { Videogame } from 'src/app/models/videogame.model';
44
import { LoginService } from 'src/app/services/login.service';
55
import { VideogameService } from 'src/app/services/videogame.service';
6+
import { News } from 'src/app/models/news.model';
7+
import { NewsService } from 'src/app/services/news.service';
68

79
@Component({
810
selector: 'videogame-detail',
@@ -11,15 +13,24 @@ import { VideogameService } from 'src/app/services/videogame.service';
1113

1214
export class VideogameDetailComponent{
1315

16+
17+
news!: News[];
1418
videogame!: Videogame;
1519

16-
constructor(private router: Router,public loginService: LoginService, activatedRoute: ActivatedRoute, public videogameService: VideogameService){
17-
20+
constructor(private router: Router,public loginService: LoginService, activatedRoute: ActivatedRoute, public videogameService: VideogameService, newsService: NewsService){
21+
1822
const id = activatedRoute.snapshot.params['id'];
1923
videogameService.getVideogame(id).subscribe(
2024
videogame => this.videogame = videogame,
2125
error => console.error(error)
2226
)
27+
28+
29+
newsService.getNew(id).subscribe(
30+
news => {this.news = news as News[]},
31+
error => console.error(error)
32+
)
33+
2334
}
2435

2536
removeVideogame() {
@@ -30,13 +41,13 @@ export class VideogameDetailComponent{
3041
error => console.error(error)
3142
);
3243
}
33-
}
34-
44+
}
45+
3546
editVideogame() {
3647
this.router.navigate(['/videogame/edit/' + this.videogame.id]);
3748
}
3849

39-
purchasevideogame(){
50+
purchasevideogame(){
4051
var id = this.loginService.currentUser();
4152
this.router.navigate(['/videogame/' + this.videogame.id + '/purchase/' + id?.id]);
4253
}
@@ -45,7 +56,7 @@ export class VideogameDetailComponent{
4556
return this.videogame.imageVg? '/api/videogames/'+this.videogame.id+'/image' : '/assets/images/no_image.png';
4657
}
4758

48-
59+
4960
companyImage(){
5061
return this.videogame.imageCompany? '/api/videogames/'+this.videogame.id+'/companyImage' : '/assets/images/no_image.png';
5162
}

frontend/src/app/components/videogame/videogame-edit-form.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ <h2 style="text-align: center; padding-top: 2%;">Edit Videogame Form</h2>
177177
<div class="col-md-8">
178178
<p>Related News: </p>
179179
<select name="notices" multiple style="width: 100%;">
180-
<!-- {{#news}}
181-
<option value="{{ id }}">{{ title }}</option>
182-
{{/news}} -->
180+
181+
<option *ngFor="let ng of news" value="{{ ng.id }}">{{ ng.title }}</option>
182+
183183
</select>
184184
</div>
185185
</div>
@@ -209,4 +209,4 @@ <h2 style="text-align: center; padding-top: 2%;">Edit Videogame Form</h2>
209209
</div>
210210
</form>
211211
</section>
212-
</main>
212+
</main>

0 commit comments

Comments
 (0)