Răsfoiți Sursa

dev en cours

rajah 10 luni în urmă
părinte
comite
5ca99bc4c1

+ 1 - 0
src/app/composants/production-create/production-create.component.html

@@ -78,6 +78,7 @@
 				<label class="col-sm-4 col-form-label col-form-label-sm label-nobr"><span i18n>Archive</span></label>
 				<div class="col-sm-8">
 					<input type="file" class="form-control form-control-sm field-separate" id="archive" name="archive" accept="application/zip" (change)="onArchiveSelected($event)">
+					<div class="form-text field-separate"><span i18n>La taille de l'archive est limitée à 2 Go.</span></div>
 				</div>
 			</div>
 

+ 1 - 0
src/app/composants/production-upload/production-upload.component.html

@@ -19,6 +19,7 @@
 				<label class="col-sm-4 col-form-label col-form-label-sm label-nobr"><span i18n>Archive</span></label>
 				<div class="col-sm-8">
 					<input type="file" class="form-control form-control-sm field-separate" id="archive" name="archive" accept="application/zip" (change)="onArchiveSelected($event)">
+					<div class="form-text field-separate"><span i18n>La taille de l'archive est limitée à 2 Go.</span></div>
 				</div>
 			</div>
 

+ 2 - 1
src/app/composants/show-list/show-list.component.html

@@ -6,6 +6,7 @@
 		<div class="row">
 			<div class="form-group col-sm-4 label-nobr">
 				<button type="button" (click)="goToRefreshListCategorie()" class="btn bg-gradient btn-primary btn-sm" style="margin-right: 5px;"><i class="fa-solid fa-rotate"></i>&nbsp;<span i18n>Actualiser</span></button>
+        <button type="button" (click)="getVersionPDF()" class="btn bg-gradient btn-primary btn-sm" style="margin-right: 5px;" i18n-tootip tooltip="Télécharger la version PDF de cette page pour impression" placement="right" container="body"><i class="fa-solid fa-file-text"></i>&nbsp;<span i18n>Imprimer</span></button>
 			</div>
 		</div>
 	</div>
@@ -15,7 +16,7 @@
 <div class="card shadow">
   <div class="card-header">
     {{ categorie.libelle }}&nbsp;&nbsp;&nbsp;&nbsp;
-    <button type="button" (click)="lierProductions(categorie.numeroCategorie)" class="btn bg-gradient btn-primary btn-sm" style="margin-right: 5px;" i18n-tootip tooltip="Rattacher des productions à cette catégorie et les ordonner" placement="right" container="body"><i class="fa-solid fa-link"></i>&nbsp;<span i18n>Rattacher</span></button>
+    @if (!categorie.pollable) { <button type="button" (click)="lierProductions(categorie.numeroCategorie)" class="btn bg-gradient btn-primary btn-sm" style="margin-right: 5px;" i18n-tootip tooltip="Rattacher des productions à cette catégorie et les ordonner" placement="right" container="body"><i class="fa-solid fa-link"></i>&nbsp;<span i18n>Rattacher</span></button>  }
     @if (categorie.uploadable) { }
     @if (categorie.pollable) { }
     @if (categorie.computed) { }

+ 4 - 0
src/app/composants/show-list/show-list.component.ts

@@ -45,6 +45,8 @@ export class ShowListComponent implements OnInit
 
   goToRefreshListCategorie(){ this.retreiveDatas(); }
 
+  getVersionPDF() { this.presentationService.getPresentationPDF().subscribe(response => { this.savePDF(response.body, 'presentations.pdf'); }); }
+
   formProduction(id: number) { this.router.navigate(['/production-details', id]); }
 
   lierProductions(id: number) { this.router.navigate(['/show-links', id]); }
@@ -53,4 +55,6 @@ export class ShowListComponent implements OnInit
 
   saveFile(data: any, filename?: string) { const blob = new Blob([data], {type: 'application/zip'}); saveAs(blob, filename); }
 
+  savePDF(data: any, filename?: string) { const blob = new Blob([data], {type: 'application/pdf'}); saveAs(blob, filename); }
+
 }

+ 1 - 0
src/app/interfaces/production.ts

@@ -47,6 +47,7 @@ export class ProductionShort
   vignette!: string | any;
   numeroVersion: number = 0;
   numeroCategorie: number = 0;
+  ordrePresentation: number = 0;
 }
 
 export class ProductionFile

+ 10 - 1
src/app/services/presentation.service.ts

@@ -1,5 +1,5 @@
 import { Injectable } from '@angular/core';
-import { HttpClient, HttpParams } from '@angular/common/http'
+import { HttpClient, HttpParams, HttpHeaders, HttpResponse } from '@angular/common/http'
 import { Observable } from 'rxjs';
 import { Environnement } from '../env';
 import { ProductionShort, ProductionItem } from '../interfaces/production';
@@ -18,6 +18,15 @@ export class PresentationService
     return this.httpClient.get<ProductionShort[]>(`${this.baseURL}/list-all`);
   }
 
+  getPresentationPDF(): Observable<HttpResponse<Blob>>
+  {
+    let headers = new HttpHeaders();
+
+    headers = headers.append('Accept', 'application/pdf');
+
+    return this.httpClient.get(`${this.baseURL}/file`, { headers: headers, observe: 'response', responseType: 'blob' });
+  }
+
   getLinkedProductions(id: number): Observable<ProductionItem[]> { return this.httpClient.get<ProductionItem[]>(`${this.baseURL}/list-linked/${id}`); }
 
   getUnlinkedProductions(): Observable<ProductionItem[]> { return this.httpClient.get<ProductionItem[]>(`${this.baseURL}/list-unlinked`); }