Skip to content
Snippets Groups Projects
Commit 13c851a8 authored by Coralie's avatar Coralie
Browse files

modifs recherche

parent 919fbf82
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,8 @@ export class ArchiveService {
}
getArchiveRandom(): Observable<Archive[]> {
this._archive = this._httpClient.get<Archive[]>(`${environment.apiUrl}Archives/Random?count=10`);
this._archive = this._httpClient.get<Archive[]>
(`${environment.apiUrl}Archives/Random?count=10`);
return this._archive;
}
......@@ -28,7 +29,8 @@ export class ArchiveService {
this._archive = this.getArchiveRandom();
}
else {
this._archive = this._httpClient.get<Archive[]>(`${environment.apiUrl}Archives/Search?search=${str}&page=1&limit=30`);
this._archive = this._httpClient.get<Archive[]>
(`${environment.apiUrl}Archives/Search?search=${str}&page=1&limit=30`);
}
return this._archive;
}
......@@ -36,8 +38,14 @@ export class ArchiveService {
}
export interface Archive {
name: string,
fullName: string,
description: string,
link: string,
images: Image[],
date: Date
}
export interface Image {
name: string,
description: string,
link: string
}
<div *ngIf="(_archive | async) as archive">
<p-carousel [value]="archive" styleClass="custom-carousel" [numVisible]="4" [numScroll]="1" [circular]="true" [autoplayInterval]="3000" [responsiveOptions]="responsiveOptions">
<ng-template let-item pTemplate="item">
<div class="item">
<div class="item-content">
<h3 class="mb-1 name">{{item.fullName}}</h3>
<div class="mb-3">
<img src={{item.images[0].link}} [alt]="item.images[0].name" class="item-image" />
</div>
<div>
<p class="mt-0 mb-3 description">{{item.description}}</p>
<p class="mt-0 mb-3 date">{{item.date}}</p>
</div>
</div>
</div>
</ng-template>
</p-carousel>
<div *ngIf="(_archive | async) as archive" style="text-align: center;">
<div class="item" *ngFor="let item of archive">
<h2>{{item.fullName}}</h2>
<p class="mt-0 mb-3 description">{{item.description}}</p>
<p class="mt-0 mb-3 date">{{item.date}}</p>
<div class="mb-3" *ngFor="let image of item.images">
<img src={{image.link}} [alt]="image.name" style="width: 50%;" />
<br />
</div>
<br />
<br />
<br />
</div>
</div>
<div *ngIf="(_archive | async) === undefined">
<p>PAS DE RESULTATS</p>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment