rajah 1 год назад
Родитель
Сommit
c731c1362d

+ 7 - 7
src/app/categorie-list/categorie-list.component.html

@@ -3,7 +3,7 @@
 	<div class="card-header">Table des catégories</div>
 	<div class="card-header shadow-sm">
 		<div class="row">
-			<div class="form-group col-sm-4">
+			<div class="form-group col-sm-4 label-nobr">
 				<button type="button" (click)="goToRefreshListCategorie()" class="btn btn-primary btn-sm" style="margin-right: 5px;"><i class="fa-solid fa-rotate"></i>&nbsp;Actualiser</button>
 				<button type="button" (click)="goToNewCategorie()" class="btn btn-primary btn-sm" style="margin-right: 5px;"><i class="fa-solid fa-plus"></i>&nbsp;Créer</button>
 			</div>
@@ -13,12 +13,12 @@
 		<table class="table table-sm">
 			<thead class="thead-dark">
 				<tr>
-					<th><h6>Libellé</h6></th>
-					<th><h6>Disponible</h6></th>
-					<th><h6>Téléversable</h6></th>
-					<th><h6>Vote ouvert</h6></th>
-					<th><h6>Vote terminé</h6></th>
-					<th><h6>Vote publié</h6></th>
+					<th class="fs-6 label-nobr"><small>Libellé</small></th>
+					<th class="fs-6 label-nobr"><small>Disponible</small></th>
+					<th class="fs-6 label-nobr"><small>Téléversable</small></th>
+					<th class="fs-6 label-nobr"><small>Vote ouvert</small></th>
+					<th class="fs-6 label-nobr"><small>Vote terminé</small></th>
+					<th class="fs-6 label-nobr"><small>Vote publié</small></th>
 				</tr>
 			</thead>
 			<tbody>

+ 2 - 2
src/app/participant-create/participant-create.component.html

@@ -96,7 +96,7 @@
 				<div class="col-sm-10">
 					<div class="form-group field-separate">
 						<select class="form-select form-select-sm" id="status" name="status" [(ngModel)]="participant.status" required #statusRef="ngModel" [class.is-invalid]="statusRef.invalid && statusRef.touched">
-							<option value="EN_ATTENTE" selected>{{ PS.EN_ATTENTE }}</option>
+							<option [value]="PS.EN_ATTENTE">{{ PS.EN_ATTENTE }}</option>
 							<option value="PAYE_CHEQUE">{{ PS.PAYE_CHEQUE }}</option>
 							<option value="PAYE_ESPECES">{{ PS.PAYE_ESPECES }}</option>
 							<option value="VIREMENT_BANCAIRE">{{ PS.VIREMENT_BANCAIRE }}</option>
@@ -184,7 +184,7 @@
 							<option value="VIREMENT">{{ PMP.VIREMENT }}</option>
 							<option value="PAYPAL">{{ PMP.PAYPAL }}</option>
 							<option value="ESPECES">{{ PMP.ESPECES }}</option>
-							<option value="AUTRE">{{ PMP.AUTRE }}</option>
+							<option [value]="PMP.AUTRE">{{ PMP.AUTRE }}</option>
 						</select>
 					</div>
 				</div>

+ 4 - 4
src/app/participant-list/participant-list.component.html

@@ -3,7 +3,7 @@
 	<div class="card-header">Table des participants</div>
 	<div class="card-header shadow-sm">
 		<div class="row">
-			<div class="form-group col-sm-4">
+			<div class="form-group col-sm-4 label-nobr">
 				<button type="button" (click)="goToRefreshListParticipant()" class="btn btn-primary btn-sm" style="margin-right: 5px;"><i class="fa-solid fa-rotate"></i>&nbsp;Actualiser</button>
 				<button type="button" (click)="goToNewParticipant()" class="btn btn-primary btn-sm" style="margin-right: 5px;"><i class="fa-solid fa-plus"></i>&nbsp;Créer</button>
 			</div>
@@ -13,9 +13,9 @@
 		<table class="table table-sm">
 			<thead class="thead-dark">
 				<tr>
-					<th><h6>Nom</h6></th>
-					<th><h6>Pseudonyme</h6></th>
-					<th><h6>Arrivé</h6></th>
+					<th class="fs-6 label-nobr"><small>Nom</small></th>
+					<th class="fs-6 label-nobr"><small>Pseudonyme</small></th>
+					<th class="fs-6 label-nobr"><small>Arrivé</small></th>
 				</tr>
 			</thead>
 			<tbody>

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

@@ -12,7 +12,7 @@
 				<div class="col-sm-10">
 					<div class="form-group field-separate">
 						<select class="form-select form-select-sm" id="type" name="type" [(ngModel)]="production.type">
-							<option value="EXECUTABLE" selected>{{ PT.EXECUTABLE }}</option>
+							<option [value]="PT.EXECUTABLE">{{ PT.EXECUTABLE }}</option>
 							<option value="GRAPHE">{{ PT.GRAPHE }}</option>
 							<option value="MUSIQUE">{{ PT.MUSIQUE }}</option>
 							<option value="VIDEO">{{ PT.VIDEO }}</option>

