correction pages: register, myProfil-user, search, myPlaylists
This commit is contained in:
parent
91171a3765
commit
a8cbd4efb7
27 changed files with 278 additions and 352 deletions
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
<!-- Filtre -->
|
<!-- Filtre -->
|
||||||
<div style="text-align: center">
|
<div style="text-align: center">
|
||||||
<input (keyup)="applyFilter($event)" placeholder="Filtre: saisir la valeur d'une colonne">
|
<input (keyup)="applyFilter($event)" placeholder="Filtre...">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,10 @@ export class PopupCreateUserComponent implements OnInit
|
||||||
this.errorMessage = "Veuillez remplir le champ 'email'.";
|
this.errorMessage = "Veuillez remplir le champ 'email'.";
|
||||||
this.hasError = true;
|
this.hasError = true;
|
||||||
}
|
}
|
||||||
|
if((this.user.role.name === 'user') && ((this.user.dateOfBirth === undefined) || (this.user.dateOfBirth === null))) {
|
||||||
|
this.errorMessage = "Veuillez remplir le champ 'date de naissance'.";
|
||||||
|
this.hasError = true;
|
||||||
|
}
|
||||||
else if(!this.isValidEmail(this.user.mail)) {
|
else if(!this.isValidEmail(this.user.mail)) {
|
||||||
this.errorMessage = "Email invalide";
|
this.errorMessage = "Email invalide";
|
||||||
this.hasError = true;
|
this.hasError = true;
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,19 @@
|
||||||
<nav class="navbar navbar-expand-lg">
|
<nav class="navbar navbar-expand-lg">
|
||||||
|
|
||||||
<!-- PolyNotFound -->
|
<!-- PolyNotFound -->
|
||||||
<a class="navbar-brand" routerLink="/advertiser/manageAds"> StreamNotFound </a>
|
<a class="navbar-brand" routerLink="/advertiser/adList"> StreamNotFound </a>
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<!-- Vide -->
|
<!-- [adList] [viewsAd]-->
|
||||||
<!-- [Recherche] [Mes Playlists] [Historique] -->
|
|
||||||
<div class="collapse navbar-collapse">
|
<div class="collapse navbar-collapse">
|
||||||
<ul class="navbar-nav">
|
<ul class="navbar-nav">
|
||||||
<li class="nav-item active monLi">
|
<li class="nav-item active monLi">
|
||||||
<a class="nav-link" routerLink="/advertiser/manageAds"> Gestion des annonces </a>
|
<a class="nav-link" routerLink="/advertiser/adList"> Gestion des annonces </a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item active monLi">
|
<li class="nav-item active monLi">
|
||||||
<a class="nav-link" routerLink="/advertiser/manageAds"> Popularité des annonces </a>
|
<a class="nav-link" routerLink="/advertiser/adList"> Popularité des annonces </a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ import { PopupConfirmationComponent } from './beforeConnexion/register/popup-con
|
||||||
import {MatDialogModule} from '@angular/material/dialog';
|
import {MatDialogModule} from '@angular/material/dialog';
|
||||||
import {MatButtonModule} from "@angular/material/button";
|
import {MatButtonModule} from "@angular/material/button";
|
||||||
import { AdvertComponent } from './utils/components/advert/advert.component';
|
import { AdvertComponent } from './utils/components/advert/advert.component';
|
||||||
import { VideoCellComponent } from './user/search/video-cell/video-cell.component';
|
|
||||||
import { VideoGridComponent } from './user/search/video-grid/video-grid.component';
|
import { VideoGridComponent } from './user/search/video-grid/video-grid.component';
|
||||||
import {MatIconModule} from "@angular/material/icon";
|
import {MatIconModule} from "@angular/material/icon";
|
||||||
import { PopupAddVideoToPlaylistsComponent } from './utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component';
|
import { PopupAddVideoToPlaylistsComponent } from './utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component';
|
||||||
|
|
@ -79,7 +78,6 @@ import { InputInterestsAdminComponent } from './admin/userList/input-interests-a
|
||||||
PageSearchComponent,
|
PageSearchComponent,
|
||||||
PopupConfirmationComponent,
|
PopupConfirmationComponent,
|
||||||
AdvertComponent,
|
AdvertComponent,
|
||||||
VideoCellComponent,
|
|
||||||
VideoGridComponent,
|
VideoGridComponent,
|
||||||
PopupAddVideoToPlaylistsComponent,
|
PopupAddVideoToPlaylistsComponent,
|
||||||
IframeTrackerDirective,
|
IframeTrackerDirective,
|
||||||
|
|
|
||||||
|
|
@ -8,48 +8,43 @@
|
||||||
<mat-stepper [linear]=true>
|
<mat-stepper [linear]=true>
|
||||||
|
|
||||||
<!-- Choix du role -->
|
<!-- Choix du role -->
|
||||||
<mat-step>
|
<mat-step label="Type de compte">
|
||||||
<ng-template matStepLabel>Type de compte</ng-template>
|
|
||||||
<form style="margin-top: 10px">
|
<form style="margin-top: 10px">
|
||||||
<mat-radio-group [(ngModel)]="roleName">
|
<!-- Choix du rôle -->
|
||||||
|
<mat-radio-group [(ngModel)]="user.role.name">
|
||||||
<mat-radio-button value="user">Utilisateur standard</mat-radio-button>
|
<mat-radio-button value="user">Utilisateur standard</mat-radio-button>
|
||||||
<mat-radio-button value="advertiser">Annonceur</mat-radio-button>
|
<mat-radio-button value="advertiser">Annonceur</mat-radio-button>
|
||||||
</mat-radio-group>
|
</mat-radio-group>
|
||||||
|
|
||||||
|
<!-- Bouton suivant -->
|
||||||
<div style="text-align: right;">
|
<div style="text-align: right;">
|
||||||
<button mat-button matStepperNext>Suivant</button>
|
<button mat-button matStepperNext>Suivant</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</mat-step>
|
</mat-step>
|
||||||
|
|
||||||
|
|
||||||
<!-- Infos personelles -->
|
<!-- Infos personelles -->
|
||||||
<mat-step>
|
<mat-step label="Compte & Informations personelles">
|
||||||
<ng-template matStepLabel>Compte & Informations personelles</ng-template>
|
|
||||||
<form style="margin-top: 10px">
|
<form style="margin-top: 10px">
|
||||||
<ng-template *ngIf="roleName==='user'; then userBlock else advertiserBlock"></ng-template>
|
<!-- Redirection vers le bon bloc -->
|
||||||
|
<ng-template *ngIf="user.role.name==='user'; then userBlock else advertiserBlock"></ng-template>
|
||||||
|
|
||||||
|
<!-- Message d'erreur -->
|
||||||
|
<div *ngIf="hasError">
|
||||||
|
<mat-error>{{errorMessage}}</mat-error>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Boutons-->
|
||||||
<div style="text-align: right;">
|
<div style="text-align: right;">
|
||||||
<button mat-button matStepperPrevious>Précédent</button>
|
<button mat-button matStepperPrevious>Précédent</button>
|
||||||
<button mat-button matStepperNext (click)="checkField()">Suivant</button>
|
<button mat-button (click)="onEnregistrer()">Enregistrer</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</mat-step>
|
</mat-step>
|
||||||
|
|
||||||
<!-- Derniere étape -->
|
|
||||||
<mat-step>
|
|
||||||
<!-- label -->
|
|
||||||
<ng-template matStepLabel>
|
|
||||||
<span (click)="checkField()">Dernière étape</span>
|
|
||||||
</ng-template>
|
|
||||||
<!-- texte affiché -->
|
|
||||||
<ng-template *ngIf="!hasError ; then derniereEtapeCorrecte else derniereEtapeErronee"></ng-template>
|
|
||||||
<!-- boutons -->
|
|
||||||
<div style="text-align: right;">
|
|
||||||
<button mat-button matStepperPrevious>Précédent</button>
|
|
||||||
<button *ngIf="hasError" mat-button (click)="onValider()" disabled>Valider</button>
|
|
||||||
<button *ngIf="!hasError" mat-button (click)="onValider()">Valider</button>
|
|
||||||
</div>
|
|
||||||
</mat-step>
|
|
||||||
|
|
||||||
</mat-stepper>
|
</mat-stepper>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -157,61 +152,3 @@
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
|
|
||||||
<!-- -------------------------------------------------------------------------------------------------------- -->
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Dernière étape correcte -->
|
|
||||||
<ng-template #derniereEtapeCorrecte>
|
|
||||||
|
|
||||||
<!-- pour advertiser -->
|
|
||||||
<div *ngIf="roleName === 'advertiser'">
|
|
||||||
Cliquer sur valider pour soumettre l'inscription.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- pour user -->
|
|
||||||
<div *ngIf="roleName === 'user'">
|
|
||||||
<br>
|
|
||||||
<!-- login -->
|
|
||||||
<div class="row myRow">
|
|
||||||
<div class="col-2 myLabel">Login:</div>
|
|
||||||
<div class="col-10 myValue"> {{user.login}} </div>
|
|
||||||
</div>
|
|
||||||
<!-- mail -->
|
|
||||||
<div class="row myRow">
|
|
||||||
<div class="col-2 myLabel">Mail:</div>
|
|
||||||
<div class="col-10 myValue"> {{user.mail}} </div>
|
|
||||||
</div>
|
|
||||||
<!-- dateOfBirth -->
|
|
||||||
<div class="row myRow">
|
|
||||||
<div class="col-2 myLabel">Date de naissance:</div>
|
|
||||||
<div class="col-10 myValue">{{ user.dateOfBirth | date:'dd/LL/YYYY' }}</div>
|
|
||||||
</div>
|
|
||||||
<!-- gender -->
|
|
||||||
<div class="row myRow">
|
|
||||||
<div class="col-2 myLabel">Sexe:</div>
|
|
||||||
<div class="col-10 myValue">
|
|
||||||
<span *ngIf="user.gender==='man'"> Homme </span>
|
|
||||||
<span *ngIf="user.gender==='woman'"> Femme </span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- interets -->
|
|
||||||
<div class="row myRow">
|
|
||||||
<div class="col-2 myLabel">Centres d'intérêt:</div>
|
|
||||||
<div class="col-10 myValue" style="border-left: solid 1px #e6e6e6">
|
|
||||||
<div *ngFor="let interest of user.interests">• {{interest}}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</ng-template>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- -------------------------------------------------------------------------------------------------------- -->
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Dernière étape érronée -->
|
|
||||||
<ng-template #derniereEtapeErronee>
|
|
||||||
<mat-error>{{errorMessage}}</mat-error>
|
|
||||||
</ng-template>
|
|
||||||
|
|
|
||||||
|
|
@ -9,13 +9,12 @@ import {User} from "../../../utils/interfaces/user";
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-register',
|
selector: 'app-page-register',
|
||||||
templateUrl: './page-register.component.html',
|
templateUrl: './page-register.component.html',
|
||||||
styleUrls: ['./page-register.component.scss']
|
styleUrls: ['./page-register.component.scss']
|
||||||
})
|
})
|
||||||
export class PageRegisterComponent
|
export class PageRegisterComponent
|
||||||
{
|
{
|
||||||
roleName: string = "user";
|
|
||||||
password: string = "";
|
password: string = "";
|
||||||
confirmPassword: string = "";
|
confirmPassword: string = "";
|
||||||
hasError: boolean = false;
|
hasError: boolean = false;
|
||||||
|
|
@ -30,14 +29,14 @@ export class PageRegisterComponent
|
||||||
permission: 0,
|
permission: 0,
|
||||||
},
|
},
|
||||||
profilePictureUrl: "",
|
profilePictureUrl: "",
|
||||||
dateOfBirth: new Date(),
|
dateOfBirth: null,
|
||||||
gender: "man",
|
gender: "man",
|
||||||
interests: [],
|
interests: [],
|
||||||
isActive: false,
|
isActive: false,
|
||||||
isAccepted: false,
|
isAccepted: false,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
updatedAt: new Date(),
|
updatedAt: new Date(),
|
||||||
lastConnexion: new Date()
|
lastConnexion: null
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -48,13 +47,13 @@ export class PageRegisterComponent
|
||||||
|
|
||||||
|
|
||||||
// Envoie de l'utilisateur au backend
|
// Envoie de l'utilisateur au backend
|
||||||
onValider(): void
|
onEnregistrer(): void
|
||||||
{
|
{
|
||||||
this.checkField();
|
this.checkField();
|
||||||
if(!this.hasError)
|
if(!this.hasError)
|
||||||
{
|
{
|
||||||
if(this.roleName === "advertiser") this.user.role = { name: "advertiser", permission: 5 };
|
if(this.user.role.name === "user") this.user.role.permission = 0;
|
||||||
else this.user.role = { name: "user", permission: 0 };
|
else this.user.role.permission = 5;
|
||||||
this.user.hashPass = this.hashage(this.password);
|
this.user.hashPass = this.hashage(this.password);
|
||||||
|
|
||||||
// FAUX CODE
|
// FAUX CODE
|
||||||
|
|
@ -80,7 +79,10 @@ export class PageRegisterComponent
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const config = { width: '25%', data: { roleName: this.roleName} };
|
const config = {
|
||||||
|
width: '25%',
|
||||||
|
data: {roleName: this.user.role.name}
|
||||||
|
};
|
||||||
this.dialog
|
this.dialog
|
||||||
.open(PopupConfirmationComponent, config)
|
.open(PopupConfirmationComponent, config)
|
||||||
.afterClosed()
|
.afterClosed()
|
||||||
|
|
@ -101,7 +103,7 @@ export class PageRegisterComponent
|
||||||
this.hasError = true;
|
this.hasError = true;
|
||||||
}
|
}
|
||||||
else if(!this.isValidEmail(this.user.mail)) {
|
else if(!this.isValidEmail(this.user.mail)) {
|
||||||
this.errorMessage = "Email invalide";
|
this.errorMessage = "Email invalide.";
|
||||||
this.hasError = true;
|
this.hasError = true;
|
||||||
}
|
}
|
||||||
else if(this.password.length === 0) {
|
else if(this.password.length === 0) {
|
||||||
|
|
@ -112,6 +114,10 @@ export class PageRegisterComponent
|
||||||
this.errorMessage = "Le mot de passe est différent de sa confirmation.";
|
this.errorMessage = "Le mot de passe est différent de sa confirmation.";
|
||||||
this.hasError = true;
|
this.hasError = true;
|
||||||
}
|
}
|
||||||
|
if((this.user.role.name === 'user') && ((this.user.dateOfBirth === undefined) || (this.user.dateOfBirth === null))) {
|
||||||
|
this.errorMessage = "Veuillez remplir le champ 'date de naissance'.";
|
||||||
|
this.hasError = true;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
this.errorMessage = "" ;
|
this.errorMessage = "" ;
|
||||||
this.hasError = false;
|
this.hasError = false;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
p {
|
||||||
|
font-size: small;
|
||||||
|
}
|
||||||
|
|
||||||
|
div {
|
||||||
|
font-size: small;
|
||||||
|
}
|
||||||
|
|
@ -2,9 +2,10 @@
|
||||||
<div class="myContainer">
|
<div class="myContainer">
|
||||||
|
|
||||||
<!-- Navbar -->
|
<!-- Navbar -->
|
||||||
<div style="margin-bottom: 50px">
|
<div>
|
||||||
<app-navbar-user></app-navbar-user>
|
<app-navbar-user></app-navbar-user>
|
||||||
</div>
|
</div>
|
||||||
|
<br>
|
||||||
|
|
||||||
<!-- --------------------------------------------------------------------- -->
|
<!-- --------------------------------------------------------------------- -->
|
||||||
|
|
||||||
|
|
@ -13,16 +14,12 @@
|
||||||
|
|
||||||
<!-- liste des videos -->
|
<!-- liste des videos -->
|
||||||
<mat-grid-tile colspan="4" rowspan="1" class="celluleListeVideo">
|
<mat-grid-tile colspan="4" rowspan="1" class="celluleListeVideo">
|
||||||
<div class="videoListContainer">
|
<app-video-list [playlist]="playlist"></app-video-list>
|
||||||
<app-video-list [playlist]="playlist"></app-video-list>
|
|
||||||
</div>
|
|
||||||
</mat-grid-tile>
|
</mat-grid-tile>
|
||||||
|
|
||||||
<!-- liste des playlist -->
|
<!-- liste des playlist -->
|
||||||
<mat-grid-tile colspan="4" rowspan="1" class="celluleListePlaylist">
|
<mat-grid-tile colspan="4" rowspan="1" class="celluleListePlaylist">
|
||||||
<div class="playlistListContainer">
|
<app-playlist-list [allPlaylists]="allPlaylists" (eventEmitter)="transmitToVideoList($event)"></app-playlist-list>
|
||||||
<app-playlist-list [allPlaylists]="allPlaylists" (eventEmitter)="transmitToVideoList($event)"></app-playlist-list>
|
|
||||||
</div>
|
|
||||||
</mat-grid-tile>
|
</mat-grid-tile>
|
||||||
|
|
||||||
<!-- pub -->
|
<!-- pub -->
|
||||||
|
|
|
||||||
|
|
@ -14,16 +14,13 @@
|
||||||
// Liste des vidéos -------------------------------------------------
|
// Liste des vidéos -------------------------------------------------
|
||||||
|
|
||||||
.celluleListeVideo {
|
.celluleListeVideo {
|
||||||
margin: 0px;
|
margin: 0px 0px 0px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Liste des playlists ---------------------------------------------
|
// Liste des playlists ---------------------------------------------
|
||||||
|
|
||||||
.celluleListePlaylist {
|
.celluleListePlaylist {
|
||||||
margin: 0px;
|
margin: 0px 0px 0px 0px;
|
||||||
}
|
|
||||||
|
|
||||||
.playlistListContainer {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pub -------------------------------------------------------------
|
// Pub -------------------------------------------------------------
|
||||||
|
|
@ -36,7 +33,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.conteneurPub {
|
.conteneurPub {
|
||||||
height: 85vh;
|
//height: 85vh;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,9 @@
|
||||||
<div class="myContainer">
|
<div class="myContainer">
|
||||||
|
|
||||||
<!-- Search bar -->
|
<!-- Search bar -->
|
||||||
<div class="row" style="margin: 0px">
|
<div class="row searchBarContainer">
|
||||||
<div class="searchBarContainer">
|
<div style="text-align: center">
|
||||||
<input type="search" placeholder="recherche..." class="inputSearchBar" [(ngModel)]="search" (ngModelChange)="whileSearch()">
|
<input type="search" placeholder="recherche..." class="inputSearchBar" [(ngModel)]="search" (ngModelChange)="whileSearch()">
|
||||||
<!--
|
|
||||||
<button class="btnRechercher" (click)="onSearch()"> Rechercher </button>
|
|
||||||
-->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -26,10 +23,8 @@
|
||||||
|
|
||||||
|
|
||||||
<!-- Bouton creer playlist-->
|
<!-- Bouton creer playlist-->
|
||||||
<div class="row" style="margin: 0px">
|
<div class="row btnCreerPlaylistContainer" >
|
||||||
<div class="btnCreerPlaylistContainer">
|
<button mat-button class="btnCreerPlaylist" (click)="onCreatePlaylist()"> Creer playlist </button>
|
||||||
<button class="btnCreerPlaylist" (click)="onCreatePlaylist()"> Creer playlist </button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,7 @@
|
||||||
background-color: white ;
|
background-color: white ;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 35vw;
|
width: 35vw;
|
||||||
height: 79vh;
|
margin: 1vh 0vh 3vh 0vh;
|
||||||
margin: 3vh 0vh 3vh 0vh;
|
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
border: solid 2px black;
|
border: solid 2px black;
|
||||||
}
|
}
|
||||||
|
|
@ -11,14 +10,16 @@
|
||||||
// SearchBar -----------------------------------------------------------
|
// SearchBar -----------------------------------------------------------
|
||||||
|
|
||||||
.searchBarContainer {
|
.searchBarContainer {
|
||||||
|
text-align: center;
|
||||||
|
margin: 0px 0px 0px 0px;
|
||||||
|
padding: 10px 0px 10px 0px;
|
||||||
background-color: #dcdcdc;
|
background-color: #dcdcdc;
|
||||||
border-bottom: solid 2px black;
|
font-size: large;
|
||||||
height: 5vh;
|
border-bottom: solid 1px black;
|
||||||
padding: 15px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.inputSearchBar {
|
.inputSearchBar {
|
||||||
width: 50%;
|
width: 70%;
|
||||||
}
|
}
|
||||||
.btnRechercher {
|
.btnRechercher {
|
||||||
border: solid black 1px;
|
border: solid black 1px;
|
||||||
|
|
@ -29,7 +30,7 @@
|
||||||
|
|
||||||
.playlistListContainer {
|
.playlistListContainer {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
height: 70vh;
|
height: 60vh;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
|
|
@ -42,7 +43,7 @@
|
||||||
.btnPlaylist {
|
.btnPlaylist {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
border-bottom: solid 2px black;
|
border-bottom: solid 1px black;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.btnPlaylist:hover {
|
.btnPlaylist:hover {
|
||||||
|
|
@ -57,19 +58,12 @@
|
||||||
// Bouton creer playlist -------------------------------------------------
|
// Bouton creer playlist -------------------------------------------------
|
||||||
|
|
||||||
.btnCreerPlaylistContainer {
|
.btnCreerPlaylistContainer {
|
||||||
height: 4vh;
|
margin: 0px 0px 0px 0px;
|
||||||
margin: 0px;
|
background-color: #dcdcdc;
|
||||||
padding: 0px;
|
font-size: large;
|
||||||
|
border-top: solid 1px black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btnCreerPlaylist {
|
.btnCreerPlaylist {
|
||||||
background-color: #dcdcdc;
|
margin: 0px 0px 0px 0px;
|
||||||
border-top: solid 2px black;
|
|
||||||
border-bottom: solid 2px black;
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
.btnCreerPlaylist:hover {
|
|
||||||
background-color: #969696;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import {ThemeService} from "../../../utils/services/theme/theme.service";
|
||||||
import {Playlist} from "../../../utils/interfaces/playlist";
|
import {Playlist} from "../../../utils/interfaces/playlist";
|
||||||
import {MessageService} from "../../../utils/services/message/message.service";
|
import {MessageService} from "../../../utils/services/message/message.service";
|
||||||
import {MatDialog} from "@angular/material/dialog";
|
import {MatDialog} from "@angular/material/dialog";
|
||||||
import {PopupAddVideoToPlaylistsComponent} from "../../../utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component";
|
|
||||||
import {MatSnackBar} from "@angular/material/snack-bar";
|
import {MatSnackBar} from "@angular/material/snack-bar";
|
||||||
import {PopupCreatePlaylistComponent} from "../../../utils/components/popup-create-playlist/popup-create-playlist.component";
|
import {PopupCreatePlaylistComponent} from "../../../utils/components/popup-create-playlist/popup-create-playlist.component";
|
||||||
|
|
||||||
|
|
@ -46,7 +45,7 @@ export class PlaylistListComponent implements OnInit
|
||||||
|
|
||||||
onCreatePlaylist(): void
|
onCreatePlaylist(): void
|
||||||
{
|
{
|
||||||
const config = { width: '15%', data: this.tabPlaylist };
|
const config = { width: '30%', data: this.tabPlaylist };
|
||||||
this.dialog
|
this.dialog
|
||||||
.open(PopupCreatePlaylistComponent, config )
|
.open(PopupCreatePlaylistComponent, config )
|
||||||
.afterClosed()
|
.afterClosed()
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,7 @@
|
||||||
<div class="myContainer">
|
<div class="myContainer">
|
||||||
|
|
||||||
<!-- Bordure haute -->
|
<!-- Bordure haute -->
|
||||||
<div class="row" style="margin: 0px; padding: 0px">
|
<div class="row topBorder">
|
||||||
<div class="topBorder">
|
|
||||||
|
|
||||||
<!-- Playlist existe ? -->
|
<!-- Playlist existe ? -->
|
||||||
<div *ngIf="(playlist !== null) && (playlist !== undefined); then ok1 else nope1"></div>
|
<div *ngIf="(playlist !== null) && (playlist !== undefined); then ok1 else nope1"></div>
|
||||||
|
|
@ -18,7 +17,6 @@
|
||||||
<span class="spanPlayListTitle"> Aucune playlist selectionnée </span>
|
<span class="spanPlayListTitle"> Aucune playlist selectionnée </span>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -66,8 +64,8 @@
|
||||||
|
|
||||||
|
|
||||||
<!-- Bordure basse -->
|
<!-- Bordure basse -->
|
||||||
<div class="row" style="margin: 0px; padding: 0px">
|
<div class="row bottomBorder">
|
||||||
<div class="bottomBorder"></div>
|
<div style="visibility: hidden">a</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -2,51 +2,46 @@
|
||||||
background-color: white ;
|
background-color: white ;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 35vw;
|
width: 35vw;
|
||||||
height: 79vh;
|
margin: 1vh 0vh 3vh 0vh;
|
||||||
margin: 3vh 0vh 3vh 0vh;
|
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
border: solid 1px black;
|
border: solid 2px black;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TopBorder --------------------------------------------------------
|
// TopBorder --------------------------------------------------------
|
||||||
|
|
||||||
.topBorder {
|
.topBorder {
|
||||||
height: 4vh;
|
margin: 0px 0px 0px 0px;
|
||||||
background-color: #dcdcdc;
|
background-color: #dcdcdc;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding: 7px;
|
padding: 5px 0px 5px 5px;
|
||||||
display: inline-block;
|
|
||||||
border-bottom: solid 1px black;
|
border-bottom: solid 1px black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spanPlayListTitle {
|
.spanPlayListTitle {
|
||||||
height: 100%;
|
font-size: large;
|
||||||
padding: 0px;
|
|
||||||
font-size: x-large;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Liste des videos ------------------------------------------------
|
// Liste des videos ------------------------------------------------
|
||||||
|
|
||||||
.listVideoContainer {
|
.listVideoContainer {
|
||||||
height: 73vh;
|
height: 65vh;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
.videoContainer {
|
.videoContainer {
|
||||||
border-bottom: solid 2px black;
|
border-bottom: solid 1px black;
|
||||||
padding: 25px;
|
padding: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
// BottomBorder --------------------------------------------------------
|
// BottomBorder --------------------------------------------------------
|
||||||
|
|
||||||
.bottomBorder {
|
.bottomBorder {
|
||||||
height: 2vh;
|
margin: 0px 0px 0px 0px;
|
||||||
background-color: #dcdcdc;
|
background-color: #dcdcdc;
|
||||||
border-top: solid 1px black;
|
border-top: solid 1px black;
|
||||||
border-bottom: solid 1px black;
|
border-bottom: solid 1px black;
|
||||||
|
font-size: large;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,49 +9,13 @@
|
||||||
|
|
||||||
<!-- Photo de profil -->
|
<!-- Photo de profil -->
|
||||||
<div style="text-align: center">
|
<div style="text-align: center">
|
||||||
<img [src]="user.profilePictureUrl"
|
<img [src]="user.profilePictureUrl" onerror="this.onerror=null; this.src='assets/profil.png'">
|
||||||
onerror="this.onerror=null; this.src='assets/profil.png'">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- login -->
|
<!-- Col gauche & droite -->
|
||||||
<div class="row myRow">
|
<div class="row">
|
||||||
<div class="col-6 myLabel">Login:</div>
|
<ng-template *ngIf="true; then leftCol"></ng-template>
|
||||||
<div class="col-6 myValue"> {{user.login}} </div>
|
<ng-template *ngIf="true; then rightCol"></ng-template>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- mail -->
|
|
||||||
<div class="row myRow">
|
|
||||||
<div class="col-6 myLabel">Mail:</div>
|
|
||||||
<div class="col-6 myValue"> {{user.mail}} </div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- dateOfBirth -->
|
|
||||||
<div class="row myRow">
|
|
||||||
<div class="col-6 myLabel">Date de naissance:</div>
|
|
||||||
<div class="col-6 myValue">{{ user.dateOfBirth | date:'dd/LL/YYYY' }}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- gender -->
|
|
||||||
<div class="row myRow">
|
|
||||||
<div class="col-6 myLabel">Sexe:</div>
|
|
||||||
<div class="col-6 myValue">
|
|
||||||
<span *ngIf="user.gender==='man'"> Homme </span>
|
|
||||||
<span *ngIf="user.gender==='woman'"> Femme </span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- interets -->
|
|
||||||
<div class="row myRow">
|
|
||||||
<div class="col-6 myLabel">Centres d'intérêt:</div>
|
|
||||||
<div class="col-6 myValue" style="border-left: solid 1px #e6e6e6">
|
|
||||||
<div *ngFor="let interest of user.interests">• {{interest}}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- createdAt -->
|
|
||||||
<div class="row myRow">
|
|
||||||
<div class="col-6 myLabel">Date de création:</div>
|
|
||||||
<div class="col-6 myValue">{{ user.createdAt | date:'dd/LL/YYYY' }}</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Modifier profil -->
|
<!-- Modifier profil -->
|
||||||
|
|
@ -61,6 +25,68 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- --------------------------------------------------------------------------------------------------------------- -->
|
||||||
|
|
||||||
|
|
||||||
|
<ng-template #leftCol>
|
||||||
|
<div class="col-6">
|
||||||
|
|
||||||
|
<!-- login -->
|
||||||
|
<div class="row myRow">
|
||||||
|
<div class="col-8 myLabel">Login:</div>
|
||||||
|
<div class="col-4 myValue"> {{user.login}} </div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- mail -->
|
||||||
|
<div class="row myRow">
|
||||||
|
<div class="col-8 myLabel">Mail:</div>
|
||||||
|
<div class="col-4 myValue"> {{user.mail}} </div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- gender -->
|
||||||
|
<div class="row myRow">
|
||||||
|
<div class="col-8 myLabel">Sexe:</div>
|
||||||
|
<div class="col-4 myValue">
|
||||||
|
<span *ngIf="user.gender==='man'"> Homme </span>
|
||||||
|
<span *ngIf="user.gender==='woman'"> Femme </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- createdAt -->
|
||||||
|
<div class="row myRow">
|
||||||
|
<div class="col-8 myLabel">Date de création:</div>
|
||||||
|
<div class="col-4 myValue">{{ user.createdAt | date:'dd/LL/YYYY' }}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- --------------------------------------------------------------------------------------------------------------- -->
|
||||||
|
|
||||||
|
|
||||||
|
<ng-template #rightCol>
|
||||||
|
<div class="col-6" style="border-left: solid 1px #e6e6e6">
|
||||||
|
|
||||||
|
<!-- dateOfBirth -->
|
||||||
|
<div class="row myRow">
|
||||||
|
<div class="col-4 myLabel">Date de naissance:</div>
|
||||||
|
<div class="col-8 myValue">{{ user.dateOfBirth | date:'dd/LL/YYYY' }}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- interets -->
|
||||||
|
<div class="row myRow">
|
||||||
|
<div class="col-4 myLabel">Centres d'intérêt:</div>
|
||||||
|
<div class="col-8 myValue">
|
||||||
|
<div class="interestsContainer">
|
||||||
|
<div *ngFor="let interest of user.interests" class="interest"> {{interest}} </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
.boite {
|
.boite {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
width: 25%;
|
width: 70%;
|
||||||
margin-top: 10vh;
|
margin-top: 10vh;
|
||||||
border: solid 3px;
|
border: solid 3px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
border-color: white;
|
border-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
img {
|
img {
|
||||||
margin: 0px 0px 10px 0px;
|
margin: 0px 0px 10px 0px;
|
||||||
|
|
@ -34,6 +35,7 @@ img {
|
||||||
font-size: xxx-large;
|
font-size: xxx-large;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
.myRow {
|
.myRow {
|
||||||
margin: 15px 0px 15px 0px;
|
margin: 15px 0px 15px 0px;
|
||||||
|
|
@ -50,6 +52,21 @@ img {
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
.interestsContainer {
|
||||||
|
width: 70%;
|
||||||
|
height: 15vh;
|
||||||
|
overflow-y: scroll;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.interest {
|
||||||
|
border-bottom: 1px solid #dcdcdc;
|
||||||
|
padding: 5px 5px 5px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
.btnContainer {
|
.btnContainer {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
@ -59,3 +76,5 @@ img {
|
||||||
border: solid 1px black;
|
border: solid 1px black;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,10 @@ export class PopupUpdateUserComponent implements OnInit
|
||||||
this.errorMessage = "Email invalide" ;
|
this.errorMessage = "Email invalide" ;
|
||||||
this.hasError = true;
|
this.hasError = true;
|
||||||
}
|
}
|
||||||
|
else if((this.userCopy.dateOfBirth === undefined) || (this.userCopy.dateOfBirth === null)) {
|
||||||
|
this.errorMessage = "Veuillez remplir le champ 'date de naissance'.";
|
||||||
|
this.hasError = true;
|
||||||
|
}
|
||||||
else if(this.changePassword) {
|
else if(this.changePassword) {
|
||||||
if (this.newPassword.length === 0) {
|
if (this.newPassword.length === 0) {
|
||||||
this.errorMessage = "Veuillez remplir le champ 'mot de passe'" ;
|
this.errorMessage = "Veuillez remplir le champ 'mot de passe'" ;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="myContainer">
|
<div class="myContainer">
|
||||||
|
|
||||||
<!-- Navbar -->
|
<!-- Navbar -->
|
||||||
<div style="margin-bottom: 50px">
|
<div style="margin-bottom: 30px">
|
||||||
<app-navbar-user></app-navbar-user>
|
<app-navbar-user></app-navbar-user>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
<!-- [Search bar] + [Site de streaming] -->
|
<!-- [Search bar] + [Site de streaming] -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-2"></div>
|
<div class="col-2"></div>
|
||||||
<div class="col-8" style="margin-bottom: 20px">
|
<div class="col-8" style="margin-bottom: 10px">
|
||||||
|
|
||||||
<!-- Search bar -->
|
<!-- Search bar -->
|
||||||
<div class="row" style="margin-bottom: 10px">
|
<div class="row" style="margin-bottom: 10px">
|
||||||
|
|
@ -44,7 +44,6 @@
|
||||||
<!-- --------------------------------------------------------------------- -->
|
<!-- --------------------------------------------------------------------- -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- [pub gauche] + [Grilles des videos] + [pub droite] -->
|
<!-- [pub gauche] + [Grilles des videos] + [pub droite] -->
|
||||||
<mat-grid-list cols="11" rowHeight="75vh">
|
<mat-grid-list cols="11" rowHeight="75vh">
|
||||||
|
|
||||||
|
|
@ -70,6 +69,7 @@
|
||||||
</mat-grid-tile>
|
</mat-grid-tile>
|
||||||
|
|
||||||
</mat-grid-list>
|
</mat-grid-list>
|
||||||
|
<br><br>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -11,22 +11,23 @@
|
||||||
max-width: 100vw;
|
max-width: 100vw;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.inputSearchBar {
|
.inputSearchBar {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
font-size: x-large;
|
font-size: large;
|
||||||
}
|
}
|
||||||
.btnRechercher {
|
.btnRechercher {
|
||||||
border: solid black 1px;
|
border: solid black 1px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
font-size: x-large;
|
font-size: large;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.celluleGrilleVideo {
|
.celluleGrilleVideo {
|
||||||
border: solid 4px;
|
border: solid 2px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import {MessageService} from "../../../utils/services/message/message.service";
|
import {MessageService} from "../../../utils/services/message/message.service";
|
||||||
import {FictitiousDatasService} from "../../../utils/services/fictitiousDatas/fictitious-datas.service";
|
import {FictitiousDatasService} from "../../../utils/services/fictitiousDatas/fictitious-datas.service";
|
||||||
import {AddVideoToPlaylistsService} from "../../../utils/services/addVideoToPlaylists/add-video-to-playlists.service";
|
|
||||||
import {Video} from "../../../utils/interfaces/video";
|
import {Video} from "../../../utils/interfaces/video";
|
||||||
import {Advert} from "../../../utils/interfaces/advert";
|
import {Advert} from "../../../utils/interfaces/advert";
|
||||||
import {ThemeService} from "../../../utils/services/theme/theme.service";
|
import {ThemeService} from "../../../utils/services/theme/theme.service";
|
||||||
|
|
@ -37,7 +36,7 @@ export class PageSearchComponent implements OnInit
|
||||||
ngOnInit(): void
|
ngOnInit(): void
|
||||||
{
|
{
|
||||||
// --- FAUX CODE ---
|
// --- FAUX CODE ---
|
||||||
this.tabVideo = this.fictitiousDatasService.getTabVideo(5);
|
this.tabVideo = this.fictitiousDatasService.getTabVideo(11);
|
||||||
this.ad1 = this.fictitiousDatasService.getAdvert();
|
this.ad1 = this.fictitiousDatasService.getAdvert();
|
||||||
this.ad2 = this.fictitiousDatasService.getAdvert();
|
this.ad2 = this.fictitiousDatasService.getAdvert();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
|
||||||
|
|
||||||
<div [class]="themeService.getClassTheme()">
|
|
||||||
<div class="conteneur">
|
|
||||||
<iframe appIframeTracker [src]=safeUrl allowfullscreen (iframeClick)="onIframeClick()"></iframe><br/>
|
|
||||||
<span>{{video.title}}</span>
|
|
||||||
<button mat-icon-button (click)="onAdd()">
|
|
||||||
<mat-icon > add_circle </mat-icon>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
.conteneur {
|
|
||||||
text-align: center;
|
|
||||||
border: solid 2px;
|
|
||||||
border-radius: 5px;
|
|
||||||
padding-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lightTheme .conteneur {
|
|
||||||
background-color: #ffffff;
|
|
||||||
border-color: black;
|
|
||||||
font-color: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
.darkTheme .conteneur {
|
|
||||||
background-color: #c8c8c8;
|
|
||||||
border-color: #ffffff;
|
|
||||||
font-color: white;
|
|
||||||
}
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
||||||
|
|
||||||
import { VideoCellComponent } from './video-cell.component';
|
|
||||||
|
|
||||||
describe('RectangleVideoComponent', () => {
|
|
||||||
let component: VideoCellComponent;
|
|
||||||
let fixture: ComponentFixture<VideoCellComponent>;
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
|
||||||
await TestBed.configureTestingModule({
|
|
||||||
declarations: [ VideoCellComponent ]
|
|
||||||
})
|
|
||||||
.compileComponents();
|
|
||||||
});
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
fixture = TestBed.createComponent(VideoCellComponent);
|
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should create', () => {
|
|
||||||
expect(component).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
import {Component, Input, OnInit } from '@angular/core';
|
|
||||||
import {VideoUrlService} from "../../../utils/services/videoUrl/video-url.service";
|
|
||||||
import {AddVideoToPlaylistsService} from "../../../utils/services/addVideoToPlaylists/add-video-to-playlists.service";
|
|
||||||
import {Video} from "../../../utils/interfaces/video";
|
|
||||||
import {ThemeService} from "../../../utils/services/theme/theme.service";
|
|
||||||
import {MessageService} from "../../../utils/services/message/message.service";
|
|
||||||
import {UserHistoryService} from "../../../utils/services/userHistory/userHistory.service";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-video-cell',
|
|
||||||
templateUrl: './video-cell.component.html',
|
|
||||||
styleUrls: ['./video-cell.component.scss']
|
|
||||||
})
|
|
||||||
export class VideoCellComponent implements OnInit
|
|
||||||
{
|
|
||||||
@Input() video: Video;
|
|
||||||
safeUrl;
|
|
||||||
tabVideoUrlClicked: string[] = [];
|
|
||||||
|
|
||||||
constructor( private videoUrlService: VideoUrlService,
|
|
||||||
private addVideoToPlaylistsService: AddVideoToPlaylistsService,
|
|
||||||
public themeService: ThemeService,
|
|
||||||
private messageService: MessageService,
|
|
||||||
private historiqueService: UserHistoryService ) {}
|
|
||||||
|
|
||||||
ngOnInit(): void
|
|
||||||
{
|
|
||||||
this.safeUrl = this.videoUrlService.safeUrl(this.video.url);
|
|
||||||
}
|
|
||||||
|
|
||||||
onAdd(): void
|
|
||||||
{
|
|
||||||
this.addVideoToPlaylistsService.run(this.video);
|
|
||||||
}
|
|
||||||
|
|
||||||
onIframeClick()
|
|
||||||
{
|
|
||||||
console.log("onIframeClick: " + this.video.title);
|
|
||||||
this.historiqueService.addVideoToHistoque(this.video);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +1,30 @@
|
||||||
<div class="conteneur">
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||||
<nav>
|
|
||||||
<ul>
|
|
||||||
<li class="row ligne" *ngFor="let triplet of tabTriplet">
|
<!-- Grille -->
|
||||||
<div class="col-4" *ngFor="let video of triplet">
|
<div style="height: 93%">
|
||||||
<app-video-cell [video]="video"></app-video-cell>
|
<mat-grid-list cols="3" rowHeight="33%">
|
||||||
</div>
|
<mat-grid-tile colspan="1" rowspan="1" *ngFor="let k of [0,1,2,3,4,5,6,7,8]">
|
||||||
</li>
|
<div class="myCell" *ngIf="indexPage+k < tabVideo.length" [title]="tabVideo[indexPage+k].title">
|
||||||
</ul>
|
|
||||||
</nav>
|
<iframe appIframeTracker
|
||||||
|
[src]=videoUrlService.safeUrl(tabVideo[indexPage+k].url)
|
||||||
|
allowfullscreen
|
||||||
|
(iframeClick)="onIframeClick(tabVideo[indexPage+k])"></iframe><br>
|
||||||
|
|
||||||
|
<span> {{tronquage(tabVideo[indexPage+k].title)}} </span>
|
||||||
|
<button mat-icon-button (click)="onAdd(tabVideo[indexPage+k])">
|
||||||
|
<mat-icon> add_circle </mat-icon>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</mat-grid-tile>
|
||||||
|
</mat-grid-list>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Paginator -->
|
||||||
|
<div class="btnContainer">
|
||||||
|
<button mat-button class="btnPaginator" [disabled]="indexPage<=0" (click)="indexPage=indexPage-9"> < Précédent </button>
|
||||||
|
<button mat-button class="btnPaginator" [disabled]="indexPage+9>=tabVideo.length" (click)="indexPage=indexPage+9"> Suivant > </button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,40 @@
|
||||||
.conteneur {
|
mat-grid-list {
|
||||||
height: 100%;
|
margin: 0px 0px 0px 0px;
|
||||||
|
padding: 0px 0px 0px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav ul {
|
mat-grid-tile {
|
||||||
overflow: hidden;
|
margin: 0px 0px 0px 0px;
|
||||||
overflow-y: scroll;
|
padding: 0px 0px 0px 0px;
|
||||||
height: 75vh;
|
border: solid 1px black;
|
||||||
padding: 30px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ligne {
|
|
||||||
margin: 30px 0px 30px 0px;
|
// ---------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
.myCell {
|
||||||
|
margin: 0px 0px 0px 0px;
|
||||||
|
padding: 15px 0px 0px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
iframe {
|
||||||
|
padding: 0px 0px 0px 0px;
|
||||||
|
width: 85%;
|
||||||
|
height: 15vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
.btnContainer {
|
||||||
|
margin: 0px 0px 0px 0px;
|
||||||
|
padding: 0px 0px 0px 0px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btnPaginator {
|
||||||
|
margin: 0px 0px 0px 0px;
|
||||||
|
padding: 0px 0px 0px 0px;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import {Component, Input, OnChanges} from '@angular/core';
|
import {Component, Input, OnChanges } from '@angular/core';
|
||||||
import {Video} from "../../../utils/interfaces/video";
|
import {Video} from "../../../utils/interfaces/video";
|
||||||
import {UserHistoryService} from "../../../utils/services/userHistory/userHistory.service";
|
import {UserHistoryService} from "../../../utils/services/userHistory/userHistory.service";
|
||||||
|
import {AddVideoToPlaylistsService} from "../../../utils/services/addVideoToPlaylists/add-video-to-playlists.service";
|
||||||
|
import {VideoUrlService} from "../../../utils/services/videoUrl/video-url.service";
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|
@ -11,31 +13,33 @@ import {UserHistoryService} from "../../../utils/services/userHistory/userHistor
|
||||||
export class VideoGridComponent implements OnChanges
|
export class VideoGridComponent implements OnChanges
|
||||||
{
|
{
|
||||||
@Input() tabVideo: Video[] = [];
|
@Input() tabVideo: Video[] = [];
|
||||||
tabTriplet = [];
|
indexPage: number = 0;
|
||||||
|
|
||||||
|
constructor( private historiqueService: UserHistoryService,
|
||||||
constructor(private historiqueService: UserHistoryService) {}
|
private addVideoToPlaylistsService: AddVideoToPlaylistsService,
|
||||||
|
private videoUrlService: VideoUrlService ) {}
|
||||||
|
|
||||||
|
|
||||||
ngOnChanges(): void
|
ngOnChanges(): void
|
||||||
{
|
{
|
||||||
this.historiqueService.clearTabVideoUrlClicked();
|
//this.historiqueService.clearTabVideoUrlClicked();
|
||||||
|
}
|
||||||
|
|
||||||
this.tabTriplet = [];
|
onAdd(video: Video): void
|
||||||
let n = this.tabVideo.length;
|
{
|
||||||
let i = 0;
|
this.addVideoToPlaylistsService.run(video);
|
||||||
while(i < n)
|
}
|
||||||
{
|
|
||||||
let triplet = []
|
onIframeClick(video: Video)
|
||||||
let compteur = 0;
|
{
|
||||||
while((compteur < 3) && (i < n))
|
console.log("onIframeClick: " + video.title);
|
||||||
{
|
this.historiqueService.addVideoToHistoque(video);
|
||||||
triplet.push(this.tabVideo[i]);
|
}
|
||||||
i++ ;
|
|
||||||
compteur++ ;
|
tronquage(str: string)
|
||||||
}
|
{
|
||||||
this.tabTriplet.push(triplet)
|
if(str.length < 30) return str;
|
||||||
}
|
else return str.substring(0, 30) + "..." ;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in a new issue