+ 1 - 0
src/app/production-create/production-create.component.ts

@@ -39,6 +39,7 @@ export class ProductionCreateComponent implements OnInit
       const file = et.files[0];
  
       this.production.nomArchive = file.name;
+      this.production.numeroVersion = 1;
       
       reader.onloadend = async (e: any) => { if (e.target.result) { this.production.archive = e.target.result; } }
 

+ 31 - 13
src/app/production-list/production-list.component.html

@@ -3,7 +3,7 @@
 	<div class="card-header">Table des productions</div>
 	<div class="card-header shadow-sm">
 		<div class="row">
-			<div class="form-group col-sm-4">
+			<div class="form-group col-sm-4 label-nobr">
 				<button type="button" (click)="goToRefreshListProduction()" class="btn btn-primary btn-sm" style="margin-right: 5px;"><i class="fa-solid fa-rotate"></i>&nbsp;Actualiser</button>
 				<button type="button" (click)="goToNewProduction()" class="btn btn-primary btn-sm" style="margin-right: 5px;"><i class="fa-solid fa-plus"></i>&nbsp;Créer</button>
 			</div>
@@ -13,16 +13,25 @@
 		<table class="table table-sm">
 			<thead class="thead-dark">
 				<tr>
-					<th><h6>Type</h6></th>
-					<th><h6>Nom</h6></th>
-					<th><h6>Auteur(s) (/ Groupe(s))</h6></th>
-					<th><h6>Plateforme</h6></th>
+					<th class="fs-6 label-nobr"><small>Type</small></th>
+					<th class="fs-6 label-nobr"><small>Titre</small></th>
+					<th class="fs-6 label-nobr"><small>Auteur(s) (/ Groupe(s))</small></th>
+					<th class="fs-6 label-nobr"><small>Plateforme</small></th>
 				</tr>
 			</thead>
 			<tbody>
 				@for (production of productions; track production.numeroProduction) {
 				<tr>
-					<td class="label-nobr">{{ production.type }}&nbsp;&nbsp;</td>
+					<td class="label-nobr fs-4">
+					
+					@if (PT[production.type] === PT.EXECUTABLE) { <i class="fa-solid fa-square-binary"></i> }
+					@else if (PT[production.type] === PT.GRAPHE) { <i class="fa-solid fa-image"></i> }
+					@else if (PT[production.type] === PT.MUSIQUE) { <i class="fa-solid fa-music"></i> }
+					@else if (PT[production.type] === PT.VIDEO) { <i class="fa-solid fa-video"></i> }
+					@else if (PT[production.type] === PT.TOPIC) { <i class="fa-solid fa-comment"></i> }
+					@else { <i class="fa-solid fa-question"></i> }
+					
+					&nbsp;&nbsp;</td>
 					<td class="label-nobr"><a (click)="formProduction(production.numeroProduction)" class="link-primary pointeur-souris text-decoration-none">{{ production.titre }}</a>&nbsp;&nbsp;</td>
 					<td class="label-nobr">{{ production.auteurs }} @if (production.groupes) { @if (production.groupes.length > 0) { &nbsp;/&nbsp;{{ production.groupes }} } }&nbsp;&nbsp;</td>
 					<td class="label-nobr">{{ production.plateforme }}&nbsp;&nbsp;</td>
@@ -30,15 +39,24 @@
 				<tr>
 					<td class="label-nobr">&nbsp;</td>
 					<td class="label-nobr" colspan="3">
-						<div class="card" style="width: 18rem;">
-							<!-- <img src="..." class="card-img-top" alt="..."> -->
-							<div class="card-body">
-								<h5 class="card-title">{{ production.nomArchive }} (version&nbsp;: {{ production.numeroVersion }})</h5>
-								<p class="card-text">{{ production.commentaire }}</p>
-								<p class="card-text text-warning">{{ production.informationsPrivees }}</p>
+
+						<div class="card mb-3">
+							<div class="row g-0">
+								<div class="col-sm-2">
+									<img src="{{ production.vignette }}" class="img-fluid rounded-start">
+								</div>
+								<div class="col-sm-10">
+									<div class="card-header">
+										<p class="card-text"><span class="text-primary pointeur-souris">{{ production.nomArchive }}</span>  <small>&nbsp;(v{{ production.numeroVersion }})</small></p>
+									</div>
+									<div class="card-body">
+										<p class="card-text"><small>{{ production.commentaire }}</small></p>
+										<p class="card-text text-warning"><small>{{ production.informationsPrivees }}</small></p>
+									</div>
+								</div>
 							</div>
-							<div class="card-footer text-primary">(lien download archive)</div>
 						</div>
+
 					</td>
 				</tr>
 				}

+ 4 - 2
src/app/production-list/production-list.component.ts

@@ -1,6 +1,6 @@
 import { Component } from '@angular/core';
 import { Router } from '@angular/router';
-import { Production } from '../production';
+import { ProductionShort, ProductionTypeKeys } from '../production';
 import { ProductionService } from '../production.service';
 
 @Component({ selector: 'app-production-list', imports: [], templateUrl: './production-list.component.html', styleUrl: './production-list.component.css' })
@@ -8,7 +8,9 @@ import { ProductionService } from '../production.service';
 export class ProductionListComponent 
 {
   
-  productions: Production[] = [];
+  productions: ProductionShort[] = [];
+
+  PT = ProductionTypeKeys;
 
   constructor(private productionService: ProductionService, private router: Router) { }
 

+ 2 - 2
src/app/production.service.ts

@@ -1,7 +1,7 @@
 import { Injectable } from '@angular/core';
 import { HttpClient } from '@angular/common/http'
 import { Observable } from 'rxjs';
-import { Production } from './production';
+import { Production, ProductionShort } from './production';
 
 @Injectable({ providedIn: 'root' })
 
@@ -12,7 +12,7 @@ export class ProductionService
 
   constructor(private httpClient: HttpClient) { }
   
-  getListProduction(): Observable<Production[]>{ return this.httpClient.get<Production[]>(`${this.baseURL}/list`); }
+  getListProduction(): Observable<ProductionShort[]>{ return this.httpClient.get<ProductionShort[]>(`${this.baseURL}/list`); }
 
   createProduction(production: Production): Observable<Object>{ return this.httpClient.post(`${this.baseURL}/create`, production); }
 

+ 30 - 4
src/app/production.ts

@@ -11,10 +11,7 @@ export enum ProductionTypeEnum
 
 export class Production 
 {
-  dateCreation: string = "";
-  dateModification: string = "";
   numeroProduction: number = 0;
-  adresseIP: string = "";
   type: ProductionTypeEnum = ProductionTypeEnum.EXECUTABLE;
   titre: string = "";
   auteurs: string = "";
@@ -26,6 +23,35 @@ export class Production
   nomArchive: string = "";
   archive!: string | any;
   vignette!: string | any;
-  numeroVersion: number = 1;
+  numeroVersion: number = 0;
 }
 
+
+export enum ProductionTypeKeys
+{
+  EXECUTABLE = "EXECUTABLE",
+  GRAPHE = "GRAPHE", 
+  MUSIQUE = "MUSIQUE", 
+  VIDEO = "VIDEO", 
+  TOPIC = "TOPIC",
+  AUTRE = "AUTRE"
+}
+
+export class ProductionShort
+{
+  dateCreation: string = "";
+  dateModification: string = "";
+  numeroProduction: number = 0;
+  adresseIP: string = "";
+  type: ProductionTypeKeys = ProductionTypeKeys.EXECUTABLE;
+  titre: string = "";
+  auteurs: string = "";
+  groupes: string = "";
+  plateforme: string = "";
+  commentaire: string = "";
+  informationsPrivees: string = "";
+  numeroParticipant: number = 0;
+  nomArchive: string = "";
+  vignette!: string | any;
+  numeroVersion: number = 0;
+}

+ 5 - 6
src/app/variable-list/variable-list.component.html

@@ -3,7 +3,7 @@
 	<div class="card-header">Table des variables</div>
 	<div class="card-header shadow-sm">
 		<div class="row">
-			<div class="form-group col-sm-4">
+			<div class="form-group col-sm-4 label-nobr">
 				<button type="button" (click)="goToRefreshListVariable()" class="btn btn-primary btn-sm" style="margin-right: 5px;"><i class="fa-solid fa-rotate"></i>&nbsp;Actualiser</button>
 				<button type="button" (click)="goToNewVariable()" class="btn btn-primary btn-sm" style="margin-right: 5px;"><i class="fa-solid fa-plus"></i>&nbsp;Créer</button>
 			</div>
@@ -21,16 +21,15 @@
 		<table class="table table-sm">
 			<thead class="thead-dark">
 				<tr>
-					<th><h6>Type</h6></th>
-					<th><h6>Code</h6></th>
-					<th><h6>Valeur</h6></th>
-					<th></th>
+					<th class="fs-6 label-nobr"><small>Type</small></th>
+					<th class="fs-6 label-nobr"><small>Code</small></th>
+					<th class="fs-6 label-nobr"><small>Valeur</small></th>
 				</tr>
 			</thead>
 			<tbody>
 				@for (variable of variables; track variable.numeroVariable) {
 				<tr>
-					<td class="label-nobr">{{ variable.type }}&nbsp;&nbsp;</td>
+					<td class="label-nobr"><small>{{ variable.type }}&nbsp;&nbsp;</small></td>
 					<td class="label-nobr"><a (click)="formVariable(variable.numeroVariable)" class="link-primary pointeur-souris text-decoration-none">{{ variable.code }}</a>&nbsp;&nbsp;</td>
 					<td>{{ variable.valeur }}&nbsp;&nbsp;</td>
 				</tr>