diff --git a/src/app/members/account/edit-data/edit-data.component.html b/src/app/members/account/edit-data/edit-data.component.html index aa2bd44a880eab16d719f9e015898e85649802f6..46db72f923606fd5d56e794ecc4c0910cb0a2aac 100644 --- a/src/app/members/account/edit-data/edit-data.component.html +++ b/src/app/members/account/edit-data/edit-data.component.html @@ -65,9 +65,7 @@ <mat-option *ngFor="let school of possibleSchools" [value]="school.id">{{ school.name }}</mat-option> </mat-select> </mat-form-field> - <mat-form-field class="full-width" > - <input matInput required type="text" formControlName="specialTeaching" placeholder="Enseignements de spécialité (entrer 'aucun' si jamais vous n'etes pas concerné)" > - </mat-form-field> + <div class="form-group"> <mat-form-field class="horizontal-display"> <mat-label>Classe</mat-label> @@ -97,7 +95,16 @@ </mat-form-field> </div> + + + <mat-form-field class="full-width" > + <mat-label>Enseignements de spécialité (entrer 'aucun' si jamais vous n'etes pas concerné) </mat-label> + <mat-select formControlName="specialTeaching" required > + <mat-option *ngFor="let specialTeaching of dataList" [value]="specialTeaching.id">{{ specialTeaching.name }}</mat-option> + </mat-select> + </mat-form-field> + <div> Ceci est un test : {{dataList}} </div> <p class="text-center">Informations parentales</p> diff --git a/src/app/members/account/edit-data/edit-data.component.ts b/src/app/members/account/edit-data/edit-data.component.ts index 05a7a47a838a549673300c0227fd0c77f785edd6..629fea25c71ebfb453f610b34a04d60012080f15 100644 --- a/src/app/members/account/edit-data/edit-data.component.ts +++ b/src/app/members/account/edit-data/edit-data.component.ts @@ -6,7 +6,8 @@ import {ActivatedRoute} from '@angular/router' import { PersonalData,PersonalDataService } from '../core'; import { tap, mergeMap } from 'rxjs/operators'; import { AuthService } from 'app/core'; -import {User} from 'app/core' +import {User} from 'app/core'; + @@ -21,6 +22,8 @@ export class EditDataComponent implements OnInit { loading = false; public error : String = ""; public postEditMessage : String = "" ; + public dataList; + public possibleParentsStatus = [ {id:"maried",name:"Vos parents vivent ensemble"}, {id:"cohabitation",name:"Vos parents vivent séparément"}, @@ -62,8 +65,110 @@ export class EditDataComponent implements OnInit { {id:"no",name:"Non"}, ] + + public possibleSpecialitiesTechno = [ + {id:"Aucun",name:"Aucun"}, + {id:"STI2D",name:"Sciences et technologies de l’industrie et du développement durable"}, + {id:"STD2A",name:"Sciences et technologies du design et des arts appliqués"}, + {id:"STMG",name:"Sciences et technologies du management et de la gestion"}, + {id:"ST2S",name:"Sciences et technologies de la santé et du social"}, + {id:"STL",name:"Sciences et technologies de laboratoire"}, + {id:"S2TMD",name:"Sciences et techniques du théâtre, de la musique et de la danse"}, + {id:"STHR",name:"Sciences et technologies de l'hôtellerie et de la restauration"}, + {id:"STAV",name:"Sciences et technologies de l'agronomie et du vivant"}, + + ] + + public possibleSpecialitiesPro = [ + {id:"Aucun",name:"Aucun"}, + {id:"Accompagnement soins et services à la personne",name:"Accompagnement soins et services à la personne"}, + {id:"Aéronautique",name:"Aéronautique"}, + {id:"Aménagement et finition du bâtiment",name:"Aménagement et finition du bâtiment"}, + {id:"Animation - enfance et personnes âgées",name:"Animation - enfance et personnes âgées"}, + {id:"Artisanat et métiers d'art",name:"Artisanat et métiers d'art"}, + {id:"Assistance à la gestion des organisations et de leurs activités",name:"Assistance à la gestion des organisations et de leurs activités"}, + {id:"Aviation générale",name:"Aviation générale"}, + {id:"Bio-industries de transformation",name:"Bio-industries de transformation"}, + {id:"Boucher charcutier traiteur",name:"Boucher charcutier traiteur"}, + {id:"Boulanger - pâtissier",name:"Boulanger - pâtissier"}, + {id:"Commerce",name:"Commerce"}, + {id:"Commercialisation et services en restauration",name:"Commercialisation et services en restauration"}, + {id:"Conducteur transport routier marchandises",name:"Conducteur transport routier marchandises"}, + {id:"Construction des carrosseries",name:"Construction des carrosseries"}, + {id:"Cuisine",name:"Cuisine"}, + {id:"Esthétique cosmétique parfumerie",name:"Esthétique cosmétique parfumerie"}, + {id:"Étude et définition de produits industriels",name:"Étude et définition de produits industriels"}, + {id:"Etude et réalisation d'agencement",name:"Etude et réalisation d'agencement"}, + {id:"Façonnage de produits imprimés, routage",name:"Façonnage de produits imprimés, routage"}, + {id:"Fonderie",name:"Fonderie"}, + {id:"Gestion administration",name:"Gestion administration"}, + {id:"Gestion des pollutions et protection de l'environnement",name:"Gestion des pollutions et protection de l'environnement"}, + {id:"Hygiène, propreté et stérilisation",name:"Hygiène, propreté et stérilisation"}, + {id:"Installateur en chauffage, climatisation et énergies renouvelables ",name:"Installateur en chauffage, climatisation et énergies renouvelables "}, + {id:"Interventions sur le patrimoine bâti",name:"Interventions sur le patrimoine bâti"}, + {id:"Logistique",name:"Logistique"}, + {id:"Maintenance des équipements industriels",name:"Maintenance des équipements industriels"}, + {id:"Maintenance des matériels",name:"Maintenance des matériels"}, + {id:"Maintenance des systèmes de production connectés",name:"Maintenance des systèmes de production connectés"}, + {id:"Maintenance des véhicules",name:"Maintenance des véhicules"}, + {id:"Maintenance et Efficacité Energétique",name:"Maintenance et Efficacité Energétique"}, + {id:"Maintenance nautique",name:"Maintenance nautique"}, + {id:"Menuiserie Aluminium-Verre",name:"Menuiserie Aluminium-Verre"}, + {id:"Métiers de l'accueil",name:"Métiers de l'accueil"}, + {id:"Métiers de l'électricité et de ses environnements connectés",name:"Métiers de l'électricité et de ses environnements connectés"}, + {id:"Métiers de la coiffure",name:"Métiers de la coiffure"}, + {id:"Métiers de la mode - vêtements",name:"Logistique"}, + {id:"Métiers de la sécurité",name:"Métiers de la sécurité"}, + {id:"Métiers du commerce et de la vente",name:"Métiers du commerce et de la vente"}, + {id:"Métiers du cuir",name:"Métiers du cuir"}, + {id:"Métiers du Froid et des Énergies Renouvelables",name:"Métiers du Froid et des Énergies Renouvelables"}, + {id:"Métiers du pressing et de la blanchisserie",name:"Métiers du pressing et de la blanchisserie"}, + {id:"Métiers et arts de la pierre",name:"Métiers et arts de la pierre"}, + {id:"Microtechniques",name:"Microtechniques"}, + {id:"Modélisation et prototypage 3D",name:"Modélisation et prototypage 3D"}, + {id:"Optique lunetterie",name:"Optique lunetterie"}, + {id:"Organisation de transport de marchandises",name:"Organisation de transport de marchandises"}, + {id:"Ouvrage du bâtiment : métallerie",name:"Ouvrage du bâtiment : métallerie"}, + {id:"Perruquier posticheur",name:"Perruquier posticheur"}, + {id:"Photographie",name:"Photographie"}, + {id:"Pilote de ligne de production",name:"Pilote de ligne de production"}, + {id:"Plastiques et composites",name:"Plastiques et composites"}, + {id:"Poissonnier écailler traiteur",name:"Poissonnier écailler traiteur"}, + {id:"Procédés de la chimie, de l'eau et des papiers-cartons",name:"Procédés de la chimie, de l'eau et des papiers-cartons"}, + {id:"Productique mécanique",name:"Productique mécanique"}, + {id:"Prothèse dentaire",name:"Prothèse dentaire"}, + {id:"Réalisation de produits imprimés et plurimédia",name:"Réalisation de produits imprimés et plurimédia"}, + {id:"Réparation des carrosseries",name:"Réparation des carrosseries"}, + {id:"Services de proximité et vie locale",name:"Services de proximité et vie locale"}, + {id:"Systèmes numériques",name:"Systèmes numériques"}, + {id:"Technicien Gaz",name:"Technicien Gaz"}, + {id:"Technicien constructeur bois",name:"Technicien constructeur bois"}, + {id:"Technicien de maintenance de systèmes énergétiques et climatiques",name:"Technicien de maintenance de systèmes énergétiques et climatiques"}, + {id:"Technicien d'études du bâtiment",name:"Technicien d'études du bâtiment"}, + {id:"Technicien du froid et du conditionnement de l'air",name:"Technicien du froid et du conditionnement de l'air"}, + {id:"Technicien d'usinage",name:"Technicien d'usinage"}, + {id:"Technicien de fabrication bois et matériaux associés",name:"Technicien de fabrication bois et matériaux associés"}, + {id:"Technicien de maintenance de systèmes énergétiques et climatiques",name:"Technicien de maintenance de systèmes énergétiques et climatiques"}, + {id:"Technicien du bâtiment : organisation et réalisation du gros oeuvre",name:"Technicien du bâtiment : organisation et réalisation du gros oeuvre"}, + {id:"Technicien en appareillage orthopédique",name:"Technicien en appareillage orthopédique"}, + {id:"Technicien en chaudronnerie industrielle",name:"Technicien en chaudronnerie industrielle"}, + {id:"Technicien en installation des systèmes énergétiques et climatiques",name:"Technicien en installation des systèmes énergétiques et climatiques"}, + {id:"Technicien en prothèse dentaire",name:"Technicien en prothèse dentaire"}, + {id:"Technicien en réalisation de produits mécaniques",name:"Technicien en réalisation de produits mécaniques"}, + {id:"Technicien géomètre topographe",name:"Technicien géomètre topographe"}, + {id:"Technicien menuisier agenceur",name:"Technicien menuisier agenceur"}, + {id:"Technicien modeleur",name:"Technicien modeleur"}, + {id:"Technicien outilleur",name:"Technicien outilleur"}, + {id:"Techniques d'interventions sur installations nucléaires",name:"Techniques d'interventions sur installations nucléaires"}, + {id:"Traitements des matériaux",name:"Traitements des matériaux"}, + {id:"Transport",name:"Transport"}, + {id:"Transport fluvial",name:"Transport fluvial"}, + {id:"Travaux publics",name:"Travaux publics"}, + {id:"Vente",name:"Vente"}, + ] + constructor( private route: ActivatedRoute, private personalDataService : PersonalDataService, @@ -72,12 +177,13 @@ export class EditDataComponent implements OnInit { private auth: AuthService, private snackBar: MatSnackBar, - ) { } + ) { } ngOnInit() { this.personalData = this.route.snapshot.data['personalData']; - this.createForm() + this.createForm(); + } @@ -111,6 +217,14 @@ export class EditDataComponent implements OnInit { } + attributeSpeciality(){ + + this.dataList=this.possibleSpecialitiesTechno; + // else (id=="Professionnelle") + // this.dataList=this.possibleSpecialitiesPro; + + } + submit(){ this.loading = true; const {firstName,lastName,gender,nationality,classType,addressNumber,street,zipCode,city,personalPhone,parentsPhone,parentsEmail,school,grade,specialTeaching,scholarship,fatherActivity,motherActivity,parentsStatus,dependantsNumber} = this.formGroup.value; diff --git a/src_/app/app-routing.module.ts b/src_/app/app-routing.module.ts deleted file mode 100644 index a9a0140c340e79b1933bd9476dc669568f79a763..0000000000000000000000000000000000000000 --- a/src_/app/app-routing.module.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { LoginComponent } from './login/login.component'; -import { ResetComponent } from './reset/reset.component'; -import { ResetConfirmComponent} from './reset-confirm/reset-confirm.component'; -import { UiGalleryComponent } from './shared'; -import { InternalErrorComponent, NotFoundComponent, AuthGuard, MapsAPIResolver } from './core'; - - -const routes: Routes = [ - { - path: '', - loadChildren: './showcase-site/showcase-site.module#ShowcaseSiteModule', - }, - { - path: 'membres', - canActivate: [AuthGuard], - loadChildren: './members/members.module#MembersModule', - }, - { - path: 'connexion', - component: LoginComponent, - }, - { - path: 'inscription', - loadChildren: './signup/signup.module#SignupModule', - }, - { - path: 'reinitialiser_mdp', - component: ResetComponent, - }, - { - path: 'rest-auth/password/reset/confirm/:uid/:token', - component: ResetConfirmComponent, - }, - { - path: '500', - component: InternalErrorComponent, - data: { title: 'Erreur interne' }, - }, - { - path: '**', - component: NotFoundComponent, - data: { title: 'Page introuvable' }, - }, - -]; - -@NgModule({ - imports: [RouterModule.forRoot(routes)], - exports: [RouterModule] -}) -export class AppRoutingModule { } diff --git a/src_/app/app.component.css b/src_/app/app.component.css deleted file mode 100644 index df02f47cc0afc6e6c58709b3bbebe489e625a7b1..0000000000000000000000000000000000000000 --- a/src_/app/app.component.css +++ /dev/null @@ -1,7 +0,0 @@ -#progress { - position: fixed; - top: 0; - left: 0; - width: 100vw; -} - \ No newline at end of file diff --git a/src_/app/app.component.html b/src_/app/app.component.html deleted file mode 100644 index eb3746107bd5a455352e9a681d346d1efef75728..0000000000000000000000000000000000000000 --- a/src_/app/app.component.html +++ /dev/null @@ -1,2 +0,0 @@ -<mat-progress-bar id="progress" mode="indeterminate" color="primary" *ngIf="loading"></mat-progress-bar> -<router-outlet></router-outlet> diff --git a/src_/app/app.component.ts b/src_/app/app.component.ts deleted file mode 100644 index 4e340b53cdc5bc0196b33a40cb12608cd7886de0..0000000000000000000000000000000000000000 --- a/src_/app/app.component.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { Component, OnInit, OnDestroy } from '@angular/core'; -import { Title } from '@angular/platform-browser'; -import { Router, ActivatedRoute, NavigationEnd } from '@angular/router'; -import { Observable, Subscription } from 'rxjs'; -import { filter, map, mergeMap } from 'rxjs/operators'; -import { LoaderService } from './core'; - -@Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] -}) -export class AppComponent implements OnInit, OnDestroy { - - loading = false; - sub = new Subscription(); - - constructor( - private router: Router, - private activatedRoute: ActivatedRoute, - private titleService: Title, - private loaderService: LoaderService, - ) { } - - ngOnInit() { - this.sub.add( - this.title$().subscribe(title => this.titleService.setTitle(title)) - ); - this.sub.add( - this.loaderService.loading().subscribe(loading => { - this.loading = loading; - }) - ); - } - - private title$(): Observable<string> { - return this.router.events.pipe( - // When a navigation finishes - filter(event => event instanceof NavigationEnd), - // Get the activated route object instead of the actual event - map(() => this.activatedRoute), - // Traverse the child route path to get the last activated route - map(route => { - while (route.firstChild) route = route.firstChild; - return route; - }), - // Retrieve the route's data object - filter(route => route.outlet == 'primary'), - mergeMap(route => route.data), - // Retrieve the route title - map(data => data['title']), - map(title => 'OSER' + (title ? ' | ' + title : '')) - ); - } - - ngOnDestroy() { - this.sub.unsubscribe(); - } -} diff --git a/src_/app/app.module.ts b/src_/app/app.module.ts deleted file mode 100644 index 2210e3c5d6d1421d7764bfea30907dd5b0383454..0000000000000000000000000000000000000000 --- a/src_/app/app.module.ts +++ /dev/null @@ -1,79 +0,0 @@ -import localeFR from '@angular/common/locales/fr'; -import { LOCALE_ID } from '@angular/core'; -import { registerLocaleData } from '@angular/common'; - -// Modules -import { BrowserModule } from '@angular/platform-browser'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { HttpModule } from '@angular/http'; -import { HttpClientModule } from '@angular/common/http'; -import { MatProgressBarModule } from '@angular/material'; -import { MomentModule } from 'ngx-moment'; -import { - MatFormFieldModule, - MatInputModule, - MatOptionModule, - MatSelectModule, - MatButtonModule, - MatRadioModule, - MatDatepickerModule, - MatNativeDateModule, - MatIconModule, - MatSnackBarModule, -} from '@angular/material'; - -// App modules -import { CoreModule } from './core'; -import { SharedModule } from './shared'; -import { AppRoutingModule } from './app-routing.module'; - -// Components -import { AppComponent } from './app.component'; -import { LoginComponent } from './login/login.component'; - -// Services -import { MessageService } from './core'; -import { ResetComponent } from './reset/reset.component'; -import { ResetConfirmComponent } from './reset-confirm/reset-confirm.component'; - -registerLocaleData(localeFR); - -@NgModule({ - declarations: [ - AppComponent, - LoginComponent, - ResetComponent, - ResetConfirmComponent, - ], - imports: [ - BrowserModule, - BrowserAnimationsModule, - FormsModule, - ReactiveFormsModule, - HttpModule, - MomentModule, - MatProgressBarModule, - CoreModule, - SharedModule, - HttpClientModule, - AppRoutingModule, - MatFormFieldModule, - MatInputModule, - MatOptionModule, - MatSelectModule, - MatRadioModule, - MatButtonModule, - MatNativeDateModule, - MatDatepickerModule, - MatIconModule, - MatSnackBarModule, - ], - providers: [ - MessageService, - { provide: LOCALE_ID, useValue: 'fr' }, - ], - bootstrap: [AppComponent] -}) -export class AppModule { } diff --git a/src_/app/core/address.model.ts b/src_/app/core/address.model.ts deleted file mode 100644 index 349d0b7835e42a3f9cd62207122d3eb53d2663a3..0000000000000000000000000000000000000000 --- a/src_/app/core/address.model.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { Injectable } from '@angular/core'; -import { IAdapter } from './interfaces'; - -export interface Country { - name: string; - code: string; -} - - -export class AddressSchema { - line1: string; - line2: string; - postCode: string; - city: string; - country: Country; -} - - -export class Address extends AddressSchema { - - constructor(args: AddressSchema) { - super(); - Object.assign(this, args); - } - - toString(): string { - return [this.line1, this.line2, this.postCode, this.city, this.country.name] - .filter(el => el) - .join(', '); - } -} - -@Injectable({ - providedIn: 'root' -}) -export class AddressAdapter implements IAdapter<Address> { - adapt(data: any): Address { - return new Address({ - line1: data.line1, - line2: data.line2, - postCode: data.post_code, - city: data.city, - country: { - name: data.country.name, - code: data.country.code, - }, - }); - } - - encode(obj: Address): any { - return { - line1: obj.line1, - line2: obj.line2, - post_code: obj.postCode, - city: obj.city, - country: obj.country, - } - } -} diff --git a/src_/app/core/api.ts b/src_/app/core/api.ts deleted file mode 100644 index 792acf9b518cc71868afd67c5940b98b1202b8b0..0000000000000000000000000000000000000000 --- a/src_/app/core/api.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { IAdapter } from './interfaces'; -import { HttpClient } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { map } from 'rxjs/operators'; -import { environment } from 'environments/environment'; - -export class ShowcaseApiService { - apiUrl = environment.showcaseApiUrl; -} - -export class ApiService { - apiUrl = environment.apiUrl; -} - -export abstract class ModelApiService<T> extends ApiService { - - abstract baseUrl: string; - public http: HttpClient; - - list(): Observable<T[]> { - const adapter = this.getAdapter('list'); - return this.http.get(this.baseUrl).pipe( - map((data: any[]) => data.map(item => adapter.adapt(item))), - ) - } - - retrieve(id: any): Observable<T> { - const adapter = this.getAdapter('retrieve'); - const url = this.baseUrl + `${id}/`; - return this.http.get(url).pipe( - map((data: any) => adapter.adapt(data)), - ) - } - - abstract getAdapter(action: string): IAdapter<T>; -} diff --git a/src_/app/core/auth/adapters.ts b/src_/app/core/auth/adapters.ts deleted file mode 100644 index ad1b60aa66e0556bb79fc9458e4a8e9e9de139b7..0000000000000000000000000000000000000000 --- a/src_/app/core/auth/adapters.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { User } from './models'; - -export class UserAdapter { - - adapt(item: any): User { - return new User({ - id: item.id, - firstName: item.first_name, - lastName: item.last_name, - email: item.email, - phoneNumber: item.phone_number, - }) - } -} diff --git a/src_/app/core/auth/auth-guard.service.ts b/src_/app/core/auth/auth-guard.service.ts deleted file mode 100644 index 7a185fb45c29326fc5202bd8de2dee151b768932..0000000000000000000000000000000000000000 --- a/src_/app/core/auth/auth-guard.service.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Injectable } from '@angular/core'; -import { CanActivate } from '@angular/router'; -import { AuthService } from './auth.service'; -import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; - -@Injectable({ - providedIn: 'root', -}) -export class AuthGuard implements CanActivate { - - constructor(private auth: AuthService) { } - - canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { - if (this.auth.isLoggedIn) { - return true; - } - this.auth.redirectUrl = state.url; - this.auth.fromGuard = true; - this.auth.redirectLogin(); - return false; - } - -} diff --git a/src_/app/core/auth/auth.service.ts b/src_/app/core/auth/auth.service.ts deleted file mode 100644 index e7c506f92a021ccc02772f55aaef1367b4bca067..0000000000000000000000000000000000000000 --- a/src_/app/core/auth/auth.service.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient, HttpHeaders } from '@angular/common/http'; -import { Router } from '@angular/router'; -import { Observable, BehaviorSubject } from 'rxjs'; -import { tap, map } from 'rxjs/operators'; -import { environment } from 'environments/environment'; -import { User } from './models'; -import { ObjectStoredItem, SimpleStoredItem } from '../storage'; -import { UserAdapter } from './adapters'; - - -class StoredUser extends ObjectStoredItem<User> { key = 'oser-cs-user-info'; } -class StoredToken extends SimpleStoredItem { key = 'oser-cs-user-token'; } - - -@Injectable({ - providedIn: 'root', -}) -export class AuthService { - - private loginUrl = environment.apiUrl + 'auth/get-token/'; - private resetUrl = environment.apiUrl + 'rest-auth/password/reset/'; - private resetConfirmUrl = environment.apiUrl + 'rest-auth/password/reset/confirm/'; - - fromGuard: boolean; - redirectUrl: string; - fromUnauthorized: boolean; - - private userAdapter = new UserAdapter(); - private user = new StoredUser(); - private token = new StoredToken(); - private user$: BehaviorSubject<User>; - - constructor(private http: HttpClient, private router: Router) { - const userData = this.getUserSnapshot(); - const initialUser = userData ? new User(userData) : null; - this.user$ = new BehaviorSubject(initialUser); - } - - login(username: string, password: string): Observable<boolean> { - return this.http.post<any>(this.loginUrl, { username: username, password: password }).pipe( - tap(data => this.token.set(data.token)), - map(data => this.userAdapter.adapt(data.user)), - tap((user: User) => this.user.set(user)), - tap((user: User) => this.user$.next(user)), - map(() => true), - ); - } - - reset(email: string): Observable<boolean> { - console.log("reset function of auth service"); - return this.http.post<any>(this.resetUrl, { email }).pipe( - map(() => true), - ); - } - - resetConfirm(uid: string, token: string, new_password1: string, new_password2: string): Observable<boolean> { - console.log("reset confirm function"); - return this.http.post<any>(this.resetConfirmUrl, { uid, token, new_password1, new_password2 }).pipe( - map(() => true), - ); - } - - redirectLogin() { - this.router.navigate(['/connexion']); - } - - getUserSnapshot(): User { - return this.user.get(); - } - - getUser(): Observable<User> { - return this.user$.asObservable(); - } - - getToken(): string { - return this.token.get(); - } - - // Headers for use in authenticated calls to the backend API. - getAuthorizationHeaders(): HttpHeaders { - return new HttpHeaders({ Authorization: 'Token ' + this.getToken() }); - } - - get isLoggedIn(): boolean { - if (this.user.get()) { - return true; - } - return false; - } - - logout() { - this.user.destroy(); - this.token.destroy(); - this.user$.next(null); - } -} diff --git a/src_/app/core/auth/index.ts b/src_/app/core/auth/index.ts deleted file mode 100644 index 2725d333b3b3885192bd8a7db3aa451b5195249b..0000000000000000000000000000000000000000 --- a/src_/app/core/auth/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './auth.service'; -export * from './auth-guard.service'; -export * from './models'; -export * from './adapters'; -export * from './token.interceptor'; diff --git a/src_/app/core/auth/models.ts b/src_/app/core/auth/models.ts deleted file mode 100644 index ff1aea0abdb676e24c9be3f60867ebce6d45fab5..0000000000000000000000000000000000000000 --- a/src_/app/core/auth/models.ts +++ /dev/null @@ -1,27 +0,0 @@ -export interface UserInfo { - id: number; - email?: string; - firstName?: string; - lastName?: string; - phoneNumber?: string; -} - -export class User { - id: number; - email: string; - firstName: string; - lastName: string; - phoneNumber: string; - - constructor(opts: UserInfo) { - this.id = opts.id; - this.email = opts.email; - this.firstName = opts.firstName; - this.lastName = opts.lastName; - this.phoneNumber = opts.phoneNumber; - } - - get fullName(): string { - return [this.firstName, this.lastName].filter(x => !!x).join(' '); - } -} diff --git a/src_/app/core/auth/token.interceptor.ts b/src_/app/core/auth/token.interceptor.ts deleted file mode 100644 index 51fe394a94cea859b7e02bce90277b9980f34239..0000000000000000000000000000000000000000 --- a/src_/app/core/auth/token.interceptor.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpEvent, HttpInterceptor, HttpHandler, HttpRequest, HttpErrorResponse } from '@angular/common/http'; -import { Location } from '@angular/common'; -import { Observable } from 'rxjs'; -import { tap } from 'rxjs/operators'; -import { AuthService } from './auth.service'; -import { ErrorService } from '../error.service'; - - -@Injectable({ - providedIn: 'root', -}) -export class TokenInterceptor implements HttpInterceptor { - - constructor( - private auth: AuthService, - private location: Location, - private errorService: ErrorService) { } - - intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { - request = this.attachToken(request); - return next.handle(request).pipe( - tap( - (event: HttpEvent<any>) => { }, - (error: any) => this.onError(error), - ), - ); - } - - onError(error: any) { - console.error(error); - - if (error instanceof HttpErrorResponse) { - if (error.status === 401) { - this.auth.redirectUrl = this.location.path(); - this.auth.fromUnauthorized = true; - this.auth.logout(); // forget credentials as they may be corrupt - this.auth.redirectLogin(); - } - } - } - - attachToken(request: HttpRequest<any>): HttpRequest<any> { - const token = this.auth.getToken(); - if (token) { - request = request.clone({ headers: this.auth.getAuthorizationHeaders() }); - } - return request - } - -} diff --git a/src_/app/core/core.module.ts b/src_/app/core/core.module.ts deleted file mode 100644 index 1788ec7f8895f2ed40eb3df2805daa2da635988d..0000000000000000000000000000000000000000 --- a/src_/app/core/core.module.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { RouterModule } from '@angular/router'; -import { AgmCoreModule } from '@agm/core'; -import { HTTP_INTERCEPTORS } from '@angular/common/http'; -import { MarkdownModule, MarkdownComponent, MarkdownPipe } from 'ngx-markdown'; -import { TokenInterceptor } from './auth'; -import { LoaderService } from './loader.service'; -import { MessageModule } from './messages'; -import { FuzzyPipe, LineBreaksPipe } from './pipes'; -import { NotFoundComponent } from './not-found'; -import { InternalErrorComponent } from './internal-error'; -import { ErrorPageComponent } from './error-page'; - -@NgModule({ - imports: [ - CommonModule, - RouterModule, - MessageModule, - MarkdownModule.forRoot(), - AgmCoreModule.forRoot({ - apiKey: 'AIzaSyDXPxwZpx9EiwarLAZ3yzUANK9D4q0X9cI', - }), - ], - declarations: [ - FuzzyPipe, - LineBreaksPipe, - InternalErrorComponent, - NotFoundComponent, - ErrorPageComponent, - ], - providers: [ - LoaderService, - { provide: HTTP_INTERCEPTORS, useClass: TokenInterceptor, multi: true }, - ], - exports: [ - MessageModule, - FuzzyPipe, - LineBreaksPipe, - MarkdownComponent, - MarkdownPipe, - ] -}) -export class CoreModule { } diff --git a/src_/app/core/document.service.ts b/src_/app/core/document.service.ts deleted file mode 100644 index 463c31e3684712b6480e7756a1698f2e64fc869b..0000000000000000000000000000000000000000 --- a/src_/app/core/document.service.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { Observable, of } from 'rxjs'; -import { map, catchError } from 'rxjs/operators'; -import { environment } from 'environments/environment'; -import { ActivatedRouteSnapshot, RouterStateSnapshot, Resolve } from '@angular/router'; - -interface Options { - titleLevel: number; -} - -@Injectable({ - providedIn: 'root', -}) -export class DocumentService { - - private baseUrl = environment.showcaseApiUrl + 'documents/'; - - constructor(private http: HttpClient) { } - - adapt(data: any, options: Options): string { - const title = data.title; - const content = data.content; - const titleMark = '#'.repeat(options.titleLevel || 1); - return `${titleMark} ${title}\n\n${content}`; - } - - get(slug: string, options?: Options): Observable<string> { - let url = this.baseUrl + `${slug}/`; - return this.http.get<string>(url).pipe( - map((data: any) => this.adapt(data, options)), - ); - } -} - - -@Injectable() -export abstract class DocumentResolver implements Resolve<string> { - - abstract slug: string; - opts: any = {}; - - constructor(private service: DocumentService) { } - - resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<string> { - return this.service.get(this.slug, this.opts).pipe( - catchError(e => of(null)) - ); - } -} diff --git a/src_/app/core/error-page/error-page.component.html b/src_/app/core/error-page/error-page.component.html deleted file mode 100644 index 4f70d92463dcd93c0aaa01c2bc2cd61c63edd04a..0000000000000000000000000000000000000000 --- a/src_/app/core/error-page/error-page.component.html +++ /dev/null @@ -1,15 +0,0 @@ -<div class="layout"> - <div class="container drop-shadow-sm"> - <div id="logo"> - <img src="assets/img/oser-logo-white.png" alt="Logo OSER"> - </div> - <h1 class="code">{{ code }}</h1> - <div class="content"> - <h2>{{ title }}</h2> - <p>{{ message }}</p> - </div> - - <a [routerLink]="['/']" class="btn-light">Retourner à l'accueil</a> - </div> - <span class="background"></span> -</div> diff --git a/src_/app/core/error-page/error-page.component.scss b/src_/app/core/error-page/error-page.component.scss deleted file mode 100644 index a4e6e659890dfef3ca61fdce78aff48a71da9572..0000000000000000000000000000000000000000 --- a/src_/app/core/error-page/error-page.component.scss +++ /dev/null @@ -1,66 +0,0 @@ -@import '~sass/mixins'; - -.background { - /* fixed with respect to screen */ - position: relative; - overflow: hidden; - top: 0; - left: 0; - width: 100%; - height: 100%; - /* push image behind everything */ - z-index: -3; - background: url("/assets/img/groupe-oser-bw.jpg") no-repeat center; - background-size: cover; - - &::after { - content: ''; - position: absolute; - width: 100%; - height: 100%; - background: transparentize($color-dark-blue, .4); - } -} - -.container { - @include margin-page; - display: flex; - flex-flow: column nowrap; - justify-content: center; - align-items: center; - min-height: stretch; - text-align: center; - @include media-xs { - text-align: left; - align-items: flex-start; - } - z-index: 1; - color: white; - background: linear-gradient( - to top right, - adjust-hue(darken($color-dark-blue, 7%), -5), - $color-dark-blue, - ); -} - -h1.code { - font-size: 48pt; - margin-bottom: 0; -} - -.layout { - display: grid; - grid-template-columns: auto 1fr; -} - -.content { - margin: 0 0 2em 0; -} - -#logo { - max-width: 18em; - img { - max-width: 100%; - height: auto; - } -} diff --git a/src_/app/core/error-page/error-page.component.ts b/src_/app/core/error-page/error-page.component.ts deleted file mode 100644 index b1c587a0097108e8d998186e3a3343546b2d5831..0000000000000000000000000000000000000000 --- a/src_/app/core/error-page/error-page.component.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Component, Input } from '@angular/core'; - -@Component({ - selector: 'app-error-page', - templateUrl: './error-page.component.html', - styleUrls: ['./error-page.component.scss'] -}) -export class ErrorPageComponent { - - @Input() code: number; - @Input() title = 'Oups !'; - @Input() message: string; - -} diff --git a/src_/app/core/error-page/index.ts b/src_/app/core/error-page/index.ts deleted file mode 100644 index 5b6d95701d03f9e7cf629d7f4c892f118656cf03..0000000000000000000000000000000000000000 --- a/src_/app/core/error-page/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './error-page.component'; diff --git a/src_/app/core/error.service.ts b/src_/app/core/error.service.ts deleted file mode 100644 index 19e36fcb95db5e855578f7e97e045c18ee7a462d..0000000000000000000000000000000000000000 --- a/src_/app/core/error.service.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Router } from '@angular/router'; - -@Injectable({ - providedIn: 'root', -}) -export class ErrorService { - - constructor(private router: Router) { } - - panic() { - this.router.navigate(['/500']); - } - - notFound() { - this.router.navigate(['/404']); - } - -} diff --git a/src_/app/core/geocoding.service.ts b/src_/app/core/geocoding.service.ts deleted file mode 100644 index ed6bcb866ed2a51e1b961f4090f55f06000b4b93..0000000000000000000000000000000000000000 --- a/src_/app/core/geocoding.service.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { Injectable } from '@angular/core'; -import { MapsAPILoader } from '@agm/core'; -import { Resolve } from '@angular/router'; -import { Observable, from } from 'rxjs'; -import { map } from 'rxjs/operators'; - -declare const google: any; - -export interface Location { - lat: number; - lng: number; -} - -export interface Geocoder { - geocode: ( - opts: {address: string}, - fn: (results: any, status: string) => void, - ) => void; -} - -@Injectable({ - providedIn: 'root', -}) -export class GeocodingService { - - locate(geocoder: Geocoder, address: string): Observable<Location> { - return new Observable(obs => { - geocoder.geocode({address: address}, (results, status) => { - if (status === 'OK') { - const loc = results[0].geometry.location; - obs.next({lat: loc.lat(), lng: loc.lng()}); - } else { - obs.error('Google was not successful: ' + status); - } - }); - }); - } -} - -@Injectable({ - providedIn: 'root', -}) -export class MapsAPIResolver implements Resolve<Geocoder> { - - constructor(private loader: MapsAPILoader) { } - - resolve(): Observable<Geocoder> { - return from(this.loader.load()).pipe( - map(() => new google.maps.Geocoder()) - ); - } -} diff --git a/src_/app/core/index.ts b/src_/app/core/index.ts deleted file mode 100644 index 57973adb3ad75159385317ff42da12451243e588..0000000000000000000000000000000000000000 --- a/src_/app/core/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -export { CoreModule } from './core.module'; -export * from './messages'; -export * from './auth'; -export * from './pipes'; -export * from './not-found'; -export * from './document.service'; -export * from './storage'; -export * from './geocoding.service'; -export * from './resolvers'; -export * from './internal-error'; -export * from './error.service'; -export * from './interfaces'; -export * from './api'; -export * from './address.model'; -export * from './loader.service'; diff --git a/src_/app/core/interfaces.ts b/src_/app/core/interfaces.ts deleted file mode 100644 index f79d0acd0dd4a9c647142a274d42de75e323a8b4..0000000000000000000000000000000000000000 --- a/src_/app/core/interfaces.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IAdapter<T> { - adapt(data: any): T; -} diff --git a/src_/app/core/internal-error/index.ts b/src_/app/core/internal-error/index.ts deleted file mode 100644 index c72a015fb2748daf25c2fac33fdf6b8ecb98d76b..0000000000000000000000000000000000000000 --- a/src_/app/core/internal-error/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './internal-error.component'; diff --git a/src_/app/core/internal-error/internal-error.component.html b/src_/app/core/internal-error/internal-error.component.html deleted file mode 100644 index fa8649f71e057f8b3d1b31c409c7058c6c589f8b..0000000000000000000000000000000000000000 --- a/src_/app/core/internal-error/internal-error.component.html +++ /dev/null @@ -1 +0,0 @@ -<app-error-page code="500" message="Quelque chose a dérapé. Nous travaillons activement à résoudre ce problème. Réessayez plus tard !"></app-error-page> diff --git a/src_/app/core/internal-error/internal-error.component.scss b/src_/app/core/internal-error/internal-error.component.scss deleted file mode 100644 index a4e6e659890dfef3ca61fdce78aff48a71da9572..0000000000000000000000000000000000000000 --- a/src_/app/core/internal-error/internal-error.component.scss +++ /dev/null @@ -1,66 +0,0 @@ -@import '~sass/mixins'; - -.background { - /* fixed with respect to screen */ - position: relative; - overflow: hidden; - top: 0; - left: 0; - width: 100%; - height: 100%; - /* push image behind everything */ - z-index: -3; - background: url("/assets/img/groupe-oser-bw.jpg") no-repeat center; - background-size: cover; - - &::after { - content: ''; - position: absolute; - width: 100%; - height: 100%; - background: transparentize($color-dark-blue, .4); - } -} - -.container { - @include margin-page; - display: flex; - flex-flow: column nowrap; - justify-content: center; - align-items: center; - min-height: stretch; - text-align: center; - @include media-xs { - text-align: left; - align-items: flex-start; - } - z-index: 1; - color: white; - background: linear-gradient( - to top right, - adjust-hue(darken($color-dark-blue, 7%), -5), - $color-dark-blue, - ); -} - -h1.code { - font-size: 48pt; - margin-bottom: 0; -} - -.layout { - display: grid; - grid-template-columns: auto 1fr; -} - -.content { - margin: 0 0 2em 0; -} - -#logo { - max-width: 18em; - img { - max-width: 100%; - height: auto; - } -} diff --git a/src_/app/core/internal-error/internal-error.component.ts b/src_/app/core/internal-error/internal-error.component.ts deleted file mode 100644 index 0707191b7788b4043e89c824154e492fcb3db07c..0000000000000000000000000000000000000000 --- a/src_/app/core/internal-error/internal-error.component.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-internal-error', - templateUrl: './internal-error.component.html', - styleUrls: ['./internal-error.component.scss'] -}) -export class InternalErrorComponent { } diff --git a/src_/app/core/loader.service.ts b/src_/app/core/loader.service.ts deleted file mode 100644 index 9b349b5ad5cd1bb478e965f9530d88c54e469e54..0000000000000000000000000000000000000000 --- a/src_/app/core/loader.service.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Router, NavigationStart, NavigationEnd, NavigationCancel } from '@angular/router'; -import { Observable, BehaviorSubject } from 'rxjs'; -import { map, debounceTime, tap, filter } from 'rxjs/operators'; - - -@Injectable() -export class LoaderService { - - constructor(private router: Router) {} - - public loading(): Observable<boolean> { - return this.router.events.pipe( - filter(e => e instanceof NavigationStart || e instanceof NavigationEnd || e instanceof NavigationCancel), - debounceTime(100), // don't mark fast navigation changes as navigating - map((e) => e instanceof NavigationStart), - ); - } - -} diff --git a/src_/app/core/messages/index.ts b/src_/app/core/messages/index.ts deleted file mode 100644 index 9309f641c669e65a29017db55e79acf5fbabb9da..0000000000000000000000000000000000000000 --- a/src_/app/core/messages/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { MessageComponent } from './message.component'; -export { MessageService } from './message.service'; -export { MessageModule } from './message.module'; diff --git a/src_/app/core/messages/message.component.html b/src_/app/core/messages/message.component.html deleted file mode 100644 index 1c264bf7b1c542923e2af20d0be9386f0e886d30..0000000000000000000000000000000000000000 --- a/src_/app/core/messages/message.component.html +++ /dev/null @@ -1,3 +0,0 @@ -<div *ngFor="let message of messages"> - <div [ngClass]="{ 'alert': message, 'alert-success': message.type === 'success', 'alert-danger': message.type === 'error' }">{{message.text}}</div> -</div> diff --git a/src_/app/core/messages/message.component.scss b/src_/app/core/messages/message.component.scss deleted file mode 100644 index cda002625fe5d146d795ff49f6146d60b57e55b7..0000000000000000000000000000000000000000 --- a/src_/app/core/messages/message.component.scss +++ /dev/null @@ -1 +0,0 @@ -@import '~sass/mixins'; diff --git a/src_/app/core/messages/message.component.ts b/src_/app/core/messages/message.component.ts deleted file mode 100644 index acb07158236c14e8e11433c84c4fa3cb00d61bd6..0000000000000000000000000000000000000000 --- a/src_/app/core/messages/message.component.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { MessageService } from './message.service'; -import { Message } from './message.model'; - -@Component({ - selector: 'messages', - templateUrl: './message.component.html', - styleUrls: ['./message.component.scss'] -}) -export class MessageComponent implements OnInit { - messages: Message[]; - - constructor(private messageService: MessageService) { - this.messages = []; - } - - ngOnInit() { - this.messageService.stream().subscribe( - message => { - if (message === null) { - this.messages = []; - } else { - this.messages.push(message); - } - } - ); - } - -} diff --git a/src_/app/core/messages/message.model.ts b/src_/app/core/messages/message.model.ts deleted file mode 100644 index 1b00e0caa5e17d36630d37c6c739ab643a7d9997..0000000000000000000000000000000000000000 --- a/src_/app/core/messages/message.model.ts +++ /dev/null @@ -1,9 +0,0 @@ -export enum MessageType { - SUCCESS = 'success', - ERROR = 'error', -} - -export interface Message { - text: string; - type: MessageType; -} diff --git a/src_/app/core/messages/message.module.ts b/src_/app/core/messages/message.module.ts deleted file mode 100644 index 844e58068ec95ca2bb3e4e116a9de489e92a0322..0000000000000000000000000000000000000000 --- a/src_/app/core/messages/message.module.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { MessageComponent } from './message.component'; -import { MessageService } from './message.service'; - -@NgModule({ - imports: [ - CommonModule - ], - declarations: [ - MessageComponent, - ], - exports: [MessageComponent], -}) -export class MessageModule { } diff --git a/src_/app/core/messages/message.service.ts b/src_/app/core/messages/message.service.ts deleted file mode 100644 index c77a36b731ff551abb0698d015fe353578507f06..0000000000000000000000000000000000000000 --- a/src_/app/core/messages/message.service.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Router, NavigationStart } from '@angular/router'; -import { Observable, BehaviorSubject } from 'rxjs'; -import { MessageType, Message } from './message.model'; - -@Injectable({ - providedIn: 'root', -}) -export class MessageService { - - private messageStream$ = new BehaviorSubject<Message>(null); - private keepAfterNavigationChange = false; - - constructor(private router: Router) { - // clear messages on route change - router.events.subscribe(event => { - if (event instanceof NavigationStart) { - if (this.keepAfterNavigationChange) { - // only keep for a single location change - this.keepAfterNavigationChange = false; - } else { - this.clear(); - } - } - }); - } - - private addMessage(message: Message) { - this.messageStream$.next(message); - } - - success(message: string, keepAfterNavigationChange = false) { - this.keepAfterNavigationChange = keepAfterNavigationChange; - this.addMessage({ type: MessageType.SUCCESS, text: message }); - } - - error(message: string, keepAfterNavigationChange = false) { - this.keepAfterNavigationChange = keepAfterNavigationChange; - this.addMessage({ type: MessageType.ERROR, text: message }); - } - - stream(): Observable<Message> { - return this.messageStream$.asObservable(); - } - - clear() { - this.messageStream$.next(null); - } - -} diff --git a/src_/app/core/not-found/index.ts b/src_/app/core/not-found/index.ts deleted file mode 100644 index d91ce3f7d4abf6267e4e9c302b2632211e25ceb7..0000000000000000000000000000000000000000 --- a/src_/app/core/not-found/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './not-found.component'; diff --git a/src_/app/core/not-found/not-found.component.html b/src_/app/core/not-found/not-found.component.html deleted file mode 100644 index bb0fcee2f12672b8f23a233f1474b408de2bbe74..0000000000000000000000000000000000000000 --- a/src_/app/core/not-found/not-found.component.html +++ /dev/null @@ -1 +0,0 @@ -<app-error-page [code]="404" message="La page que vous recherchez semble introuvable."></app-error-page> diff --git a/src_/app/core/not-found/not-found.component.scss b/src_/app/core/not-found/not-found.component.scss deleted file mode 100644 index a4e6e659890dfef3ca61fdce78aff48a71da9572..0000000000000000000000000000000000000000 --- a/src_/app/core/not-found/not-found.component.scss +++ /dev/null @@ -1,66 +0,0 @@ -@import '~sass/mixins'; - -.background { - /* fixed with respect to screen */ - position: relative; - overflow: hidden; - top: 0; - left: 0; - width: 100%; - height: 100%; - /* push image behind everything */ - z-index: -3; - background: url("/assets/img/groupe-oser-bw.jpg") no-repeat center; - background-size: cover; - - &::after { - content: ''; - position: absolute; - width: 100%; - height: 100%; - background: transparentize($color-dark-blue, .4); - } -} - -.container { - @include margin-page; - display: flex; - flex-flow: column nowrap; - justify-content: center; - align-items: center; - min-height: stretch; - text-align: center; - @include media-xs { - text-align: left; - align-items: flex-start; - } - z-index: 1; - color: white; - background: linear-gradient( - to top right, - adjust-hue(darken($color-dark-blue, 7%), -5), - $color-dark-blue, - ); -} - -h1.code { - font-size: 48pt; - margin-bottom: 0; -} - -.layout { - display: grid; - grid-template-columns: auto 1fr; -} - -.content { - margin: 0 0 2em 0; -} - -#logo { - max-width: 18em; - img { - max-width: 100%; - height: auto; - } -} diff --git a/src_/app/core/not-found/not-found.component.ts b/src_/app/core/not-found/not-found.component.ts deleted file mode 100644 index 897f9b4f91148aa4e91626da5882eb753a303805..0000000000000000000000000000000000000000 --- a/src_/app/core/not-found/not-found.component.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-not-found', - templateUrl: './not-found.component.html', - styleUrls: ['./not-found.component.scss'] -}) -export class NotFoundComponent { } diff --git a/src_/app/core/pipes/fuzzy.pipe.ts b/src_/app/core/pipes/fuzzy.pipe.ts deleted file mode 100644 index 4c368342701cd0eef710f6af466e2d1283c491df..0000000000000000000000000000000000000000 --- a/src_/app/core/pipes/fuzzy.pipe.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Pipe, PipeTransform } from '@angular/core'; -import * as Fuse from 'fuse.js'; - -@Pipe({ - name: 'fuzzy' -}) -export class FuzzyPipe implements PipeTransform { - transform(items: any[], searchText: string, keys: any[]): any[] { - if (!items) return []; - if (!searchText) return items; - let options = { - shouldSort: true, - threshold: 0.4, - location: 0, - distance: 100, - maxPatternLength: 32, - minMatchCharLength: 1, - keys: keys, - }; - let fuse = new Fuse(items, options); - return fuse.search(searchText); - } -} diff --git a/src_/app/core/pipes/index.ts b/src_/app/core/pipes/index.ts deleted file mode 100644 index ee4881fb677034346f6e3bf462cf08ad66419f51..0000000000000000000000000000000000000000 --- a/src_/app/core/pipes/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './fuzzy.pipe'; -export * from './linebreaks.pipe'; diff --git a/src_/app/core/pipes/linebreaks.pipe.ts b/src_/app/core/pipes/linebreaks.pipe.ts deleted file mode 100644 index caa57f70181362128bf2dbbb2bc7051786409f5d..0000000000000000000000000000000000000000 --- a/src_/app/core/pipes/linebreaks.pipe.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Pipe, PipeTransform } from '@angular/core'; -import * as Fuse from 'fuse.js'; - -@Pipe({ - name: 'linebreaks' -}) -export class LineBreaksPipe implements PipeTransform { - transform(text: string, repl: string='<br />'): string { - if (!text) return ''; - const replaced = text.replace(/\n/g, repl); - return replaced; - } -} diff --git a/src_/app/core/resolvers/generic.ts b/src_/app/core/resolvers/generic.ts deleted file mode 100644 index a506e79c4aaf9b9b2b31fdb4a52c9a67aabe381e..0000000000000000000000000000000000000000 --- a/src_/app/core/resolvers/generic.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Resolve, ActivatedRouteSnapshot } from '@angular/router'; -import { Observable, of } from 'rxjs'; -import { catchError } from 'rxjs/operators'; - -interface Listable<T> { - list: () => Observable<T[]>; -} - -interface Retrievable<T> { - retrieve: (id: any) => Observable<T>; -} - -export abstract class ObjectListResolver<T> implements Resolve<T[]> { - - public service: Listable<T>; - - resolve(): Observable<T[]> { - return this.service.list().pipe( - catchError(e => of(null)) - ); - } -} - -export abstract class ObjectResolver<T> implements Resolve<T> { - - public service: Retrievable<T>; - abstract routeLookupKey: string; - - resolve(route: ActivatedRouteSnapshot): Observable<T> { - const id: any = route.paramMap.get(this.routeLookupKey); - return this.service.retrieve(id).pipe( - catchError(e => of(null)) - ); - } -} diff --git a/src_/app/core/resolvers/index.ts b/src_/app/core/resolvers/index.ts deleted file mode 100644 index 0c814657c819d56d397ead69b43e6966c85f1675..0000000000000000000000000000000000000000 --- a/src_/app/core/resolvers/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './generic'; -export * from './simple.resolver'; diff --git a/src_/app/core/resolvers/simple.resolver.ts b/src_/app/core/resolvers/simple.resolver.ts deleted file mode 100644 index 30dc9ca6a3ce632c7d52ad75e52ff9b7636e05e3..0000000000000000000000000000000000000000 --- a/src_/app/core/resolvers/simple.resolver.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Observable, of } from 'rxjs'; -import { map, tap, catchError } from 'rxjs/operators'; -import { HttpClient } from '@angular/common/http'; -import { Resolve } from '@angular/router'; - -@Injectable() -export abstract class SimpleListResolver<T> implements Resolve<T[]> { - - abstract name: string; - abstract url: string; - - constructor(private http: HttpClient) { } - - abstract adapt(item: any): T; - - resolve(): Observable<T[]> { - return this.http.get<T[]>(this.url).pipe( - map((items: any[]) => items.map(this.adapt)), - catchError(e => of(null)), - ); - } -} diff --git a/src_/app/core/storage.ts b/src_/app/core/storage.ts deleted file mode 100644 index 3c67ff7d905816471ddd4b13137a3ba137e61173..0000000000000000000000000000000000000000 --- a/src_/app/core/storage.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Local storage utilities - -interface IStoredItem<T> { - get: () => T; - set: (value: T) => void; - destroy: () => void; -} - -abstract class StoredItem<T> { - key: string; - - destroy() { - localStorage.removeItem(this.key); - } -} - -export abstract class SimpleStoredItem extends StoredItem<string> implements IStoredItem<string> { - - get(): string { - return localStorage.getItem(this.key); - } - - set(value: string) { - localStorage.setItem(this.key, value); - } -} - -export abstract class ObjectStoredItem<T> extends StoredItem<T> implements IStoredItem<T> { - - get(): T { - return JSON.parse(localStorage.getItem(this.key)) as T; - } - - set(value: T) { - localStorage.setItem(this.key, JSON.stringify(value)); - } -} diff --git a/src_/app/dynamic-forms/core/form.model.ts b/src_/app/dynamic-forms/core/form.model.ts deleted file mode 100644 index 033bfeae7cd4ee9ffe03857bde1ad65e3473ef2d..0000000000000000000000000000000000000000 --- a/src_/app/dynamic-forms/core/form.model.ts +++ /dev/null @@ -1,156 +0,0 @@ -import { IAdapter } from 'app/core'; - -import slugify from 'slugify'; - - -export class QuestionSchema { - id: number; - type: string; - text: string; - helpText: string; - required: boolean; - sectionId: number; - answer: string; -} - - -export class Question extends QuestionSchema { - - constructor(args: QuestionSchema) { - super(); - Object.assign(this, args); - } - - get key(): string { - return slugify(this.text, ''); - } -} - - -export class QuestionAdapter implements IAdapter<Question> { - - adapt(data: any): Question { - return new Question({ - id: data.id, - type: data.type, - text: data.text, - helpText: data.help_text, - required: data.required, - sectionId: data.section, - answer: null, - }) - } -} - - -export class SectionSchema { - id: number; - title: string; - questions: Question[]; - formId: number; -} - - -export class Section extends SectionSchema { - - constructor(args: SectionSchema) { - super(); - Object.assign(this, args); - } -} - - -export class SectionAdapter implements IAdapter<Section> { - - private questionAdapter = new QuestionAdapter(); - - adapt(data: any): Section { - return new Section({ - id: data.id, - title: data.title, - questions: data.questions.map(item => this.questionAdapter.adapt(item)), - formId: data.form, - }) - } -} - - -export class FileSchema { - id: number; - name: string; - url: string; -} - -export class File extends FileSchema { - - constructor(args: FileSchema) { - super(); - Object.assign(this, args); - } -} - -export class FileAdapter implements IAdapter<File> { - - adapt(data: any): File { - return new File({ - id: data.id, - name: data.name, - url: data.file, - }); - } -} - - -interface Answer { - question: number; - answer: string; -} - -export interface FormEntryPayload { - form: number; - answers: Answer[]; -} - - -export class FormSchema { - id: number; - title: string; - sections: Section[]; - files: File[]; -} - -export class Form extends FormSchema { - - constructor(args: FormSchema) { - super(); - Object.assign(this, args); - } -} - -export class FormAdapter implements IAdapter<Form> { - - private sectionAdapter = new SectionAdapter(); - private fileAdapter = new FileAdapter(); - - adapt(data: any): Form { - return new Form({ - id: data.id, - title: data.title, - sections: data.sections.map(item => this.sectionAdapter.adapt(item)), - files: data.files.map(item => this.fileAdapter.adapt(item)), - }) - } - - toPayload(form: Form): FormEntryPayload { - const answers: Answer[] = []; - form.sections.forEach(section => { - section.questions.forEach(question => { - answers.push({ question: question.id, answer: question.answer }); - }) - }) - return { - form: form.id, - answers: answers, - }; - } -} diff --git a/src_/app/dynamic-forms/core/form.service.ts b/src_/app/dynamic-forms/core/form.service.ts deleted file mode 100644 index ca26972be58ee5569390bddeccb7e1c199f23c06..0000000000000000000000000000000000000000 --- a/src_/app/dynamic-forms/core/form.service.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { Injectable } from '@angular/core'; -import { FormGroup, FormControl, Validators } from '@angular/forms'; -import { Form, Question, FormEntryPayload } from './form.model'; - - -@Injectable({ - providedIn: 'root' -}) -export class FormService { - - constructor() { } - - private toRawFormGroup(questions: Question[]): any { - const group: any = {}; - questions.forEach(question => { - group[question.id] = question.required ? new FormControl(null, Validators.required) : new FormControl(); - }); - return group; - } - - // Return a flat FormGroup object with all questions from all sections - // Key is the question ID, value is a FormControl object - toFormGroup(form: Form): FormGroup { - let group: any = {}; - form.sections.forEach(section => { - Object.assign(group, this.toRawFormGroup(section.questions)); - }); - const formGroup = new FormGroup(group); - return formGroup; - } - - setAnswers(form: Form, formGroup: FormGroup) { - const value: any = formGroup.value; - form.sections.forEach(section => { - section.questions.forEach(question => { - question.answer = value[question.id]; - }); - }); - } -} diff --git a/src_/app/dynamic-forms/core/index.ts b/src_/app/dynamic-forms/core/index.ts deleted file mode 100644 index 134143a8aee816f5f7eda6834b9c8ceaf5027eaa..0000000000000000000000000000000000000000 --- a/src_/app/dynamic-forms/core/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './form.model'; -export * from './form.service'; diff --git a/src_/app/dynamic-forms/dynamic-form/dynamic-form.component.html b/src_/app/dynamic-forms/dynamic-form/dynamic-form.component.html deleted file mode 100644 index 0350c2fbdc780f71c962e384807cebdfc20f9d6e..0000000000000000000000000000000000000000 --- a/src_/app/dynamic-forms/dynamic-form/dynamic-form.component.html +++ /dev/null @@ -1,10 +0,0 @@ -<form [formGroup]="formGroup" (ngSubmit)="onSubmit()" *ngIf="form"> - <h1>{{ form.title }}</h1> - - <div *ngFor="let section of form.sections"> - <h2>{{ section.title }}</h2> - <app-question *ngFor="let question of section.questions" [question]="question" [formGroup]="formGroup"></app-question> - </div> - - <button *ngIf="submitButton" mat-button color="primary" style="margin-top: 1em;" [disabled]="!formGroup.valid" type="submit">{{ submitLabel }}</button> -</form> diff --git a/src_/app/dynamic-forms/dynamic-form/dynamic-form.component.scss b/src_/app/dynamic-forms/dynamic-form/dynamic-form.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/dynamic-forms/dynamic-form/dynamic-form.component.ts b/src_/app/dynamic-forms/dynamic-form/dynamic-form.component.ts deleted file mode 100644 index 73574f0452a0c423f63fc64221b05b4fdd2e65a6..0000000000000000000000000000000000000000 --- a/src_/app/dynamic-forms/dynamic-form/dynamic-form.component.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { Component, OnInit, OnDestroy, Input, Output, EventEmitter } from '@angular/core'; -import { FormGroup } from '@angular/forms'; -import { Observable, Subscription } from 'rxjs'; -import { Form, FormService, FormEntryPayload, } from '../core'; - -@Component({ - selector: 'dynamic-form', - templateUrl: './dynamic-form.component.html', - styleUrls: ['./dynamic-form.component.scss'] -}) -export class DynamicFormComponent implements OnInit, OnDestroy { - - _form: Form; - - get form(): Form { - return this._form; - } - - @Input('form') set form(form: Form) { - this._form = form; - this.createForm(); - } - @Input() reset$: Observable<any>; - @Input() submitButton = true; - @Input() submitLabel = 'Envoyer'; - @Output() submitted: EventEmitter<Form> = new EventEmitter(); - - formGroup: FormGroup; - - subscription = new Subscription(); - - constructor(private formService: FormService) { } - - ngOnInit() { - if (this.reset$) { - this.reset$.subscribe( - () => this.formGroup && this.formGroup.reset() - ); - } - } - - private createForm() { - if (this.form) { - this.formGroup = this.formService.toFormGroup(this.form); - } else { - this.formGroup = null; - } - } - - save() { - this.formService.setAnswers(this.form, this.formGroup); - } - - onSubmit() { - this.save(); - this.submitted.emit(this.form); - } - - ngOnDestroy() { - this.subscription.unsubscribe(); - } - -} diff --git a/src_/app/dynamic-forms/dynamic-forms.module.ts b/src_/app/dynamic-forms/dynamic-forms.module.ts deleted file mode 100644 index 6ceedfe8e95530c050bb161d79b8df1670ffecbb..0000000000000000000000000000000000000000 --- a/src_/app/dynamic-forms/dynamic-forms.module.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MomentModule } from 'ngx-moment'; -import { - MatFormFieldModule, - MatInputModule, - MatSelectModule, - MatButtonModule, - MatRadioModule, - MatDatepickerModule, - MatNativeDateModule, -} from '@angular/material'; -import { DateAdapter, MAT_DATE_LOCALE, MAT_DATE_FORMATS } from '@angular/material/core'; -import { MomentDateAdapter } from '@angular/material-moment-adapter'; -import { DynamicFormComponent } from './dynamic-form/dynamic-form.component'; -import { QuestionComponent } from './question/question.component'; -import { FormEntryComponent } from './form-entry/form-entry.component'; - - -export const DATE_FORMATS = { - parse: { - dateInput: 'DD/MM/YYYY', - }, - display: { - dateInput: 'DD/MM/YYYY', - monthYearLabel: 'MMM YYYY', - dateA11yLabel: 'LL', - monthYearA11yLabel: 'MMMM YYYY', - }, -}; - - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - ReactiveFormsModule, - MomentModule, - // Angular Material - MatDatepickerModule, - MatFormFieldModule, - MatInputModule, - MatSelectModule, - MatRadioModule, - MatButtonModule, - MatNativeDateModule, - ], - declarations: [ - DynamicFormComponent, - QuestionComponent, - FormEntryComponent, - ], - exports: [ - DynamicFormComponent, - FormEntryComponent, - ], - providers: [ - { provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE] }, - { provide: MAT_DATE_LOCALE, useValue: 'fr-FR' }, - { provide: MAT_DATE_FORMATS, useValue: DATE_FORMATS }, - ] -}) -export class DynamicFormsModule { } diff --git a/src_/app/dynamic-forms/form-entry/form-entry.component.html b/src_/app/dynamic-forms/form-entry/form-entry.component.html deleted file mode 100644 index 71fa875955660932fc35ed4b38406338b92f5749..0000000000000000000000000000000000000000 --- a/src_/app/dynamic-forms/form-entry/form-entry.component.html +++ /dev/null @@ -1,15 +0,0 @@ -<div *ngIf="form"> - <h3>{{ form.title }}</h3> - <div class="section" *ngFor="let section of form.sections"> - <h4 class="section-title">{{ section.title }}</h4> - <p class="answer" *ngFor="let question of section.questions"> - <strong>{{ question.text }}</strong> : - <span [ngSwitch]="question.type"> - <span *ngSwitchCase="'date'"> - {{ question.answer | amLocale: 'fr' | amDateFormat: 'LL' }} - </span> - <span *ngSwitchDefault>{{ question.answer }}</span> - </span> - </p> - </div> -</div> diff --git a/src_/app/dynamic-forms/form-entry/form-entry.component.scss b/src_/app/dynamic-forms/form-entry/form-entry.component.scss deleted file mode 100644 index a6d27e2da89a3f3ab8b1823bdb012ff52689b8bb..0000000000000000000000000000000000000000 --- a/src_/app/dynamic-forms/form-entry/form-entry.component.scss +++ /dev/null @@ -1,16 +0,0 @@ - -.section { - margin-bottom: 1em; -} - -.section-title { - padding: 0; - margin: 0; - margin-bottom: .5em; -} - -p.answer { - padding: 0; - margin: 0; - margin-top: .3em; -} diff --git a/src_/app/dynamic-forms/form-entry/form-entry.component.ts b/src_/app/dynamic-forms/form-entry/form-entry.component.ts deleted file mode 100644 index f260650ef3462e8889383b6ad4fd42353d17ae72..0000000000000000000000000000000000000000 --- a/src_/app/dynamic-forms/form-entry/form-entry.component.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { Form } from '../core'; - -@Component({ - selector: 'app-form-entry', - templateUrl: './form-entry.component.html', - styleUrls: ['./form-entry.component.scss'] -}) -export class FormEntryComponent { - - @Input() form: Form; - -} diff --git a/src_/app/dynamic-forms/index.ts b/src_/app/dynamic-forms/index.ts deleted file mode 100644 index 84b0a3c23fef794256c786611e84db8a7bc1a9d9..0000000000000000000000000000000000000000 --- a/src_/app/dynamic-forms/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './dynamic-forms.module'; -export * from './core'; -export * from './dynamic-form/dynamic-form.component'; -export * from './form-entry/form-entry.component'; diff --git a/src_/app/dynamic-forms/question/question.component.html b/src_/app/dynamic-forms/question/question.component.html deleted file mode 100644 index 60c423d689b991e5c369c5012f568781643a5817..0000000000000000000000000000000000000000 --- a/src_/app/dynamic-forms/question/question.component.html +++ /dev/null @@ -1,56 +0,0 @@ -<div [formGroup]="formGroup" [ngSwitch]="question.type" class="full-width"> - - <mat-form-field *ngSwitchCase="'text-small'" class="full-width"> - <input - matInput - [formControlName]="question.id" - [required]="question.required" - [placeholder]="question.text"> - <mat-hint *ngIf="question.helpText">{{ question.helpText }}</mat-hint> - </mat-form-field> - - <mat-form-field *ngSwitchCase="'text-long'" class="full-width"> - <textarea - matInput - [formControlName]="question.id" - [required]="question.required" - [placeholder]="question.text"></textarea> - <mat-hint *ngIf="question.helpText">{{ question.helpText }}</mat-hint> - </mat-form-field> - - <mat-form-field *ngSwitchCase="'date'" class="full-width"> - <input - matInput - [formControlName]="question.id" - [required]="question.required" - [placeholder]="question.text" - [matDatepicker]="picker"> - <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle> - <mat-datepicker #picker></mat-datepicker> - <mat-hint *ngIf="question.helpText">{{ question.helpText }}</mat-hint> - </mat-form-field> - - <div *ngSwitchCase="'yes-no'" class="full-width"> - <mat-label style="display: block;" required>{{ question.text }}</mat-label> - <mat-radio-group class="radio-v" - [formControlName]="question.id" - [required]="question.required"> - <mat-radio-button [value]="true">Oui</mat-radio-button> - <mat-radio-button [value]="false">Non</mat-radio-button> - <mat-hint *ngIf="question.helpText">{{ question.helpText }}</mat-hint> - </mat-radio-group> - </div> - - <div *ngSwitchCase="'sex'" class="full-width"> - <mat-label style="display: block;">{{ question.text }}</mat-label> - <mat-radio-group class="radio-v" - [formControlName]="question.id" - [required]="question.required"> - <mat-radio-button [value]="'M'">Masculin</mat-radio-button> - <mat-radio-button [value]="'F'">Féminin</mat-radio-button> - <mat-hint *ngIf="question.helpText">{{ question.helpText }}</mat-hint> - </mat-radio-group> - </div> - - <div *ngSwitchDefault>Type de question inconnu</div> -</div> diff --git a/src_/app/dynamic-forms/question/question.component.scss b/src_/app/dynamic-forms/question/question.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/dynamic-forms/question/question.component.ts b/src_/app/dynamic-forms/question/question.component.ts deleted file mode 100644 index fefea0ff83f86b0dec92117bba3573a9f7e928cc..0000000000000000000000000000000000000000 --- a/src_/app/dynamic-forms/question/question.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { FormGroup } from '@angular/forms'; -import { Question } from '../core'; - -@Component({ - selector: 'app-question', - templateUrl: './question.component.html', - styleUrls: ['./question.component.scss'] -}) -export class QuestionComponent { - - @Input() question: Question; - @Input() formGroup: FormGroup; - -} diff --git a/src_/app/login/login.component.html b/src_/app/login/login.component.html deleted file mode 100644 index 58676ecb6fbf8c1b8c108b7f3414a7fbd5c3821a..0000000000000000000000000000000000000000 --- a/src_/app/login/login.component.html +++ /dev/null @@ -1,33 +0,0 @@ -<app-form-page> - <h1>Connexion</h1> - - <form [formGroup]="formGroup" (ngSubmit)="login()"> - - <!-- Email field --> - <mat-form-field class="block"> - <input matInput type="email" formControlName="email" required placeholder="Adresse email" autofocus> - </mat-form-field> - - <!-- Password field --> - <mat-form-field class="block"> - <input matInput type="password" formControlName="password" required placeholder="Mot de passe"> - </mat-form-field> - - <!-- Submit --> - <div class="text-center"> - <button mat-raised-button color="primary" [disabled]="!formGroup.valid || loading" id="login-btn"> - Se connecter <i *ngIf="loading" class="fa fa-spinner fa-pulse"></i> - </button> - </div> - <div class="text-center"> - <br> - <a routerLink="/reinitialiser_mdp">Mot de passe oublié ?</a></div> - </form> - - <messages></messages> - - <p class="text-center"> - Ou crée ton - <a routerLink="/inscription">compte tutoré</a> - </p> -</app-form-page> \ No newline at end of file diff --git a/src_/app/login/login.component.scss b/src_/app/login/login.component.scss deleted file mode 100644 index 2e0715852a867e745f1483f4f38c515007e32c31..0000000000000000000000000000000000000000 --- a/src_/app/login/login.component.scss +++ /dev/null @@ -1,38 +0,0 @@ -@import '~sass/variables'; -@import '~sass/mixins'; - -.logo { - width: 100%; - max-width: 20em; - height: auto; - display: block; - margin: auto; -} - -.form-group { - display: flex; - flex-flow: column; -} - -.has-error { - input { - @include style-danger; - } -} -#login-btn { - margin-top: 1em; -} - -.form-control { - position: relative; - font-size: 16px; - height: auto; - padding: 10px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -.block { - width: 100%; -} diff --git a/src_/app/login/login.component.ts b/src_/app/login/login.component.ts deleted file mode 100644 index 5070b7c97539b16b023d027162da709e04c7cd01..0000000000000000000000000000000000000000 --- a/src_/app/login/login.component.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; -import { FormGroup, FormBuilder } from '@angular/forms'; -import { MatSnackBar } from '@angular/material'; -import { AuthService, MessageService } from 'app/core'; -import { of } from 'rxjs'; -import { filter, map, tap, catchError } from 'rxjs/operators'; - -@Component({ - selector: 'app-login', - templateUrl: './login.component.html', - styleUrls: ['./login.component.scss'] -}) -export class LoginComponent implements OnInit { - - loading: boolean = false; - defaultRedirectUrl: string = '/membres'; - formGroup: FormGroup; - - constructor( - private router: Router, - private auth: AuthService, - private messageService: MessageService, - private fb: FormBuilder, - private snackBar: MatSnackBar, - ) { } - - ngOnInit() { - if (this.auth.fromGuard) { - this.messageService.error('Oops ! Vous devez vous connecter pour accéder à cette page.'); - } - if (this.auth.fromUnauthorized) { - this.messageService.error("Oops ! Vous n'avez pas les permissions requises pour accéder à cette page."); - } - this.createForm(); - } - - private createForm() { - this.formGroup = this.fb.group({ - email: '', - password: '', - }); - } - - login() { - this.loading = true; - const { email, password } = this.formGroup.value; - this.messageService.clear(); - this.auth.login(email, password).pipe( - catchError(() => { - this.messageService.error("L'identifiant ou le mot de passe est incorrect."); - return of(false); - }), - tap(() => this.loading = false), - // Only continue if no error - filter(Boolean), - // Get redirect URL from the auth service, provided by the auth guard. - map(() =>this.auth.redirectUrl ? this.auth.redirectUrl : this.defaultRedirectUrl), - tap(() => this.snackBar.open('Connexion réussie !', 'OK', { duration: 2000 })), - tap((redirectUrl: string) => this.router.navigate([redirectUrl])), - ).subscribe(); - } - -} diff --git a/src_/app/members/account/account-routing.module.ts b/src_/app/members/account/account-routing.module.ts deleted file mode 100644 index 4494b72832145e3830c1a6bc3928a12b7ec2734b..0000000000000000000000000000000000000000 --- a/src_/app/members/account/account-routing.module.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; - -//Components -import { AccountComponent } from './account.component'; -import {MyDataComponent} from './my-data/my-data.component' -import {EditDataComponent} from './edit-data/edit-data.component' -import {MyFileComponent} from './my-file/my-file.component' -import { PersonalDataResolver } from './core' -import {AccountValidationResolver} from './core' - - -const routes: Routes = [ - { - path: '', - data: { title: 'Mon Compte' }, - component: AccountComponent, - children: [ - { - path: 'donnees', - component: MyDataComponent, - resolve : { - 'personalData' : PersonalDataResolver, - //'validatedAccount' : AccountValidationResolver - }, - }, - { - path: 'modifier_donnees', component: EditDataComponent, - resolve : { - 'personalData' : PersonalDataResolver - }, - - }, - // { - // path: 'mon_dossier', component: MyFileComponent, - - // } - ], - }, -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class AccountRoutingModule { } diff --git a/src_/app/members/account/account.component.html b/src_/app/members/account/account.component.html deleted file mode 100644 index 1838fd558330eb6d2434d9755057ec145526e316..0000000000000000000000000000000000000000 --- a/src_/app/members/account/account.component.html +++ /dev/null @@ -1,8 +0,0 @@ -<h1 class="text-center">Mon Compte</h1> -<div class="centered-links"> - <app-nav-group [links]="navLinks" theme="blue" [theme]="theme"></app-nav-group> -</div> - -<messages></messages> -<router-outlet></router-outlet> - diff --git a/src_/app/members/account/account.component.scss b/src_/app/members/account/account.component.scss deleted file mode 100644 index 0ac99de35c01c69a3f9e14ff94ed4e4d521d6a75..0000000000000000000000000000000000000000 --- a/src_/app/members/account/account.component.scss +++ /dev/null @@ -1,38 +0,0 @@ -@import '~app/showcase-site/sass/mixins'; - -#page { - @include margin-page; -} - -$grid-gap: 1em; - -ul.tabs { - list-style-type: none; - margin: 0; - padding: 0; - display: flex; - flex-flow: row; - justify-content: space-around; - - text-align: center; - margin-bottom: 2em; - li { - padding: 1em; - cursor: pointer; - color: $color-muted; - font-weight: bold; - &:hover { - color: $color-text; - } - &.active { - color: $color-dark-blue; - } - } - border-bottom: 1px solid $color-light-gray; -} - -.centered-links{ - display:flex; - flex-direction: row; - justify-content: space-around; -} \ No newline at end of file diff --git a/src_/app/members/account/account.component.ts b/src_/app/members/account/account.component.ts deleted file mode 100644 index b16b9250c03c4ac5ac5d15fb0026945dc5ca0cd4..0000000000000000000000000000000000000000 --- a/src_/app/members/account/account.component.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Component, OnInit,Input } from '@angular/core'; -import { Router } from '@angular/router'; -import { Link } from 'app/shared'; - -@Component({ - selector: 'app-account', - templateUrl: './account.component.html', - styleUrls: ['./account.component.scss'] -}) -export class AccountComponent implements OnInit { - @Input() theme: string; - constructor( private router: Router ) { } - - navLinks: Link[] = [ - { href: './donnees', text: 'Mes données' }, - { href: './modifier_donnees', text: 'Modifier mes données' }, - //{ href: './mon_dossier', text: 'Mon dossier' }, - - ]; - ngOnInit() { - this.router.navigate(['./membres/compte/modifier_donnees']) - } - -} diff --git a/src_/app/members/account/account.module.ts b/src_/app/members/account/account.module.ts deleted file mode 100644 index 8d19200616ce6f02f7b5efd89ca1c32656396091..0000000000000000000000000000000000000000 --- a/src_/app/members/account/account.module.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { NgModule } from '@angular/core'; - - -// Modules -import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule} from '@angular/forms'; -import { RouterModule } from '@angular/router'; -import { AgmCoreModule } from '@agm/core'; -import { MomentModule } from 'ngx-moment'; -import { CoreModule } from 'app/core'; -import { SharedModule } from 'app/shared'; -import { AccountRoutingModule } from './account-routing.module'; - -import { - MatFormFieldModule, - MatInputModule, - MatSelectModule, - MatButtonModule, - MatSnackBarModule, - MatCheckboxModule, - MatIconModule, - MatSlideToggleModule, - MatTableModule, - MatDividerModule, - MatProgressBarModule, - MatDialogModule, - MatListModule, - -} from '@angular/material'; - -// Components -import {AccountComponent} from './account.component' -import {MyDataComponent} from './my-data/my-data.component' -import {EditDataComponent} from './edit-data/edit-data.component' -import {MyFileComponent} from './my-file/my-file.component' -import {UploadComponent} from './upload/upload.component' -import { StudentChartDialogComponent } from './upload/dialog/studentChartDialog.component' -import {ImageRightsDialogComponent} from './upload/dialog/imageRightsDialog.component' -import {ParentalAuthDialogComponent} from './upload/dialog/parentalAuthDialog.component' -@NgModule({ - imports: [ - CommonModule, - FormsModule, - MomentModule, - RouterModule, - AgmCoreModule, - CoreModule, - SharedModule, - AccountRoutingModule, - ReactiveFormsModule, - // Material - MatFormFieldModule, - MatSelectModule, - MatInputModule, - MatButtonModule, - MatSnackBarModule, - MatCheckboxModule, - MatIconModule, - MatSlideToggleModule, - MatTableModule, - MatDividerModule, - MatProgressBarModule, - MatButtonModule, - MatDialogModule, - MatListModule, - - ], - declarations: [ - AccountComponent, - MyDataComponent, - EditDataComponent, - MyFileComponent, - UploadComponent, - ParentalAuthDialogComponent, - ImageRightsDialogComponent, - StudentChartDialogComponent - ], - entryComponents:[ParentalAuthDialogComponent,ImageRightsDialogComponent,StudentChartDialogComponent] -}) -export class AccountModule { } diff --git a/src_/app/members/account/core/account-validation.service.ts b/src_/app/members/account/core/account-validation.service.ts deleted file mode 100644 index 5dbc601623b33089eae49582ebf38d698c81fc77..0000000000000000000000000000000000000000 --- a/src_/app/members/account/core/account-validation.service.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { Resolve,ActivatedRouteSnapshot } from '@angular/router'; -import { Observable, of, forkJoin } from 'rxjs'; -import { tap, map, filter,catchError } from 'rxjs/operators'; -import { ApiService, AuthService,} from 'app/core'; - - -@Injectable({ - providedIn: 'root' -}) -export class AccountValidationService extends ApiService { - - //api url - private baseUrl = this.apiUrl + 'registrations'; - - constructor( - private http: HttpClient, - private auth: AuthService - ) { super(); } - - //get personalData by user - get(filters: any): Observable<String> { - const url = this.baseUrl; - return this.http.get(url, { params: filters }).pipe( - map((data: any) => { - - return data}), - ); - } - retrieve(id: number | string): Observable<String> { - let url = this.baseUrl; - return this.http.get<String>(url).pipe( - map(v =>{ - console.log('validation',v) - if(v instanceof Array){ - if (v.length>1){ - return v.find((user)=>user.user_id===id).validated - } - return v[0].validated - } - - }), - ); - } - - forUser(userId: number): Observable<String> { - return this.get({ user_id: String(userId)}); - } -} - -@Injectable({ - providedIn: 'root' - }) -export class AccountValidationResolver implements Resolve<String>{ - - constructor(private service: AccountValidationService, private auth: AuthService) { } - //fetch registration status - - resolve(route: ActivatedRouteSnapshot): Observable<String> { - const user = this.auth.getUserSnapshot(); - return this.service.retrieve(user.id).pipe( - catchError(e => of(null)) - ); - - } -} - - diff --git a/src_/app/members/account/core/index.ts b/src_/app/members/account/core/index.ts deleted file mode 100644 index ccdcd8cea7180e630c43cce7fc2094f35eec6741..0000000000000000000000000000000000000000 --- a/src_/app/members/account/core/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './personal-data.model'; -export * from './personal-data.service'; -export * from './account-validation.service'; diff --git a/src_/app/members/account/core/personal-data.model.ts b/src_/app/members/account/core/personal-data.model.ts deleted file mode 100644 index a2c4ba0964b68022ea421987badd25d8375136ce..0000000000000000000000000000000000000000 --- a/src_/app/members/account/core/personal-data.model.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { User, UserAdapter, IAdapter } from 'app/core'; - - -export class PersonalDataSchema { - - - user_id: string; - url : string; - year: string; - registration: Registration; - firstName:string; - lastName: string; - gender: string; - nationality: string; - addressNumber:number; - street:string; - zipCode:number; - city:string; - personalPhone:string; - parentsPhone:string; - parentsEmail:string; - school:string; - grade:string; - classType:string; - specialTeaching:string; - scholarship:string; - fatherActivity:string; - motherActivity:string; - parentsStatus:string; - dependantsNumber:number; -} - -class RegistrationSchema { - id: Number; - submitted: string; - validated: boolean; -} - - -export class Registration extends RegistrationSchema { - - constructor(args: RegistrationSchema) { - super(); - Object.assign(this, args); - } -} - -export class PersonalData extends PersonalDataSchema { - - constructor(args: PersonalDataSchema) { - super(); - Object.assign(this, args); - } -} - -export class PersonalDataAdapter implements IAdapter<PersonalData> { - - private userAdapter = new UserAdapter(); - - adapt(data: any): PersonalData { - return new PersonalData({ - url : data.url?data.url:'', - user_id: data.user_id?data.user_id:'', - registration:data.registration?data.registration:{id: 0,submitted: '',validated: false}, - year:data.year?data.year:'', - firstName: data.user.first_name?data.user.first_name:'', - lastName: data.user.last_name?data.user.last_name:'', - gender: data.gender?data.gender:'', - nationality : data.nationality?data.nationality:'', - addressNumber: data.addressNumber?data.addressNumber:'', - street:data.street?data.street:'', - zipCode:data.zipCode?data.zipCode:'', - city:data.city?data.city:'', - personalPhone:data.personalPhone?data.personalPhone:'', - parentsPhone:data.parentsPhone?data.parentsPhone:'', - parentsEmail:data.parentsEmail?data.parentsEmail:'', - school:data.school?data.school:'', - grade:data.grade?data.grade:'', - classType : data.classType?data.classType:'', - specialTeaching:data.specialTeaching?data.specialTeaching:'', - scholarship:data.scholarship?data.scholarship:'', - fatherActivity:data.fatherActivity?data.fatherActivity:'', - motherActivity:data.motherActivity?data.motherActivity:'', - parentsStatus:data.parentsStatus?data.parentsStatus:'', - dependantsNumber:data.dependantsNumber?data.dependantsNumber:'' - }); - } - - encode(obj: PersonalData): any { - return { - user_id: obj.user_id, - url : obj.url, - gender: obj.gender, - nationality: obj.nationality, - addressNumber: obj.addressNumber, - street:obj.street, - zipCode:obj.zipCode, - city:obj.city, - personalPhone:obj.personalPhone, - parentsPhone:obj.parentsPhone, - parentsEmail:obj.parentsEmail, - school:obj.school, - grade:obj.grade, - classType:obj.classType, - specialTeaching:obj.specialTeaching, - scholarship:obj.scholarship, - fatherActivity:obj.fatherActivity, - motherActivity:obj.motherActivity, - parentsStatus:obj.parentsStatus, - dependantsNumber:obj.dependantsNumber - } - } -} diff --git a/src_/app/members/account/core/personal-data.service.ts b/src_/app/members/account/core/personal-data.service.ts deleted file mode 100644 index be2695f8cbb6dc4f3a89f085c349a4fe6db6ffab..0000000000000000000000000000000000000000 --- a/src_/app/members/account/core/personal-data.service.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { Resolve,ActivatedRouteSnapshot } from '@angular/router'; -import { Observable, of, forkJoin } from 'rxjs'; -import { tap, map, filter,catchError } from 'rxjs/operators'; -import { ApiService, AuthService,} from 'app/core'; -import {PersonalDataAdapter,PersonalData} from './personal-data.model' - - -@Injectable({ - providedIn: 'root' -}) -export class PersonalDataService extends ApiService { - - //api url - private baseUrl = this.apiUrl + 'students'; - private adapter = new PersonalDataAdapter(); - - constructor( - private http: HttpClient, - private auth: AuthService - ) { super(); } - - //get personalData by user - get(filters: any): Observable<PersonalData> { - const url = this.baseUrl; - return this.http.get(url, { params: filters }).pipe( - map((data: any) => { - - return data.map(item => this.adapter.adapt(item))}), - ); - } - retrieve(id: number | string): Observable<PersonalData> { - let url = this.baseUrl; - return this.http.get<PersonalData>(url).pipe( - map(v =>{ - - if(v instanceof Array){ - if (v.length>1){ - return this.adapter.adapt(v.find((user)=>user.user_id===id)) - } - else if (v.length===1){ - return this.adapter.adapt(v[0]) - }else{ - - return this.adapter.adapt({}) - } - - } - - }), - ); - } - - forUser(userId: number): Observable<PersonalData> { - return this.get({ user_id: String(userId)}); - } - //edit personalData for a user - edit(personalData: PersonalData): Observable<any> { - - const body: any = this.adapter.encode(personalData); - return this.http.put(personalData.url, body); - } -} - -@Injectable({ - providedIn: 'root' - }) -export class PersonalDataResolver implements Resolve<PersonalData>{ - - constructor(private service: PersonalDataService, private auth: AuthService) { } - //fetch user - - resolve(route: ActivatedRouteSnapshot): Observable<PersonalData> { - const user = this.auth.getUserSnapshot(); - return this.service.retrieve(user.id).pipe( - catchError(e => of(null)) - ); - - } -} - - diff --git a/src_/app/members/account/edit-data/edit-data.component.html b/src_/app/members/account/edit-data/edit-data.component.html deleted file mode 100644 index aa2bd44a880eab16d719f9e015898e85649802f6..0000000000000000000000000000000000000000 --- a/src_/app/members/account/edit-data/edit-data.component.html +++ /dev/null @@ -1,161 +0,0 @@ -<app-form-page> - <form [formGroup]="formGroup" (ngSubmit)="submit()"> - <h2>Modifier mes données personnelles</h2> - <p class="text-center">Informations personnelles</p> - <mat-form-field class="full-width" > - <input matInput type="text" formControlName="firstName" placeholder="Prénom" required> - </mat-form-field> - <mat-form-field class="full-width" > - <input matInput type="text" formControlName="lastName" placeholder="Nom" required> - </mat-form-field> - - <div class="form-group"> - <mat-form-field class="horizontal-display"> - <mat-label>Sexe</mat-label> - <mat-select formControlName="gender" required> - <mat-option value="Homme">Homme</mat-option> - <mat-option value="Femme" >Femme</mat-option> - <mat-option value="Autre">Autre</mat-option> - </mat-select> - </mat-form-field> - <mat-form-field class="horizontal-display" > - <input matInput type="text" formControlName="nationality" placeholder="Nationalité" required> - </mat-form-field> - </div> - - <p class="text-center">Adresse</p> - <div class="form-group"> - <mat-form-field class="full-width address-input quarter-display"> - <input matInput type="text" formControlName="addressNumber" placeholder="Numéro de rue" required> - </mat-form-field> - <mat-form-field class="full-width address-input"> - <input matInput type="text" formControlName="street" placeholder="Rue" required> - </mat-form-field> - </div> - - <div class="form-group"> - <mat-form-field class="full-width address-input quarter-display"> - <input matInput type="text" minlength="5" maxlength="5" formControlName="zipCode" placeholder="Code postal" required> - <mat-error *ngIf="formGroup.controls['city'].hasError('pattern')"> - Vous devez rentrer un code postal correct - </mat-error> - </mat-form-field> - - <mat-form-field class="full-width address-input" > - <input matInput type="text" formControlName="city" placeholder="Ville" required> - </mat-form-field> - </div> - <p class="text-center">Informations de contact</p> - <mat-form-field class="full-width" > - <input matInput type="text" formControlName="personalPhone" placeholder="Téléphone personnel sous la forme '0623456789' (sans espaces ni tirets)" required> - </mat-form-field> - <mat-form-field class="full-width" > - <input matInput type="text" formControlName="parentsPhone" placeholder="Téléphone des parents sous la forme '0623456789' (sans espaces ni tirets)" required> - </mat-form-field> - - <mat-form-field class="full-width" > - <input matInput type="text" formControlName="parentsEmail" placeholder="Email des parents" required> - </mat-form-field> - - <p class="text-center">Informations scolaires</p> - - <mat-form-field class="full-width" > - <mat-label>Etablissement </mat-label> - <mat-select formControlName="school" required> - <mat-option *ngFor="let school of possibleSchools" [value]="school.id">{{ school.name }}</mat-option> - </mat-select> - </mat-form-field> - <mat-form-field class="full-width" > - <input matInput required type="text" formControlName="specialTeaching" placeholder="Enseignements de spécialité (entrer 'aucun' si jamais vous n'etes pas concerné)" > - </mat-form-field> - <div class="form-group"> - <mat-form-field class="horizontal-display"> - <mat-label>Classe</mat-label> - <mat-select formControlName="grade" required> - <mat-option value="troisieme">Troisième</mat-option> - <mat-option value="seconde">Seconde</mat-option> - <mat-option value="premiere" >Première</mat-option> - <mat-option value="terminale">Terminale</mat-option> - <mat-option value="classe passerelle">Classe Passerelle</mat-option> - </mat-select> - </mat-form-field> - - <mat-form-field class="horizontal-display horizontal-center"> - <mat-label>Voie</mat-label> - <mat-select formControlName="classType" required> - <mat-option value="General">General</mat-option> - <mat-option value="Technologique">Technologique</mat-option> - <mat-option value="Professionnelle">Professionnelle</mat-option> - </mat-select> - </mat-form-field> - - <mat-form-field class="horizontal-display"> - <mat-label>Boursier </mat-label> - <mat-select formControlName="scholarship" required> - <mat-option *ngFor="let scholarship of possibleScholarships" [value]="scholarship.id">{{ scholarship.name }}</mat-option> - </mat-select> - </mat-form-field> - - </div> - - - - <p class="text-center">Informations parentales</p> - <div class="form-group"> - <mat-form-field class="horizontal-display"> - <mat-label>Activité de la mère </mat-label> - <mat-select formControlName="motherActivity" required> - <mat-option *ngFor="let activity of possibleParentsActivities" [value]="activity.id">{{ activity.name }}</mat-option> - </mat-select> - </mat-form-field> - - <mat-form-field class="horizontal-display"> - <mat-label>Activité du père </mat-label> - <mat-select formControlName="fatherActivity" required> - <mat-option *ngFor="let activity of possibleParentsActivities" [value]="activity.id">{{ activity.name }}</mat-option> - </mat-select> - </mat-form-field> - </div> - - <div class="form-group"> - <mat-form-field class="horizontal-display"> - <mat-label>Statut des parents </mat-label> - <mat-select formControlName="parentsStatus" required > - <mat-option *ngFor="let status of possibleParentsStatus" [value]="status.id">{{ status.name }}</mat-option> - </mat-select> - </mat-form-field> - - <mat-form-field class="horizontal-display" > - <input matInput type="number" formControlName="dependantsNumber" placeholder="Nombre de personnes à charge" required> - </mat-form-field> - </div> - <p> - <small> - Données personnelles : nous utiliserons les données fournies pour assurer le contact avec toi et ta famille, - équilibrer les participations aux activités organisées ainsi qu'à des fins d'aggrégation anonymisée - (statistiques, demandes de subvention). Plus d'informations dans nos <a routerLink="/mentions-legales" - target="_blank">mentions légales</a>. - </small> - </p> - - <p> - J'accepte qu'OSER utilise mes données personnelles fournies ci-dessus ou dans le formulaire d'inscription - administrative, dans le strict respect du cadre spécifié ci-dessus : - </p> - - <mat-checkbox class="checkbox-field" formControlName="acceptedConditions" required > - J'accepte cette utilisation - </mat-checkbox> - - <div class="text-center"> - <button mat-raised-button color="primary" [disabled]="!formGroup.valid || loading"> - Modifier - <app-load-spinner *ngIf="loading" [block]="false"></app-load-spinner> - </button> - </div> - <p class="text-center">{{error}}</p> - <p class="text-center post-edit-text">{{postEditMessage}}</p> - </form> -</app-form-page> -<messages></messages> -<router-outlet></router-outlet> diff --git a/src_/app/members/account/edit-data/edit-data.component.scss b/src_/app/members/account/edit-data/edit-data.component.scss deleted file mode 100644 index f99e2b9c3baabbf455adbd54bdc198f78604ff07..0000000000000000000000000000000000000000 --- a/src_/app/members/account/edit-data/edit-data.component.scss +++ /dev/null @@ -1,32 +0,0 @@ -.checkbox-field { - display: block; - margin: .5em 0; - } - .form-group{ - display:flex; - flex-direction: row; - justify-content: space-between; - } - .horizontal-display{ - width:45%; - } - .address-input{ - margin:5px; - } - - .quarter-display{ - width:25%; - } - - .horizontal-center{ - margin: 0 10px; - } - - .checkbox-field { - display: block; - margin: .5em 0; - } - - .post-edit-text{ - color:green; - } \ No newline at end of file diff --git a/src_/app/members/account/edit-data/edit-data.component.ts b/src_/app/members/account/edit-data/edit-data.component.ts deleted file mode 100644 index 05a7a47a838a549673300c0227fd0c77f785edd6..0000000000000000000000000000000000000000 --- a/src_/app/members/account/edit-data/edit-data.component.ts +++ /dev/null @@ -1,141 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { FormGroup, FormBuilder, Validators } from '@angular/forms'; -import { Router } from '@angular/router'; -import { MatSnackBar } from '@angular/material'; -import {ActivatedRoute} from '@angular/router' -import { PersonalData,PersonalDataService } from '../core'; -import { tap, mergeMap } from 'rxjs/operators'; -import { AuthService } from 'app/core'; -import {User} from 'app/core' - - - -@Component({ - selector: 'app-edit-data', - templateUrl: './edit-data.component.html', - styleUrls: ['./edit-data.component.scss'] -}) -export class EditDataComponent implements OnInit { - personalData: PersonalData; - formGroup : FormGroup; - loading = false; - public error : String = ""; - public postEditMessage : String = "" ; - public possibleParentsStatus = [ - {id:"maried",name:"Vos parents vivent ensemble"}, - {id:"cohabitation",name:"Vos parents vivent séparément"}, - {id:"monoparental",name:"Vous avez un seul parent"} - ] - - public possibleParentsActivities = [ - {id:"Agriculteur",name:"Agriculteur"}, - {id:"Artisan, commerçant, chef d'entreprise",name:"Artisan, commerçant, chef d'entreprise"}, - {id:"Cadre, profession intellectuelle supérieure",name:"Cadre, profession intellectuelle supérieure"}, - {id:"Enseignant et assimilé",name:"Enseignant et assimilé"}, - {id:"Profession intermédiaire",name:"Profession intermédiaire"}, - {id:"Employé",name:"Employé"}, - {id:"Ouvrier",name:"Ouvrier"}, - {id:"Retraité",name:"Retraité"}, - {id:"Inactif",name:"Inactif"}, - {id:"Autre",name:"Autre"} - ] - - public possibleSchools = [ - {id:"Jean Perrin (Longjumeau)", name:"Jean Perrin (Longjumeau)"}, - {id:"Robert Doisneau (Corbeil-Essonnes)",name:"Robert Doisneau (Corbeil-Essonnes)"}, - {id:"Henri Matisse (Montreuil)",name:"Henri Matisse (Montreuil)"}, - {id:"Jean Jaurès (Montreuil)",name:"Jean Jaurès (Montreuil)"}, - {id:"Charles Péguy (Bobigny)",name:"Charles Péguy (Bobigny)"}, - {id:"Jean Jaurès (Chatenay-Malabry)",name:"Jean Jaurès (Chatenay-Malabry)"}, - {id:"Parc des Loges (Evry)",name:"Parc des Loges (Evry)"}, - {id:"Jean-Baptiste Corot (Savigny-sur-Orge)",name:"Jean-Baptiste Corot (Savigny-sur-Orge)"}, - {id:"Gaspard Monge (Savigny-sur-Orge)",name:"Gaspard Monge (Savigny-sur-Orge)"}, - ] - - public possibleScholarships = [ - {id:"echelon1",name:"Oui, échelon 1"}, - {id:"echelon2",name:"Oui, échelon 2"}, - {id:"echelon3",name:"Oui, échelon 3"}, - {id:"echelon4",name:"Oui, échelon 4"}, - {id:"echelon5",name:"Oui, échelon 5"}, - {id:"echelon6",name:"Oui, échelon 6"}, - {id:"no",name:"Non"}, - ] - - - - constructor( - private route: ActivatedRoute, - private personalDataService : PersonalDataService, - private formBuilder: FormBuilder, - private router: Router, - private auth: AuthService, - private snackBar: MatSnackBar, - - ) { } - - - ngOnInit() { - this.personalData = this.route.snapshot.data['personalData']; - this.createForm() - } - - - createForm() { - - this.formGroup = this.formBuilder.group({ - firstName:this.personalData.firstName, - lastName:this.personalData.lastName, - gender:this.personalData.gender, - nationality : this.personalData.nationality, - addressNumber:[this.personalData.addressNumber,Validators.pattern("^[0-9]*$")], - street:this.personalData.street, - zipCode:this.personalData.zipCode, - city:this.personalData.city, - personalPhone:[this.personalData.personalPhone,Validators.pattern("^([0-9]{2}[]?){5}$")], - parentsPhone:[this.personalData.parentsPhone,Validators.pattern("^([0-9]{2}[]?){5}$")], - - - parentsEmail:[this.personalData.parentsEmail,Validators.email], - school:this.personalData.school, - grade:this.personalData.grade, - classType : this.personalData.classType, - specialTeaching:this.personalData.specialTeaching, - scholarship:this.personalData.scholarship, - fatherActivity:this.personalData.fatherActivity, - motherActivity:this.personalData.motherActivity, - parentsStatus:this.personalData.parentsStatus, - dependantsNumber:this.personalData.dependantsNumber, - acceptedConditions: false - }) - - } - - submit(){ - this.loading = true; - const {firstName,lastName,gender,nationality,classType,addressNumber,street,zipCode,city,personalPhone,parentsPhone,parentsEmail,school,grade,specialTeaching,scholarship,fatherActivity,motherActivity,parentsStatus,dependantsNumber} = this.formGroup.value; - const personalData: PersonalData = {...this.personalData,classType,firstName,lastName,gender,nationality,addressNumber,street,zipCode,city,personalPhone,parentsPhone,parentsEmail,school,grade,specialTeaching,scholarship,fatherActivity,motherActivity,parentsStatus,dependantsNumber}; - - this.personalDataService.edit(personalData).pipe( - tap(() => this.loading = false), - tap(()=> this.error = ""), - tap(() => { - this.postEditMessage = "Merci d'avoir completé tes données personnelles ! Nous allons t'envoyer un email contenant le lien vers le dossier d'inscription, si tu ne le reçois pas, pense à vérifier tes spams." - setTimeout(()=>{ - this.router.navigate(['./membres/compte/donnees']) - this.postEditMessage = "" - },7000) - - }), - ).subscribe( - () => {}, - (error) => { - this.error = "Erreur lors de la modification des données, vérifie que tes données rentrées sont sous le bon format" - this.loading = false - }, - ); - - } - - -} diff --git a/src_/app/members/account/my-data/my-data.component.html b/src_/app/members/account/my-data/my-data.component.html deleted file mode 100644 index 0793adb29c32308aa553f8254ae692aa5915997d..0000000000000000000000000000000000000000 --- a/src_/app/members/account/my-data/my-data.component.html +++ /dev/null @@ -1,36 +0,0 @@ -<app-form-page> - <mat-divider class='top-margin'></mat-divider> - <p><span class='label'>Statut du dossier d'inscription : </span><span [ngClass]="styleValidatedAccount()">{{validatedAccount}}</span></p> - <mat-divider></mat-divider> - <h2>Mes données</h2> - <p><span class='label'>Prénom : </span>{{personalData.firstName}} </p> - <p><span class='label'>Nom : </span>{{personalData.lastName}}</p> - <p><span class='label'>Sexe : </span>{{personalData.gender}}</p> - <p><span class='label'>Nationalité : </span>{{personalData.nationality}}</p> - <mat-divider></mat-divider> - <p> <span class='label'>Adresse : </span>{{personalData.addressNumber}} {{personalData.street}} {{personalData.zipCode}}, {{personalData.city}}</p> - <mat-divider></mat-divider> - <p><span class='label'>Numéro de téléphone personnel : </span>{{personalData.personalPhone}}</p> - <p><span class='label'>Numéro de téléphone des parents : </span>{{personalData.parentsPhone}}</p> - <p><span class='label'>Email des parents : </span>{{personalData.parentsEmail}}</p> - <mat-divider></mat-divider> - <p><span class='label'>Etablissement : </span>{{personalData.school}}</p> - <p><span class='label'>Classe : </span>{{grade[personalData.grade]}}</p> - <p><span class='label'>Voie : </span>{{[personalData.classType]}}</p> - <p><span class='label'>Enseignement de spécialité : </span>{{personalData.specialTeaching}}</p> - <p><span class='label'>Boursier : </span>{{scholarship[personalData.scholarship]}}</p> - <mat-divider></mat-divider> - <p><span class='label'>Activité du père : </span>{{personalData.fatherActivity}}</p> - - <p><span class='label'>Activité de la mère : </span>{{personalData.motherActivity}}</p> - <p><span class='label'>Forme de votre cellule familiale parentale : </span>{{personalData.parentsStatus}}</p> - <p><span class='label'>Nombre de personnes à charge : </span>{{personalData.dependantsNumber}}</p> - <div class="text-center"> - <button mat-raised-button color="primary" (click)="editData()" ><mat-icon aria-hidden="false" aria-label="Example home icon">edit</mat-icon>Modifier mes données</button> - </div> - -</app-form-page> -<messages></messages> -<router-outlet></router-outlet> - - diff --git a/src_/app/members/account/my-data/my-data.component.scss b/src_/app/members/account/my-data/my-data.component.scss deleted file mode 100644 index b787390fa97d901555fd5b21ffa110606f623d0e..0000000000000000000000000000000000000000 --- a/src_/app/members/account/my-data/my-data.component.scss +++ /dev/null @@ -1,20 +0,0 @@ -.label{ - color:grey; - font-weight: 600; -} - -.in-progress-label{ - color : brown -} - -.not-sent-label{ - color:red -} - -.validated-label{ - color:green -} - -.top-margin{ - margin-top: 15px; -} \ No newline at end of file diff --git a/src_/app/members/account/my-data/my-data.component.ts b/src_/app/members/account/my-data/my-data.component.ts deleted file mode 100644 index 08b27e436b58c0077c62abd42fb4ffe3708914e3..0000000000000000000000000000000000000000 --- a/src_/app/members/account/my-data/my-data.component.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import {ActivatedRoute,Router} from '@angular/router' -import {PersonalData} from '../core' -import * as moment from 'moment' -import {User} from 'app/core' - -@Component({ - selector: 'app-my-data', - templateUrl: './my-data.component.html', - styleUrls: ['./my-data.component.scss'] -}) -export class MyDataComponent implements OnInit { - - personalData: PersonalData; - validatedAccount : String; - dateNow: Date; - currentYear: String; - - public grade = { - "troisieme": "Troisième", - "seconde":"Seconde", - "premiere":"Première", - "terminale":"Terminale", - "classe passerelle":"Classe Passerelle" - - } - - //Styles validated account label depending on the status of the account - public styleValidatedAccount = ()=> { - if(this.validatedAccount==="Données personnelles non remplies"){ - return 'not-sent-label' - }else if (this.validatedAccount==="En cours de validation"){ - return 'in-progress-label' - }else if (this.validatedAccount==="Validé"){ - return 'validated-label' - } - } - public scholarship = { - "echelon0": "Oui, échelon 0", - "echelon1": "Oui, échelon 1", - "echelon2": "Oui, échelon 2", - "echelon3": "Oui, échelon 3", - "echelon4": "Oui, échelon 4", - "echelon5": "Oui, échelon 5", - "echelon6": "Oui, échelon 6", - "no" : "Non" - - } - - - - public editData = ()=> { - this.router.navigate(['./membres/compte/modifier_donnees']) - } - - - - constructor(private route: ActivatedRoute, private router:Router) { } - - ngOnInit() { - - this.personalData = this.route.snapshot.data['personalData'] - this.dateNow = new Date() - if(moment(this.dateNow).month()>=9){ - this.currentYear = moment(this.dateNow).year() + "/"+ String(moment(this.dateNow).year()+1) - }else{ - this.currentYear = String(moment(this.dateNow).year() -1) + "/"+moment(this.dateNow).year() - } - - if(this.personalData.registration.validated){ - this.validatedAccount= "Validé" - }else if(this.personalData.year===this.currentYear){ - this.validatedAccount="En cours de validation" - }else{ - this.validatedAccount="Données personnelles non remplies" - } - - } - -} diff --git a/src_/app/members/account/my-file/my-file.component.html b/src_/app/members/account/my-file/my-file.component.html deleted file mode 100644 index df34468e7b5f934ba219daf392d08b4729539521..0000000000000000000000000000000000000000 --- a/src_/app/members/account/my-file/my-file.component.html +++ /dev/null @@ -1,8 +0,0 @@ -<app-form-page> - <h1>Mon dossier</h1> - <app-upload-file></app-upload-file> -</app-form-page> -<messages></messages> -<router-outlet></router-outlet> - - \ No newline at end of file diff --git a/src_/app/members/account/my-file/my-file.component.scss b/src_/app/members/account/my-file/my-file.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/members/account/my-file/my-file.component.ts b/src_/app/members/account/my-file/my-file.component.ts deleted file mode 100644 index 723e2d51532d0a4cdbafdc5a72ad5e81cb67e1f2..0000000000000000000000000000000000000000 --- a/src_/app/members/account/my-file/my-file.component.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import {ActivatedRoute} from '@angular/router' -import {UploadComponent} from '../upload/upload.component' -import {PersonalData} from '../core' -@Component({ - selector: 'app-my-file', - templateUrl: './my-file.component.html', - styleUrls: ['./my-file.component.scss'] -}) -export class MyFileComponent implements OnInit { - - - - constructor(private route: ActivatedRoute) { } - - ngOnInit() {} -} diff --git a/src_/app/members/account/my-file/my-file.module.ts b/src_/app/members/account/my-file/my-file.module.ts deleted file mode 100644 index 8d14e3ec6e3ede19e17dc223a71dfcb1368472a1..0000000000000000000000000000000000000000 --- a/src_/app/members/account/my-file/my-file.module.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { NgModule } from '@angular/core' -import { CommonModule } from '@angular/common' -import { UploadModule } from '../upload/upload.module' -import {UploadComponent} from '../upload/upload.component' -import {MyFileComponent} from './my-file.component' - -@NgModule({ - imports : [], - declarations: [], - entryComponents:[UploadComponent] - -}) -export class MyFileModule {} \ No newline at end of file diff --git a/src_/app/members/account/upload/dialog/dialog.component.html b/src_/app/members/account/upload/dialog/dialog.component.html deleted file mode 100644 index f3d15c7f6d75d357b94c75211485405f1a2d192b..0000000000000000000000000000000000000000 --- a/src_/app/members/account/upload/dialog/dialog.component.html +++ /dev/null @@ -1,48 +0,0 @@ -<input - type="file" - #file - style="display: none" - (change)="onFilesAdded()" - single -/> -<div class="container" fxLayout="column" fxLayoutAlign="space-evenly stretch"> - <h1 mat-dialog-title>Déposer un fichier</h1> - <div> - <button - [disabled]="uploading || uploadSuccessful" - mat-raised-button - color="primary" - class="add-files-btn" - (click)="addFiles()" - > - Ajouter un fichier - </button> - </div> - - <!-- This is the content of the dialog, containing a list of the files to upload --> - <mat-dialog-content fxFlex> - <mat-list> - <mat-list-item *ngFor="let file of files"> - <h4 mat-line>{{file.name}}</h4> - <mat-progress-bar - *ngIf="progress" - mode="determinate" - [value]="progress[file.name].progress | async" - ></mat-progress-bar> - </mat-list-item> - </mat-list> - </mat-dialog-content> - - <!-- This are the actions of the dialog, containing the primary and the cancel button--> - <mat-dialog-actions class="actions"> - <button *ngIf="showCancelButton" mat-button mat-dialog-close>Annuler</button> - <button - mat-raised-button - color="primary" - [disabled]="!canBeClosed" - (click)="closeDialog()" - > - {{primaryButtonText}} - </button> - </mat-dialog-actions> -</div> \ No newline at end of file diff --git a/src_/app/members/account/upload/dialog/dialog.component.scss b/src_/app/members/account/upload/dialog/dialog.component.scss deleted file mode 100644 index 88e5de70b6d2237538270ce9b56cbd78d2ac5f6a..0000000000000000000000000000000000000000 --- a/src_/app/members/account/upload/dialog/dialog.component.scss +++ /dev/null @@ -1,17 +0,0 @@ - - - :host { - height: 100%; - display: flex; - flex: 1; - flex-direction: column; - } - - .actions { - justify-content: flex-end; - float:bottom; - } - - .container { - height: 100%; - } \ No newline at end of file diff --git a/src_/app/members/account/upload/dialog/imageRightsDialog.component.ts b/src_/app/members/account/upload/dialog/imageRightsDialog.component.ts deleted file mode 100644 index 610713b56495b0853e16ad41bc491fc1396652e3..0000000000000000000000000000000000000000 --- a/src_/app/members/account/upload/dialog/imageRightsDialog.component.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { Component, OnInit, ViewChild } from '@angular/core' -import { MatDialogRef } from '@angular/material' -import { UploadService } from '../upload.service' -import { forkJoin } from 'rxjs' - -@Component({ - selector: 'app-dialog', - templateUrl: './dialog.component.html', - styleUrls: ['./dialog.component.scss'], -}) - -export class ImageRightsDialogComponent{ - constructor(public dialogRef : MatDialogRef<ImageRightsDialogComponent>, public uploadService : UploadService) { } - @ViewChild('file') file - public files: Set<File> = new Set() - progress - canBeClosed = true - primaryButtonText = 'Envoyer' - showCancelButton = true - uploading = false - uploadSuccessful = false - - addFiles() { - this.file.nativeElement.click(); - } - - onFilesAdded() { - console.log(this.file.nativeElement.files) - const files: { [key: string]: File } = this.file.nativeElement.files; - for (let key in files) { - if (!isNaN(parseInt(key))) { - this.files.clear() - this.files.add(files[key]); - } - } - } - - - closeDialog() { - // if everything was uploaded already, just close the dialog - if (this.uploadSuccessful) { - return this.dialogRef.close(); - } - - // set the component state to "uploading" - this.uploading = true; - - // start the upload and save the progress map - this.progress = this.uploadService.upload(this.files,"image"); - - // convert the progress map into an array - let allProgressObservables = []; - for (let key in this.progress) { - allProgressObservables.push(this.progress[key].progress); - } - - // Adjust the state variables - - // The OK-button should have the text "Finish" now - this.primaryButtonText = 'Terminer'; - - // The dialog should not be closed while uploading - this.canBeClosed = false; - this.dialogRef.disableClose = true; - - // Hide the cancel-button - this.showCancelButton = false; - - // When all progress-observables are completed... - forkJoin(allProgressObservables).subscribe(end => { - // ... the dialog can be closed again... - this.canBeClosed = true; - this.dialogRef.disableClose = false; - - // ... the upload was successful... - this.uploadSuccessful = true; - - // ... and the component is no longer uploading - this.uploading = false; - }); - } - } \ No newline at end of file diff --git a/src_/app/members/account/upload/dialog/parentalAuthDialog.component.ts b/src_/app/members/account/upload/dialog/parentalAuthDialog.component.ts deleted file mode 100644 index c2a038b9750aa846a270ed5e9c85f62b3fbd0ce3..0000000000000000000000000000000000000000 --- a/src_/app/members/account/upload/dialog/parentalAuthDialog.component.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { Component, OnInit, ViewChild } from '@angular/core' -import { MatDialogRef } from '@angular/material' -import { UploadService } from '../upload.service' -import { forkJoin } from 'rxjs' - -@Component({ - selector: 'app-dialog', - templateUrl: './dialog.component.html', - styleUrls: ['./dialog.component.scss'], -}) - -export class ParentalAuthDialogComponent { - constructor(public dialogRef : MatDialogRef<ParentalAuthDialogComponent>, public uploadService : UploadService) { } - @ViewChild('file') file - public files: Set<File> = new Set() - progress - canBeClosed = true - primaryButtonText = 'Envoyer' - showCancelButton = true - uploading = false - uploadSuccessful = false - - addFiles() { - this.file.nativeElement.click(); - } - - onFilesAdded() { - console.log(this.file.nativeElement.files) - const files: { [key: string]: File } = this.file.nativeElement.files; - for (let key in files) { - if (!isNaN(parseInt(key))) { - this.files.clear() - this.files.add(files[key]); - } - } - } - - - closeDialog() { - // if everything was uploaded already, just close the dialog - if (this.uploadSuccessful) { - return this.dialogRef.close(); - } - - // set the component state to "uploading" - this.uploading = true; - - // start the upload and save the progress map - this.progress = this.uploadService.upload(this.files,"parental"); - - // convert the progress map into an array - let allProgressObservables = []; - for (let key in this.progress) { - allProgressObservables.push(this.progress[key].progress); - } - - // Adjust the state variables - - // The OK-button should have the text "Finish" now - this.primaryButtonText = 'Terminer'; - - // The dialog should not be closed while uploading - this.canBeClosed = false; - this.dialogRef.disableClose = true; - - // Hide the cancel-button - this.showCancelButton = false; - - // When all progress-observables are completed... - forkJoin(allProgressObservables).subscribe(end => { - // ... the dialog can be closed again... - this.canBeClosed = true; - this.dialogRef.disableClose = false; - - // ... the upload was successful... - this.uploadSuccessful = true; - - // ... and the component is no longer uploading - this.uploading = false; - }); - } - } - - \ No newline at end of file diff --git a/src_/app/members/account/upload/dialog/studentChartDialog.component.ts b/src_/app/members/account/upload/dialog/studentChartDialog.component.ts deleted file mode 100644 index f2b3ff6d83267173205633d086693765f181e8cb..0000000000000000000000000000000000000000 --- a/src_/app/members/account/upload/dialog/studentChartDialog.component.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { Component, OnInit, ViewChild } from '@angular/core' -import { MatDialogRef } from '@angular/material' -import { UploadService } from '../upload.service' -import { forkJoin } from 'rxjs' - -@Component({ - selector: 'app-dialog', - templateUrl: './dialog.component.html', - styleUrls: ['./dialog.component.scss'], -}) - - - - - -export class StudentChartDialogComponent { - constructor(public dialogRef : MatDialogRef<StudentChartDialogComponent>, public uploadService : UploadService) { } - @ViewChild('file') file - public files: Set<File> = new Set() - progress - canBeClosed = true - primaryButtonText = 'Envoyer' - showCancelButton = true - uploading = false - uploadSuccessful = false - - addFiles() { - this.file.nativeElement.click(); - } - - onFilesAdded() { - console.log(this.file.nativeElement.files) - const files: { [key: string]: File } = this.file.nativeElement.files; - for (let key in files) { - if (!isNaN(parseInt(key))) { - this.files.clear() - this.files.add(files[key]); - } - } - } - - - closeDialog() { - // if everything was uploaded already, just close the dialog - if (this.uploadSuccessful) { - return this.dialogRef.close(); - } - - // set the component state to "uploading" - this.uploading = true; - - // start the upload and save the progress map - this.progress = this.uploadService.upload(this.files,"chart"); - - // convert the progress map into an array - let allProgressObservables = []; - for (let key in this.progress) { - allProgressObservables.push(this.progress[key].progress); - } - - // Adjust the state variables - - // The OK-button should have the text "Finish" now - this.primaryButtonText = 'Terminer'; - - // The dialog should not be closed while uploading - this.canBeClosed = false; - this.dialogRef.disableClose = true; - - // Hide the cancel-button - this.showCancelButton = false; - - // When all progress-observables are completed... - forkJoin(allProgressObservables).subscribe(end => { - // ... the dialog can be closed again... - this.canBeClosed = true; - this.dialogRef.disableClose = false; - - // ... the upload was successful... - this.uploadSuccessful = true; - - // ... and the component is no longer uploading - this.uploading = false; - }); - } -} - diff --git a/src_/app/members/account/upload/upload.component.html b/src_/app/members/account/upload/upload.component.html deleted file mode 100644 index 69120155c9f3ed37fb033da0ca8f5eb99b0ff4b7..0000000000000000000000000000000000000000 --- a/src_/app/members/account/upload/upload.component.html +++ /dev/null @@ -1,4 +0,0 @@ -<h3>Charte de l'éleve</h3><button mat-raised-button (click)="openStudentChartDialog()">Déposer le fichier</button> -<h3>Autorisation parentale</h3><button mat-raised-button (click)="openParentalAuthDialog()">Déposer le fichier</button> -<h3>Droit à l'image</h3><button mat-raised-button (click)="openImageRightsDialog()">Déposer le fichier</button> -<h3>Statut du dossier : </h3> \ No newline at end of file diff --git a/src_/app/members/account/upload/upload.component.scss b/src_/app/members/account/upload/upload.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/members/account/upload/upload.component.ts b/src_/app/members/account/upload/upload.component.ts deleted file mode 100644 index 374e0effdd6f75faf9dbc4079cce28587ea2bd92..0000000000000000000000000000000000000000 --- a/src_/app/members/account/upload/upload.component.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Component } from '@angular/core' -import { MatDialog } from '@angular/material' -import {StudentChartDialogComponent } from './dialog/studentChartDialog.component' -import {ParentalAuthDialogComponent} from './dialog/parentalAuthDialog.component' -import {ImageRightsDialogComponent} from './dialog/imageRightsDialog.component' -import { UploadService } from './upload.service' - -@Component({ - selector: 'app-upload-file', - templateUrl: './upload.component.html', - styleUrls: ['./upload.component.scss'], -}) -export class UploadComponent { - constructor(public dialog: MatDialog, public uploadService: UploadService) {} - - public openStudentChartDialog() { - let dialogRef = this.dialog.open(StudentChartDialogComponent, { - width: '50%', - height: '50%', - }) - } - public openParentalAuthDialog() { - let dialogRef = this.dialog.open(ParentalAuthDialogComponent, { - width: '50%', - height: '50%', - }) - } - public openImageRightsDialog() { - let dialogRef = this.dialog.open(ImageRightsDialogComponent, { - width: '50%', - height: '50%', - }) - } -} \ No newline at end of file diff --git a/src_/app/members/account/upload/upload.module.ts b/src_/app/members/account/upload/upload.module.ts deleted file mode 100644 index 51c0b61584ea97c68adb353475715ee04f93c13b..0000000000000000000000000000000000000000 --- a/src_/app/members/account/upload/upload.module.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { NgModule } from '@angular/core' -import { CommonModule } from '@angular/common' -//Components -import { UploadComponent } from './upload.component' -import {StudentChartDialogComponent} from './dialog/studentChartDialog.component' -import {ImageRightsDialogComponent} from './dialog/imageRightsDialog.component' -import {ParentalAuthDialogComponent} from './dialog/parentalAuthDialog.component' -import { - MatButtonModule, - MatDialogModule, - MatListModule, - MatProgressBarModule, -} from '@angular/material' - -import { BrowserAnimationsModule } from '@angular/platform-browser/animations' -import { UploadService } from './upload.service' -import { HttpClientModule } from '@angular/common/http' - -@NgModule({ - imports: [ - CommonModule, - MatButtonModule, - MatDialogModule, - MatListModule, - HttpClientModule, - BrowserAnimationsModule, - MatProgressBarModule, - ], - providers: [UploadService], - entryComponents : [ParentalAuthDialogComponent,ImageRightsDialogComponent,StudentChartDialogComponent] -}) -export class UploadModule {} \ No newline at end of file diff --git a/src_/app/members/account/upload/upload.service.spec.ts b/src_/app/members/account/upload/upload.service.spec.ts deleted file mode 100644 index c5718b07fe80fdb312fd6bd683a00cd2eef63c00..0000000000000000000000000000000000000000 --- a/src_/app/members/account/upload/upload.service.spec.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { TestBed, inject } from '@angular/core/testing'; - -import { UploadService } from './upload.service'; - -describe('UploadService', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - providers: [UploadService] - }); - }); - - it('should be created', inject([UploadService], (service: UploadService) => { - expect(service).toBeTruthy(); - })); -}); diff --git a/src_/app/members/account/upload/upload.service.ts b/src_/app/members/account/upload/upload.service.ts deleted file mode 100644 index 3e67cea77e1303fb83f6cd4f79972e304a989b82..0000000000000000000000000000000000000000 --- a/src_/app/members/account/upload/upload.service.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { Injectable } from '@angular/core' -import { - HttpClient, - HttpRequest, - HttpEventType, - HttpResponse, -} from '@angular/common/http' -import { Observable,Subject } from 'rxjs' -import { ApiService } from 'app/core'; - - - -@Injectable({ - providedIn: 'root' -}) -export class UploadService extends ApiService { - constructor(private http: HttpClient) {super();} - private url = this.apiUrl + 'upload/' - public upload( - files: Set<File>, - uploadedFileType : String - ): { [key: string]: { progress: Observable<number> } } { - // this will be the our resulting map - const status: { [key: string]: { progress: Observable<number> } } = {}; - - files.forEach(file => { - // create a new multipart-form for every file - const formData: FormData = new FormData(); - formData.append('fichier', file, file.name); - - // create a http-post request and pass the form - // tell it to report the upload progress - const req = new HttpRequest('POST', this.url+uploadedFileType, formData, { - reportProgress: true - }); - - // create a new progress-subject for every file - const progress = new Subject<number>(); - - // send the http-request and subscribe for progress-updates - this.http.request(req).subscribe(event => { - if (event.type === HttpEventType.UploadProgress) { - - // calculate the progress percentage - const percentDone = Math.round(100 * event.loaded / event.total); - - // pass the percentage into the progress-stream - progress.next(percentDone); - } else if (event instanceof HttpResponse) { - - // Close the progress-stream if we get an answer form the API - // The upload is complete - progress.complete(); - } - }); - - // Save every progress-observable in a map of all observables - status[file.name] = { - progress: progress.asObservable() - }; - }); - - // return the map of progress.observables - return status; - } -} \ No newline at end of file diff --git a/src_/app/members/members-routing.module.ts b/src_/app/members/members-routing.module.ts deleted file mode 100644 index 01addc9854b6900c3587dda5388799f5e3b3c91a..0000000000000000000000000000000000000000 --- a/src_/app/members/members-routing.module.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { AuthGuard, MapsAPIResolver } from 'app/core'; - -import { MembersComponent } from './members.component'; -import { StudentHomeComponent } from './student-home/student-home.component'; - -const routes: Routes = [ - { - path: '', - component: MembersComponent, - canActivate: [AuthGuard], - children: [ - { - path: '', - data: { title: 'Accueil' }, - component: StudentHomeComponent, - }, - { - path: 'sorties', - data: { title: 'Sorties' }, - loadChildren: './visits/visits.module#VisitsModule', - }, - { - path: 'projets', - data: { title: 'Projets' }, - loadChildren: './projects/projects.module#ProjectsModule', - }, - { - path: 'compte', - data: { title: 'Mon Compte' }, - loadChildren : './account/account.module#AccountModule', - } - ] - }, -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class MembersRoutingModule { } diff --git a/src_/app/members/members.component.html b/src_/app/members/members.component.html deleted file mode 100644 index 8fb334d434c6aeb778dfbc5a923427d45e729e4c..0000000000000000000000000000000000000000 --- a/src_/app/members/members.component.html +++ /dev/null @@ -1 +0,0 @@ -<app-layout [links]="navLinks" theme="blue"></app-layout> diff --git a/src_/app/members/members.component.scss b/src_/app/members/members.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/members/members.component.ts b/src_/app/members/members.component.ts deleted file mode 100644 index f209352459a0795824391460446f8b2453f53a6a..0000000000000000000000000000000000000000 --- a/src_/app/members/members.component.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Component } from '@angular/core'; -import { Router } from '@angular/router'; -import { AuthService } from 'app/core'; -import { Link } from 'app/shared'; - -@Component({ - selector: 'app-members', - templateUrl: './members.component.html', - styleUrls: ['./members.component.scss'] -}) -export class MembersComponent { - - constructor( - private auth: AuthService, - private router: Router, - ) { } - - navLinks: Link[] = [ - { href: './', text: 'Mon espace' }, - { href: './projets', text: 'Nos projets' }, - { href: './sorties', text: 'Nos sorties' }, - { href: './compte', text: 'Mon compte' }, - { text: 'Déconnexion', action: () => this.logout() }, - ]; - - private logout() { - this.auth.logout(); - this.router.navigate(['/']); - } - -} diff --git a/src_/app/members/members.module.ts b/src_/app/members/members.module.ts deleted file mode 100644 index 4370fa8d04f2277fab49cf880dcc45ca7e6d56ed..0000000000000000000000000000000000000000 --- a/src_/app/members/members.module.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { NgModule } from '@angular/core'; - -// Modules -import { CommonModule } from '@angular/common'; -import { RouterModule } from '@angular/router'; -import { CoreModule } from 'app/core'; -import { SharedModule } from 'app/shared'; -import { PanesModule } from 'app/panes'; -import { Ng2EmojiModule } from 'ng2-emoji'; -import { MembersRoutingModule } from './members-routing.module'; -import { StudentHomeModule } from './student-home/student-home.module'; -// Components -import { MembersComponent } from './members.component'; - - -@NgModule({ - imports: [ - CommonModule, - RouterModule, - CoreModule, - PanesModule, - SharedModule, - Ng2EmojiModule.forRoot(), - MembersRoutingModule, - StudentHomeModule, - ], - declarations: [ - MembersComponent, - ] -}) -export class MembersModule { } diff --git a/src_/app/members/projects/activate-dialog/activate-dialog.component.html b/src_/app/members/projects/activate-dialog/activate-dialog.component.html deleted file mode 100644 index de22ced6b72257a1dcddf3db851bf2128ec18aba..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/activate-dialog/activate-dialog.component.html +++ /dev/null @@ -1,17 +0,0 @@ -<h1 mat-dialog-title> - Renvoyer ton inscription à {{ edition.project }} {{ edition.year }} ? -</h1> - -<mat-dialog-content> - <p> - Ton inscription va être renvoyée aux organisateurs. - </p> - <p> - Ils étudieront ta demande et confirmeront ta participation dans la limite des places disponibles. - </p> -</mat-dialog-content> - -<mat-dialog-actions> - <button mat-button [matDialogClose]="false">Ne pas renvoyer mon inscription</button> - <button mat-raised-button color="primary" [matDialogClose]="true">Renvoyer mon inscription</button> -</mat-dialog-actions> diff --git a/src_/app/members/projects/activate-dialog/activate-dialog.component.scss b/src_/app/members/projects/activate-dialog/activate-dialog.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/members/projects/activate-dialog/activate-dialog.component.ts b/src_/app/members/projects/activate-dialog/activate-dialog.component.ts deleted file mode 100644 index dfdf7b0ad2753bfebe4c9e1c2bbca7d9d090dc6b..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/activate-dialog/activate-dialog.component.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Component, Inject, OnInit } from '@angular/core'; -import { MAT_DIALOG_DATA } from '@angular/material'; -import { Edition } from '../core'; - -@Component({ - selector: 'app-activate-dialog', - templateUrl: './activate-dialog.component.html', - styleUrls: ['./activate-dialog.component.scss'] -}) -export class ActivateDialogComponent implements OnInit { - - edition: Edition; - - constructor(@Inject(MAT_DIALOG_DATA) private data: any) { } - - ngOnInit() { - this.edition = this.data.edition; - } - -} diff --git a/src_/app/members/projects/answers-dialog/answers-dialog.component.html b/src_/app/members/projects/answers-dialog/answers-dialog.component.html deleted file mode 100644 index 9d24ad1ae621698c4aa614d86441d968db9a5f31..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/answers-dialog/answers-dialog.component.html +++ /dev/null @@ -1,11 +0,0 @@ -<h1 mat-dialog-title> - Mon dossier d'inscription -</h1> - -<mat-dialog-content> - <app-form-entry [form]="form"></app-form-entry> -</mat-dialog-content> - -<mat-dialog-actions> - <button mat-button matDialogClose>Fermer</button> -</mat-dialog-actions> diff --git a/src_/app/members/projects/answers-dialog/answers-dialog.component.scss b/src_/app/members/projects/answers-dialog/answers-dialog.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/members/projects/answers-dialog/answers-dialog.component.ts b/src_/app/members/projects/answers-dialog/answers-dialog.component.ts deleted file mode 100644 index d7cc768b1b85ee9ebb758b4cf2108c0bfed80fc2..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/answers-dialog/answers-dialog.component.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Component, OnInit, Inject } from '@angular/core'; -import { MAT_DIALOG_DATA } from '@angular/material'; -import { Participation, ParticipationService } from '../core'; -import { Form } from 'app/dynamic-forms'; - -@Component({ - selector: 'app-answers-dialog', - templateUrl: './answers-dialog.component.html', - styleUrls: ['./answers-dialog.component.scss'] -}) -export class AnswersDialogComponent implements OnInit { - - form: Form; - - constructor(@Inject(MAT_DIALOG_DATA) private data: any) { } - - ngOnInit() { - this.form = this.data.form || null; - } - -} diff --git a/src_/app/members/projects/core/edition-form.model.ts b/src_/app/members/projects/core/edition-form.model.ts deleted file mode 100644 index 889f7a8198df2b5195d2e55e81abc7b8a794d3e2..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/core/edition-form.model.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { IAdapter, Address, User, UserAdapter, AddressAdapter } from 'app/core'; -import { Form, FormAdapter } from 'app/dynamic-forms'; - -export class RecipientSchema { - user: User; - address: Address; -} - -export class Recipient extends RecipientSchema { - - constructor(args: RecipientSchema) { - super(); - Object.assign(this, args); - } -} - -export class RecipientAdapter implements IAdapter<Recipient> { - - private userAdapter = new UserAdapter(); - private addressAdapter = new AddressAdapter(); - - adapt(data: any): Recipient { - return new Recipient({ - user: this.userAdapter.adapt(data.user), - address: this.addressAdapter.adapt(data.address), - }) - } -} - -export class EditionFormSchema { - id: number; - editionId: number; - title: string; - deadline: Date; - recipient: Recipient; - form: Form; -} - -export class EditionForm extends EditionFormSchema { - - constructor(args: EditionFormSchema) { - super(); - Object.assign(this, args); - } - - get open(): boolean { - const now = new Date(); - return now <= this.deadline; - } -} - - -export class EditionFormAdapter implements IAdapter<EditionForm> { - - private recipientAdapter = new RecipientAdapter(); - private formAdapter = new FormAdapter(); - - adapt(data: any): EditionForm { - return new EditionForm({ - id: data.id, - title: data.title, - editionId: data.edition, - deadline: new Date(data.deadline), - recipient: data.recipient ? this.recipientAdapter.adapt(data.recipient) : null, - form: this.formAdapter.adapt(data.form), - }) - } -} - - -export class EditionFormSimpleAdapter implements IAdapter<EditionForm> { - - adapt(data: any): EditionForm { - return new EditionForm({ - id: data.id, - title: data.title, - editionId: data.edition, - deadline: new Date(data.deadline), - recipient: null, - form: null, - }) - } -} diff --git a/src_/app/members/projects/core/edition.model.ts b/src_/app/members/projects/core/edition.model.ts deleted file mode 100644 index e183f4a2e30a3e66d9f775f94479a2b1dcb484c7..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/core/edition.model.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { User, UserAdapter, IAdapter } from 'app/core'; -import { EditionForm, EditionFormAdapter, EditionFormSimpleAdapter } from './edition-form.model'; -import { Participation, ParticipationAdapter } from './participation.model'; - - -export class OrganizerSchema { - user: User; - role: string; -} - -export class Organizer extends OrganizerSchema { - - constructor(args: OrganizerSchema) { - super(); - Object.assign(this, args); - } -} - -export class OrganizerAdapter implements IAdapter<Organizer> { - - private userAdapter = new UserAdapter(); - - adapt(data: any): Organizer { - return new Organizer({ - user: this.userAdapter.adapt(data.user), - role: data.role, - }); - } -} - - -export class EditionSchema { - id: number; - name: string; - year: number; - project: string; - description: string; - organizers: Organizer[]; - participations: Participation[]; - editionForm: EditionForm; - participates: boolean; -} - -export class Edition extends EditionSchema { - - constructor(args: EditionSchema) { - super(); - Object.assign(this, args); - } - - fullTitle(project): string { - return project.name + ` ${this.year}` + (this.name ? ` (${this.name})` : ''); - } -} - - -export class EditionAdapter implements IAdapter<Edition> { - - private organizerAdapter = new OrganizerAdapter(); - private participationAdapter = new ParticipationAdapter(); - private editionFormAdapter = new EditionFormAdapter(); - - adapt(data: any): Edition { - return new Edition({ - id: data.id, - name: data.name, - description: data.description, - year: data.year, - project: data.project, - organizers: data.organizers.map(item => this.organizerAdapter.adapt(item)), - participations: data.participations.map(item => this.participationAdapter.adapt(item)), - editionForm: data.edition_form ? this.editionFormAdapter.adapt(data.edition_form) : null, - participates: data.participates, - }) - } -} - -export class EditionSimpleAdapter implements IAdapter<Edition> { - - private editionFormAdapter = new EditionFormSimpleAdapter(); - - adapt(data: any): Edition { - return new Edition({ - id: data.id, - name: data.name, - description: data.description, - year: data.year, - project: data.project, - organizers: new Array(data.organizers), - participations: new Array(data.participations), - editionForm: data.edition_form ? this.editionFormAdapter.adapt(data.edition_form) : null, - participates: data.participates, - }) - } -} diff --git a/src_/app/members/projects/core/edition.service.ts b/src_/app/members/projects/core/edition.service.ts deleted file mode 100644 index 4ad6bb5789dda3221dd28f4f301bef69fa8c3233..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/core/edition.service.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { map } from 'rxjs/operators'; -import { ModelApiService, ObjectListResolver, ObjectResolver } from 'app/core'; -import { Edition, EditionAdapter, EditionSimpleAdapter } from './edition.model'; -import { Recipient, RecipientAdapter } from './edition-form.model'; -import { Form, FormAdapter, File, FileAdapter } from 'app/dynamic-forms'; - - -@Injectable({ - providedIn: 'root' -}) -export class EditionService extends ModelApiService<Edition> { - - baseUrl = this.apiUrl + 'editions/'; - - constructor(public http: HttpClient) { super(); } - - getAdapter(action: string) { - if (action === 'retrieve') { - return new EditionAdapter(); - } else { - return new EditionSimpleAdapter(); - } - } - - openRegistrationsOnly(): Observable<Edition[]> { - const url = this.baseUrl + 'open_registrations/'; - const adapter = new EditionSimpleAdapter(); - return this.http.get(url).pipe( - map((data: any[]) => data.map(item => adapter.adapt(item))), - ); - } - - form(id: any): Observable<Form> { - const url = this.baseUrl + `${id}/form/`; - const adapter = new FormAdapter(); - return this.http.get(url).pipe( - map((data: any) => adapter.adapt(data)), - ); - } - - documents(id: any): Observable<{documents: File[], deadline: Date, recipient: Recipient}> { - const url = this.baseUrl + `${id}/documents/`; - const adapter = new FileAdapter(); - const recipientAdapter = new RecipientAdapter(); - return this.http.get(url).pipe( - map((data: any) => { - const documents = data.files.map(item => adapter.adapt(item)); - const deadline = new Date(data.deadline); - const recipient = recipientAdapter.adapt(data.recipient); - return { documents, deadline, recipient }; - }), - ); - } - - getDownloadUrl(id: any): string { - return this.baseUrl + `${id}/documents_zip/`; - } -} - - -@Injectable({ - providedIn: 'root' -}) -export class EditionListResolver extends ObjectListResolver<Edition> { - constructor(public service: EditionService) { super(); } -} - - -@Injectable({ - providedIn: 'root' -}) -export class EditionOpenRegistrationListResolver extends ObjectListResolver<Edition> { - constructor(public service: EditionService) { super(); } - - resolve() { - return this.service.openRegistrationsOnly(); - } -} - - -@Injectable({ - providedIn: 'root' -}) -export class EditionResolver extends ObjectResolver<Edition> { - routeLookupKey = 'editionId'; - constructor(public service: EditionService) { super(); } -} diff --git a/src_/app/members/projects/core/index.ts b/src_/app/members/projects/core/index.ts deleted file mode 100644 index c35f0a50ae063b981902d9efb80654f07bc15cc0..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/core/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './project.model'; -export * from './project.service'; -export * from './edition.model'; -export * from './edition-form.model'; -export * from './edition.service'; -export * from './participation.model'; -export * from './participation.service'; diff --git a/src_/app/members/projects/core/participation.model.ts b/src_/app/members/projects/core/participation.model.ts deleted file mode 100644 index 1972ca463b67bd5f2783da9f093e1793fcd94448..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/core/participation.model.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { User, UserAdapter, IAdapter } from 'app/core'; - - -export enum ParticipationState { - PENDING = 'pending', - VALID = 'valid', - ACCEPTED = 'accepted', - REJECTED = 'rejected', - CANCELLED = 'cancelled', -} - - -export class ParticipationSchema { - id: number; - submitted: Date; - user: User; - editionId: number; - editionFormTitle: string; - state: ParticipationState; -} - -export class Participation extends ParticipationSchema { - - constructor(args: ParticipationSchema) { - super(); - Object.assign(this, args); - } -} - -export class ParticipationAdapter implements IAdapter<Participation> { - - private userAdapter = new UserAdapter(); - - adapt(data: any): Participation { - return new Participation({ - id: data.id, - submitted: new Date(data.submitted), - user: this.userAdapter.adapt(data.user), - editionId: data.edition_id, - editionFormTitle: data.edition_form_title, - state: data.state, - }); - } -} diff --git a/src_/app/members/projects/core/participation.service.ts b/src_/app/members/projects/core/participation.service.ts deleted file mode 100644 index cb0fabd97dd0c6c2006f898e2fbc01d46c2d0f01..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/core/participation.service.ts +++ /dev/null @@ -1,131 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { Resolve } from '@angular/router'; -import { Observable, of, forkJoin } from 'rxjs'; -import { tap, map, filter } from 'rxjs/operators'; -import { ApiService, AuthService } from 'app/core'; -import { EditionService } from './edition.service'; -import { Participation, ParticipationAdapter } from './participation.model'; -import { Form, FormAdapter, FormEntryPayload } from 'app/dynamic-forms'; - -@Injectable({ - providedIn: 'root' -}) -export class ParticipationService extends ApiService { - - private baseUrl = this.apiUrl + 'project-participations/'; - private adapter = new ParticipationAdapter(); - private formAdapter = new FormAdapter(); - - constructor( - private http: HttpClient, - private editionService: EditionService, - ) { super(); } - - create(userId: number, editionId: number, form: Form): Observable<Participation> { - const payload = this.formAdapter.toPayload(form); - const body = { - user: userId, - edition_id: editionId, - entry: payload, - }; - return this.http.post(this.baseUrl, body).pipe( - map((data: any) => this.adapter.adapt(data)), - ); - } - - private list(filters: any): Observable<Participation[]> { - const url = this.baseUrl; - return this.http.get(url, { params: filters }).pipe( - map((data: any[]) => data.map(item => this.adapter.adapt(item))), - ); - } - - cancel(id: any): Observable<void> { - const url = this.baseUrl + `${id}/cancel/`; - return this.http.post(url, {}).pipe(map(() => null)); - } - - reactivate(id: any): Observable<void> { - const url = this.baseUrl + `${id}/reactivate/`; - return this.http.post(url, {}).pipe(map(() => null)); - } - - destroy(id: any): Observable<void> { - const url = this.baseUrl + `${id}/`; - return this.http.delete(url).pipe( - map(() => null) - ); - } - - pendingForUser(userId: number): Observable<Participation[]> { - return this.list({ user: String(userId), state: 'pending' }); - } - - forUser(userId: number): Observable<Participation[]> { - return this.list({ user: String(userId) }); - } - - entry(participation: Participation): Observable<Form> { - const url = this.baseUrl + `${participation.id}/form_entry/`; - - // Retrieve an empty edition form - const editionForm$: Observable<Form> = this.editionService.form(participation.editionId); - - // Build an observable of a mapping of questionId to answer. - const answers$: Observable<Map<number, string>> = this.http.get(url).pipe( - map((data: any) => { - const answers: Map<number, string> = new Map(); - data.answers.forEach(item => { - const questionId: number = item.question; - const answer: string = item.answer; - answers.set(questionId, answer); - }); - return answers; - }), - ); - - return forkJoin(editionForm$, answers$).pipe( - map((results: any[]) => { - let form: Form; - let answers: Map<number, string>; - [form, answers] = results; - // Fill in the form with the answers - form.sections.forEach(section => { - section.questions.forEach(question => { - question.answer = answers.get(question.id); - }); - }); - return form; - }) - ) - } -} - - -@Injectable({ - providedIn: 'root' -}) -export class UserPendingParticipationListResolver implements Resolve<Participation[]> { - - constructor(private service: ParticipationService, private auth: AuthService) { } - - resolve() { - const user = this.auth.getUserSnapshot(); - return this.service.pendingForUser(user.id); - } -} - - -@Injectable({ - providedIn: 'root' -}) -export class UserParticipationListResolver implements Resolve<Participation[]> { - - constructor(private service: ParticipationService, private auth: AuthService) { } - - resolve() { - const user = this.auth.getUserSnapshot(); - return this.service.forUser(user.id); - } -} diff --git a/src_/app/members/projects/core/project.model.ts b/src_/app/members/projects/core/project.model.ts deleted file mode 100644 index 1866738f0c4f2924117c38aba436eae92043f947..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/core/project.model.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { IAdapter } from 'app/core'; -import { Edition, EditionSimpleAdapter } from './edition.model'; - - -export class ProjectSchema { - id: number; - name: string; - description: string; - logo: string; - editions: Edition[]; -} - - -export class Project extends ProjectSchema { - - constructor(args: ProjectSchema) { - super(); - Object.assign(this, args); - } -} - - -export class ProjectSimpleAdapter implements IAdapter<Project> { - - adapt(data: any): Project { - return new Project({ - id: data.id, - name: data.name, - description: data.description, - logo: data.logo, - editions: null, - }); - } -} - - -export class ProjectAdapter implements IAdapter<Project> { - - private editionAdapter = new EditionSimpleAdapter(); - - adapt(data: any): Project { - return new Project({ - id: data.id, - name: data.name, - description: data.description, - logo: data.logo, - editions: data.editions.map(item => this.editionAdapter.adapt(item)), - }); - } -} diff --git a/src_/app/members/projects/core/project.service.ts b/src_/app/members/projects/core/project.service.ts deleted file mode 100644 index c72d69a6b66a2782fa0cc053ff4a4d3890ad4fee..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/core/project.service.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { ModelApiService, ObjectListResolver, ObjectResolver } from 'app/core'; -import { Project, ProjectAdapter, ProjectSimpleAdapter } from './project.model'; - - -@Injectable({ - providedIn: 'root' -}) -export class ProjectService extends ModelApiService<Project> { - - baseUrl = this.apiUrl + 'projects/'; - - constructor(public http: HttpClient) { super(); } - - getAdapter(action: string) { - if (action === 'retrieve') { - return new ProjectAdapter(); - } else { - return new ProjectSimpleAdapter(); - } - } -} - - -@Injectable({ - providedIn: 'root' -}) -export class ProjectListResolver extends ObjectListResolver<Project> { - constructor(public service: ProjectService) { super(); } -} - - -@Injectable({ - providedIn: 'root' -}) -export class ProjectResolver extends ObjectResolver<Project> { - routeLookupKey = 'projectId'; - constructor(public service: ProjectService) { super(); } -} diff --git a/src_/app/members/projects/documents-dialog/documents-dialog.component.html b/src_/app/members/projects/documents-dialog/documents-dialog.component.html deleted file mode 100644 index 671895aaa08c9a8a0effbcbcfb3f37d841fa614c..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/documents-dialog/documents-dialog.component.html +++ /dev/null @@ -1,35 +0,0 @@ -<h1 mat-dialog-title> - Documents -</h1> - -<mat-dialog-content> - <div *ngIf="documents.length > 0; else noDocs"> - <p> - Tu trouveras ci-dessous les documents supplémentaires à remplir pour ce projet. - </p> - - <app-documents-recipient [deadline]="deadline" [recipient]="recipient"></app-documents-recipient> - - <mat-divider></mat-divider> - - <mat-nav-list> - <mat-list-item *ngFor="let document of documents"> - <mat-icon matListIcon>get_app</mat-icon> - <a [href]="document.url" download target="_blank" matLine> - {{ document.name }} - </a> - </mat-list-item> - </mat-nav-list> - </div> - <ng-template #noDocs> - <p>Il n'y a pas de documents supplémentaires à remplir pour ce projet.</p> - </ng-template> -</mat-dialog-content> - -<mat-dialog-actions> - <button mat-button matDialogClose>Fermer</button> - <a *ngIf="documents.length > 0" mat-raised-button color="primary" [href]="downloadUrl"> - <mat-icon>archive</mat-icon> - Télécharger au format ZIP - </a> -</mat-dialog-actions> diff --git a/src_/app/members/projects/documents-dialog/documents-dialog.component.scss b/src_/app/members/projects/documents-dialog/documents-dialog.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/members/projects/documents-dialog/documents-dialog.component.ts b/src_/app/members/projects/documents-dialog/documents-dialog.component.ts deleted file mode 100644 index ffec497e0bb86617d92ca24f9d9b12f8316b9e26..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/documents-dialog/documents-dialog.component.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Component, Inject, OnInit } from '@angular/core'; -import { MAT_DIALOG_DATA } from '@angular/material'; -import { File } from 'app/dynamic-forms'; -import { EditionService, Recipient } from '../core'; - -@Component({ - selector: 'app-documents-dialog', - templateUrl: './documents-dialog.component.html', - styleUrls: ['./documents-dialog.component.scss'] -}) -export class DocumentsDialogComponent implements OnInit { - - editionId: number; - documents: File[]; - deadline: Date; - recipient: Recipient; - - constructor( - @Inject(MAT_DIALOG_DATA) private data: any, - private editionService: EditionService, - ) { } - - ngOnInit() { - this.editionId = this.data.editionId; - this.documents = this.data.documents || []; - this.deadline = this.data.deadline; - this.recipient = this.data.recipient; - } - - get downloadUrl(): string { - return this.editionService.getDownloadUrl(this.editionId); - } - -} diff --git a/src_/app/members/projects/documents-recipient/documents-recipient.component.html b/src_/app/members/projects/documents-recipient/documents-recipient.component.html deleted file mode 100644 index ffb659b08c07956e62d5734da0eff506986f053f..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/documents-recipient/documents-recipient.component.html +++ /dev/null @@ -1,12 +0,0 @@ -<p> - Ces documents sont à imprimer et à renvoyer - <strong> - impérativement avant le - {{ deadline | amLocale: 'fr' | amDateFormat: 'LL' }} - </strong> - par voie postale à l'adresse suivante : -</p> -<p> - {{ recipient.user.fullName }} <br /> - {{ recipient.address.toString() }} -</p> diff --git a/src_/app/members/projects/documents-recipient/documents-recipient.component.scss b/src_/app/members/projects/documents-recipient/documents-recipient.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/members/projects/documents-recipient/documents-recipient.component.ts b/src_/app/members/projects/documents-recipient/documents-recipient.component.ts deleted file mode 100644 index fe56bf251c13c64de42b41efe01b3d6d3370e9c2..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/documents-recipient/documents-recipient.component.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { Recipient } from '../core'; - -@Component({ - selector: 'app-documents-recipient', - templateUrl: './documents-recipient.component.html', - styleUrls: ['./documents-recipient.component.scss'] -}) -export class DocumentsRecipientComponent { - - @Input() recipient: Recipient; - @Input() deadline: Date; - -} diff --git a/src_/app/members/projects/edition-contact-dialog/edition-contact-dialog.component.html b/src_/app/members/projects/edition-contact-dialog/edition-contact-dialog.component.html deleted file mode 100644 index 772df9b31dabfddbc5b113085af4fef35f8dfa23..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/edition-contact-dialog/edition-contact-dialog.component.html +++ /dev/null @@ -1,9 +0,0 @@ -<h1 mat-dialog-title>Contact</h1> - -<mat-dialog-content> - <app-edition-contact [edition]="edition"></app-edition-contact> -</mat-dialog-content> - -<mat-dialog-actions> - <button mat-button matDialogClose>Fermer</button> -</mat-dialog-actions> diff --git a/src_/app/members/projects/edition-contact-dialog/edition-contact-dialog.component.scss b/src_/app/members/projects/edition-contact-dialog/edition-contact-dialog.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/members/projects/edition-contact-dialog/edition-contact-dialog.component.ts b/src_/app/members/projects/edition-contact-dialog/edition-contact-dialog.component.ts deleted file mode 100644 index 3353f5e9746f40d74642f959a391a046c5162277..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/edition-contact-dialog/edition-contact-dialog.component.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Component, Inject, OnInit } from '@angular/core'; -import { MAT_DIALOG_DATA } from '@angular/material'; -import { Edition } from '../core'; - -@Component({ - selector: 'app-edition-contact-dialog', - templateUrl: './edition-contact-dialog.component.html', - styleUrls: ['./edition-contact-dialog.component.scss'] -}) -export class EditionContactDialogComponent implements OnInit { - - edition: Edition; - - constructor(@Inject(MAT_DIALOG_DATA) private data: any) { } - - ngOnInit() { - this.edition = this.data.edition; - } - -} diff --git a/src_/app/members/projects/edition-contact/edition-contact.component.html b/src_/app/members/projects/edition-contact/edition-contact.component.html deleted file mode 100644 index ce902d536241f91460e82475a9c2d4d09c46a925..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/edition-contact/edition-contact.component.html +++ /dev/null @@ -1,39 +0,0 @@ -<ng-template [ngIf]="edition"> - En cas de questions concernant {{ edition.project }} ou le processus d'inscription, tu peux - <span [ngSwitch]="edition.organizers.length"> - <span *ngSwitchCase="0"> - <app-mailto [subject]="'Questions à propos de ' + edition.project + ' édition ' + edition.year">nous contacter</app-mailto>. - </span> - <span *ngSwitchDefault>contacter les organisateurs :</span> - </span> - - <div class="organizers" *ngIf="edition.organizers"> - - <mat-card *ngFor="let organizer of edition.organizers" class="organizer"> - <!-- Header: name and role --> - <mat-card-header> - <mat-card-title> - {{ organizer.user.fullName }} - </mat-card-title> - <mat-card-subtitle *ngIf="organizer.role"> - {{ organizer.role }} - </mat-card-subtitle> - </mat-card-header> - <!-- Content: contact means --> - <mat-card-content> - <mat-list dense> - <mat-list-item *ngIf="organizer.user.email"> - <mat-icon matListIcon>mail_outline</mat-icon> - {{ organizer.user.email }} - </mat-list-item> - <mat-list-item *ngIf="organizer.user.phoneNumber"> - <mat-icon matListIcon>phone</mat-icon> - {{ organizer.user.phoneNumber }} - </mat-list-item> - </mat-list> - </mat-card-content> - </mat-card> - - </div> - -</ng-template> diff --git a/src_/app/members/projects/edition-contact/edition-contact.component.scss b/src_/app/members/projects/edition-contact/edition-contact.component.scss deleted file mode 100644 index dde0d6932854e6737e0f35ea06de2330127b54e8..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/edition-contact/edition-contact.component.scss +++ /dev/null @@ -1,8 +0,0 @@ -.organizers { - display: flex; - margin: 1em 0; - .organizer { - width: fit-content; - margin: auto; - } -} diff --git a/src_/app/members/projects/edition-contact/edition-contact.component.ts b/src_/app/members/projects/edition-contact/edition-contact.component.ts deleted file mode 100644 index cf984b9f96d80a6c423c4385f9c4723a9d82f979..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/edition-contact/edition-contact.component.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { Edition } from '../core'; - -@Component({ - selector: 'app-edition-contact', - templateUrl: './edition-contact.component.html', - styleUrls: ['./edition-contact.component.scss'] -}) -export class EditionContactComponent { - - @Input() edition: Edition; - -} diff --git a/src_/app/members/projects/my-participations/my-participations.component.html b/src_/app/members/projects/my-participations/my-participations.component.html deleted file mode 100644 index e3582fd1e613149ebbd8833b02d54d92efd71bd1..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/my-participations/my-participations.component.html +++ /dev/null @@ -1,48 +0,0 @@ -<div class="container"> - <h1>Mes inscriptions</h1> - - <p> - <a routerLink="../inscription">M'inscrire à un projet</a> - </p> - - <mat-list role="list"> - <mat-list-item role="listitem" *ngFor="let participation of participations"> - <p matLine class="clickable" (click)="openAnswers(participation)"> - {{ participation.editionFormTitle }} - </p> - <p class="text-muted" matLine> - Soumis le {{ participation.submitted | amLocale: 'fr' | amDateFormat: 'LL' }} à {{ participation.submitted | amLocale: 'fr' | amDateFormat: 'HH:mm' }} - </p> - <app-participation-state matLine [state]="participation.state"></app-participation-state> - <button mat-icon-button [matMenuTriggerFor]="more"> - <mat-icon>more_vert</mat-icon> - </button> - <mat-menu #more="matMenu"> - <button mat-menu-item (click)="openAnswers(participation)" *ngIf="canViewAnswers(participation)"> - <mat-icon>notes</mat-icon> - Mon dossier - </button> - <button mat-menu-item (click)="openDocuments(participation)" *ngIf="canViewDocuments(participation)"> - <mat-icon>attach_file</mat-icon> - Documents - </button> - <button mat-menu-item (click)="openContact(participation)" *ngIf="canViewContact(participation)"> - <mat-icon>dialpad</mat-icon> - Contact - </button> - <button mat-menu-item (click)="openUnregister(participation)" *ngIf="canViewCancel(participation)"> - <mat-icon>cancel</mat-icon> - Annuler - </button> - <button mat-menu-item (click)="openActivate(participation)" *ngIf="canViewActivate(participation)"> - <mat-icon>send</mat-icon> - Renvoyer - </button> - <button mat-menu-item (click)="openDelete(participation)" *ngIf="canViewDelete(participation)"> - <mat-icon>delete</mat-icon> - Supprimer - </button> - </mat-menu> - </mat-list-item> - </mat-list> -</div> diff --git a/src_/app/members/projects/my-participations/my-participations.component.scss b/src_/app/members/projects/my-participations/my-participations.component.scss deleted file mode 100644 index d871f7d71196f78b088aa9ce9756d2eab2b2809d..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/my-participations/my-participations.component.scss +++ /dev/null @@ -1,5 +0,0 @@ -.container { - max-width: 40em; - margin: auto; - padding: 0 2em; -} diff --git a/src_/app/members/projects/my-participations/my-participations.component.ts b/src_/app/members/projects/my-participations/my-participations.component.ts deleted file mode 100644 index ea90842718030352e58cea11ee40e54681e7cb76..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/my-participations/my-participations.component.ts +++ /dev/null @@ -1,160 +0,0 @@ -import { Component, OnInit, OnDestroy } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { MatDialog, MatSnackBar } from '@angular/material'; -import { Subscription } from 'rxjs'; -import { filter, mergeMap, tap, map } from 'rxjs/operators'; -import { AnswersDialogComponent } from '../answers-dialog/answers-dialog.component'; -import { DocumentsDialogComponent } from '../documents-dialog/documents-dialog.component'; -import { EditionContactDialogComponent } from '../edition-contact-dialog/edition-contact-dialog.component'; -import { UnregisterDialogComponent } from '../unregister-dialog/unregister-dialog.component'; -import { ActivateDialogComponent } from '../activate-dialog/activate-dialog.component'; -import { Participation, ParticipationService, EditionService, ParticipationState } from '../core'; - -@Component({ - selector: 'app-my-participations', - templateUrl: './my-participations.component.html', - styleUrls: ['./my-participations.component.scss'] -}) -export class MyParticipationsComponent implements OnInit, OnDestroy { - - participations: Participation[]; - sub = new Subscription(); - - PENDING = ParticipationState.PENDING; - VALID = ParticipationState.VALID; - ACCEPTED = ParticipationState.ACCEPTED; - REJECTED = ParticipationState.REJECTED; - CANCELLED = ParticipationState.CANCELLED; - - constructor( - private route: ActivatedRoute, - private dialog: MatDialog, - private participationService: ParticipationService, - private editionService: EditionService, - private snackBar: MatSnackBar, - ) { } - - ngOnInit() { - this.participations = this.route.snapshot.data['participations']; - } - - openAnswers(participation: Participation) { - this.participationService.entry(participation).subscribe( - form => this.dialog.open(AnswersDialogComponent, { - data: { form }, - }) - ); - } - - openDocuments(participation: Participation) { - this.editionService.documents(participation.editionId).subscribe( - result => { - this.dialog.open(DocumentsDialogComponent, { - data: { - editionId: participation.editionId, - documents: result.documents, - deadline: result.deadline, - recipient: result.recipient, - }, - }); - } - ); - } - - openContact(participation: Participation) { - this.editionService.retrieve(participation.editionId).subscribe( - edition => this.dialog.open(EditionContactDialogComponent, { - data: { edition }, - }) - ); - } - - openUnregister(participation: Participation) { - this.editionService.retrieve(participation.editionId).subscribe( - edition => { - const dialogRef = this.dialog.open(UnregisterDialogComponent, { - data: { edition, delete: false }, - }); - const sub = dialogRef.afterClosed().pipe( - // Only if user has confirmed - filter(result => result), - // Delete the participation - mergeMap(() => this.participationService.cancel(participation.id)), - // Update the participation's state - tap(() => participation.state = ParticipationState.CANCELLED), - // Open a confirmation snackbar - map(() => `Tu as annulé ta participation à ${edition.project} ${edition.year}.`), - tap((message) => this.snackBar.open(message, 'OK', { duration: 4000 })), - ).subscribe(); - this.sub.add(sub); - } - ); - } - - openActivate(participation: Participation) { - this.editionService.retrieve(participation.editionId).subscribe( - edition => { - const dialogRef = this.dialog.open(ActivateDialogComponent, { data: { edition }}); - const sub = dialogRef.afterClosed().pipe( - filter(result => result), - mergeMap(() => this.participationService.reactivate(participation.id)), - tap(() => participation.state = ParticipationState.PENDING), - map(() => `Ton inscription à ${edition.project} ${edition.year} a été renvoyée.`), - tap(message => this.snackBar.open(message, 'OK', { duration: 4000 })), - ).subscribe(); - this.sub.add(sub); - } - ); - } - - openDelete(participation: Participation) { - this.editionService.retrieve(participation.editionId).subscribe( - edition => { - const dialogRef = this.dialog.open(UnregisterDialogComponent, { - data: { edition, delete: true }, - }); - const sub = dialogRef.afterClosed().pipe( - // Only if user has confirmed - filter(result => result), - // Delete the participation - mergeMap(() => this.participationService.destroy(participation.id)), - // Remove the participation from the participations list - tap(() => this.participations.splice(this.participations.indexOf(participation), 1)), - // Open a confirmation snackbar - map(() => `Tu t'es désinscrit de ${edition.project} ${edition.year}.`), - tap((message) => this.snackBar.open(message, 'OK', { duration: 4000 })), - ).subscribe(); - this.sub.add(sub); - } - ); - } - - canViewAnswers(p: Participation): boolean { - return true; - } - - canViewDocuments(p: Participation): boolean { - return p.state !== ParticipationState.CANCELLED; - } - - canViewContact(p: Participation): boolean { - return true; - } - - canViewCancel(p: Participation): boolean { - return p.state !== ParticipationState.CANCELLED; - } - - canViewActivate(p: Participation): boolean { - return p.state === ParticipationState.CANCELLED; - } - - canViewDelete(p: Participation): boolean { - return true; - } - - ngOnDestroy() { - this.sub.unsubscribe(); - } - -} diff --git a/src_/app/members/projects/navbar/navbar.component.html b/src_/app/members/projects/navbar/navbar.component.html deleted file mode 100644 index b3631862081fd201d66c77dbe3d4beb9a70988f4..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/navbar/navbar.component.html +++ /dev/null @@ -1,3 +0,0 @@ -<nav class="container"> - <app-nav-group [links]="links"></app-nav-group> -</nav> diff --git a/src_/app/members/projects/navbar/navbar.component.scss b/src_/app/members/projects/navbar/navbar.component.scss deleted file mode 100644 index 26d41779c790eb6138f6df6f313c524e934e5eb5..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/navbar/navbar.component.scss +++ /dev/null @@ -1,4 +0,0 @@ -.container { - width: fit-content; - margin: auto; -} \ No newline at end of file diff --git a/src_/app/members/projects/navbar/navbar.component.ts b/src_/app/members/projects/navbar/navbar.component.ts deleted file mode 100644 index e900c39cf742c79fccf8d33d846d9e72b1040bb1..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/navbar/navbar.component.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { Link } from 'app/shared'; - -@Component({ - selector: 'projects-navbar', - templateUrl: './navbar.component.html', - styleUrls: ['./navbar.component.scss'] -}) -export class NavbarComponent implements OnInit { - - constructor() { } - - links: Link[] = [ - { - href: './', - text: 'Aperçu', - }, - { - href: './inscription', - text: "M'inscrire à un projet", - }, - { - href: './mes-inscriptions', - text: 'Mes inscriptions', - } - ] - - ngOnInit() { - } - -} diff --git a/src_/app/members/projects/overview/index.ts b/src_/app/members/projects/overview/index.ts deleted file mode 100644 index 02e9a1c014a4a9e7ca53eeb141cbf26d4c2c5068..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/overview/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './my-participations-overview/my-participations-overview.component'; -export * from './open-registrations/open-registrations.component'; -export * from './overview.component'; diff --git a/src_/app/members/projects/overview/my-participations-overview/my-participations-overview.component.html b/src_/app/members/projects/overview/my-participations-overview/my-participations-overview.component.html deleted file mode 100644 index ba6fb0bc2774ec912fd61a1c9dd31edf22933b62..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/overview/my-participations-overview/my-participations-overview.component.html +++ /dev/null @@ -1,30 +0,0 @@ -<div class="container"> - <h2 id="title">Mes inscriptions</h2> - <a routerLink="./mes-inscriptions">Gérer mes inscriptions</a> - - <p> - {{ participations.length }} - <span [ngPlural]="participations.length"> - <ng-template ngPluralCase="=1">inscription</ng-template> - <ng-template ngPluralCase="other">inscriptions</ng-template> - </span> - en attente - </p> - - <div *ngFor="let participation of participations" class="row"> - <p> - <a routerLink="mes-inscriptions" class="no-color"> - {{ participation.editionFormTitle }} - </a> - </p> - <p class="text-muted"> - <strong>{{ participation.status }}</strong> - </p> - <p class="text-muted"> - Soumis le - {{ participation.submitted | amLocale: 'fr' | amDateFormat: 'LL' }} - à {{ participation.submitted | amLocale: 'fr' | amDateFormat: 'HH:mm' }} - </p> - </div> - -</div> diff --git a/src_/app/members/projects/overview/my-participations-overview/my-participations-overview.component.scss b/src_/app/members/projects/overview/my-participations-overview/my-participations-overview.component.scss deleted file mode 100644 index 4e04abdb5c9866b64ab1efc0ad12a17e7f1df2dc..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/overview/my-participations-overview/my-participations-overview.component.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '~sass/variables'; - - -#title { - margin: 0; - padding: 0; -} - - -.row { - padding-bottom: .5em; - p { - margin: 0; - padding: 0; - } -} diff --git a/src_/app/members/projects/overview/my-participations-overview/my-participations-overview.component.ts b/src_/app/members/projects/overview/my-participations-overview/my-participations-overview.component.ts deleted file mode 100644 index d3a109f3540ecc1ed98cd9aafcc756dfd0dc5332..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/overview/my-participations-overview/my-participations-overview.component.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { Participation } from '../../core'; - -@Component({ - selector: 'app-my-participations-overview', - templateUrl: './my-participations-overview.component.html', - styleUrls: ['./my-participations-overview.component.scss'] -}) -export class MyParticipationsOverviewComponent { - - @Input() participations: Participation[]; - -} diff --git a/src_/app/members/projects/overview/open-registrations/open-registrations.component.html b/src_/app/members/projects/overview/open-registrations/open-registrations.component.html deleted file mode 100644 index 37202b6d0b6fe8a84c94ee42dc883fb182aa750c..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/overview/open-registrations/open-registrations.component.html +++ /dev/null @@ -1,30 +0,0 @@ -<div class="container"> - <h2 id="title">Inscriptions ouvertes</h2> - <a routerLink="./inscription">M'inscrire à un projet</a> - - <p> - {{ editions.length }} - <span [ngPlural]="editions.length"> - <ng-template ngPluralCase="=1">projet ouvert</ng-template> - <ng-template ngPluralCase="other">projets ouverts</ng-template> - </span> - à l'inscription - </p> - - <div role="list" id="editions"> - <div role="listitem" *ngFor="let edition of editions"> - <p> - <a routerLink="inscription" class="no-color"> - {{ edition.editionForm.title }} - </a> - </p> - <p class="text-muted"> - Avant le {{ edition.editionForm.deadline | amLocale: 'fr' | amDateFormat: 'LL' }} • - <strong> - {{ edition.editionForm.deadline | amLocale: 'fr' | amDifference: today: 'days' }} jours restants - </strong> - </p> - </div> - </div> - -</div> diff --git a/src_/app/members/projects/overview/open-registrations/open-registrations.component.scss b/src_/app/members/projects/overview/open-registrations/open-registrations.component.scss deleted file mode 100644 index aabdf940cbf5ed2d99165d7fe337f21df2b50ea4..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/overview/open-registrations/open-registrations.component.scss +++ /dev/null @@ -1,23 +0,0 @@ -@import '~sass/variables'; - -.container { - .text-muted { - color: $color-purple-light; - } -} - -#title { - margin: 0; - padding: 0; -} - -#editions { - display: grid; - grid-template-columns: 1fr; - grid-gap: 1em; - p { - margin: 0; - padding: 0; - - } -} diff --git a/src_/app/members/projects/overview/open-registrations/open-registrations.component.ts b/src_/app/members/projects/overview/open-registrations/open-registrations.component.ts deleted file mode 100644 index 66541526e4fc22a604fcec1aca62517b15cafa6b..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/overview/open-registrations/open-registrations.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { Edition } from '../../core'; - - -@Component({ - selector: 'app-open-registrations', - templateUrl: './open-registrations.component.html', - styleUrls: ['./open-registrations.component.scss'] -}) -export class OpenRegistrationsComponent { - - @Input() editions: Edition[]; - today = new Date(); - -} diff --git a/src_/app/members/projects/overview/overview.component.html b/src_/app/members/projects/overview/overview.component.html deleted file mode 100644 index 7a1503b741a05a63393ba75c8d7fd50a015c09de..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/overview/overview.component.html +++ /dev/null @@ -1,12 +0,0 @@ -<div id="page"> -<!--app-two-panes> - <app-pane id="open-registrations"> - <app-open-registrations [editions]="editions"></app-open-registrations> - </app-pane> - <app-pane id="my-participations"> - <app-my-participations-overview [participations]="participations"></app-my-participations-overview> - </app-pane> -</app-two-panes--> - <h2>On y travaille…</h2> - <p>Nos tuteurs t'informeront lors des premières inscriptions aux projets !</p> -</div> diff --git a/src_/app/members/projects/overview/overview.component.scss b/src_/app/members/projects/overview/overview.component.scss deleted file mode 100644 index 1fe80a21edceac227f4c8250e2d35442b47a1b8e..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/overview/overview.component.scss +++ /dev/null @@ -1,14 +0,0 @@ -@import '~sass/variables'; -@import '~app/showcase-site/sass/mixins'; - -#open-registrations { - background: $color-light-blue; -} - -#my-participations { - background: $color-purple-lighter; -} - -#page { - @include margin-page; -} \ No newline at end of file diff --git a/src_/app/members/projects/overview/overview.component.ts b/src_/app/members/projects/overview/overview.component.ts deleted file mode 100644 index 683f1ef02b282b472b563a0dd88a1c09cf746243..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/overview/overview.component.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { Edition, Participation } from '../core'; - -@Component({ - selector: 'app-overview', - templateUrl: './overview.component.html', - styleUrls: ['./overview.component.scss'] -}) -export class OverviewComponent implements OnInit { - - editions: Edition[]; - participations: Participation[]; - - constructor(private route: ActivatedRoute) { } - - ngOnInit() { - this.editions = this.route.snapshot.data['editions']; - this.participations = this.route.snapshot.data['participations']; - } - -} diff --git a/src_/app/members/projects/participation-state/participation-state.component.html b/src_/app/members/projects/participation-state/participation-state.component.html deleted file mode 100644 index e0ce03979a440878d977f1aac8002517817f55b2..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/participation-state/participation-state.component.html +++ /dev/null @@ -1,28 +0,0 @@ -<span [ngSwitch]="state" id="state"> - - <label *ngSwitchCase="PENDING" matTooltip="Nous vérifions ton dossier. Pense à envoyer les documents justificatifs !"> - <mat-icon>access_time</mat-icon> - <p>En attente</p> - </label> - - <label *ngSwitchCase="VALID" matTooltip="Ton dossier est complet. Nous te confirmerons bientôt ta participation."> - <mat-icon class="text-success">check_circle</mat-icon> - <p>Dossier complet</p> - </label> - - <label *ngSwitchCase="ACCEPTED" matTooltip="Bravo, tu participes à ce projet !"> - <mat-icon class="text-success">thumb_up</mat-icon> - <p>Accepté</p> - </label> - - <label *ngSwitchCase="REJECTED" matTooltip="Par manque de places, tu ne pourras malheureusement pas participer à ce projet."> - <mat-icon>thumb_down</mat-icon> - <p>Refusé</p> - </label> - - <label *ngSwitchCase="CANCELLED" matTooltip="Tu as annulé ta participation à ce projet."> - <mat-icon>cancel</mat-icon> - <p>Annulé</p> - </label> - -</span> diff --git a/src_/app/members/projects/participation-state/participation-state.component.scss b/src_/app/members/projects/participation-state/participation-state.component.scss deleted file mode 100644 index a2cf931c44cb0bfdf218c066aa3926587d47607f..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/participation-state/participation-state.component.scss +++ /dev/null @@ -1,13 +0,0 @@ -#state { - label { - display: flex; - flex-flow: row wrap; - align-items: center; - width: fit-content; - p { - margin: 0; - padding: 0; - margin-left: .3em; - } - } -} diff --git a/src_/app/members/projects/participation-state/participation-state.component.ts b/src_/app/members/projects/participation-state/participation-state.component.ts deleted file mode 100644 index 5eaea80881ad053bef2ea110895821b1c1ca26d7..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/participation-state/participation-state.component.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { ParticipationState } from '../core'; - -@Component({ - selector: 'app-participation-state', - templateUrl: './participation-state.component.html', - styleUrls: ['./participation-state.component.scss'] -}) -export class ParticipationStateComponent { - - PENDING = ParticipationState.PENDING; - VALID = ParticipationState.VALID; - ACCEPTED = ParticipationState.ACCEPTED; - REJECTED = ParticipationState.REJECTED; - CANCELLED = ParticipationState.CANCELLED; - - @Input() state: ParticipationState; - -} diff --git a/src_/app/members/projects/project-detail/project-detail.component.html b/src_/app/members/projects/project-detail/project-detail.component.html deleted file mode 100644 index 42dca7c0c4efe7023eb93a78a0b8a269ad4f8eb8..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/project-detail/project-detail.component.html +++ /dev/null @@ -1,34 +0,0 @@ -<a [routerLink]="['../']">Retour</a> - -<h1>{{ project.name }}</h1> - -<div *ngIf="project.logo"> - <img [src]="project.logo" [alt]="project.name"> -</div> - -<p>{{ project.description }}</p> - -<h2>Éditions</h2> - -<ul> - <li *ngFor="let edition of project.editions"> - <h3>{{ edition.fullTitle(project) }}</h3> - <div *ngIf="edition.editionForm; else noForm"> - <div *ngIf="edition.editionForm.open; else tooLate"> - <p> - Inscriptions ouvertes jusqu'au - <strong> - {{ edition.editionForm.deadline | amLocale:'fr' | amCalendar }}. - </strong> - </p> - <a mat-raised-button color="accent" [routerLink]="['./' + edition.id + '/inscription']">S'inscrire</a> - </div> - <ng-template #tooLate> - <p>Les inscriptions à ce projet sont fermées.</p> - </ng-template> - </div> - <ng-template #noForm> - <p>Le dossier d'inscription sera bientôt disponible.</p> - </ng-template> - </li> -</ul> diff --git a/src_/app/members/projects/project-detail/project-detail.component.scss b/src_/app/members/projects/project-detail/project-detail.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/members/projects/project-detail/project-detail.component.ts b/src_/app/members/projects/project-detail/project-detail.component.ts deleted file mode 100644 index 29bb3e8706bc82807fd0a841843148a7f0ef5d2f..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/project-detail/project-detail.component.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { Project } from '../core'; - -@Component({ - selector: 'app-project-detail', - templateUrl: './project-detail.component.html', - styleUrls: ['./project-detail.component.scss'] -}) -export class ProjectDetailComponent implements OnInit { - - project: Project; - - constructor(private route: ActivatedRoute) { } - - ngOnInit() { - this.project = this.route.snapshot.data['project']; - } - -} diff --git a/src_/app/members/projects/project-list/project-list.component.html b/src_/app/members/projects/project-list/project-list.component.html deleted file mode 100644 index 84f9c459e0470597fac879e68f447230627ffd55..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/project-list/project-list.component.html +++ /dev/null @@ -1,5 +0,0 @@ -<ul> - <li *ngFor="let project of projects"> - <a [routerLink]="[project.id]">{{ project.name }}</a> - </li> -</ul> diff --git a/src_/app/members/projects/project-list/project-list.component.scss b/src_/app/members/projects/project-list/project-list.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/members/projects/project-list/project-list.component.ts b/src_/app/members/projects/project-list/project-list.component.ts deleted file mode 100644 index dea29d9df953e49733b4be6877bde59c68e6d4d1..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/project-list/project-list.component.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { Project } from '../core'; - -@Component({ - selector: 'app-project-list', - templateUrl: './project-list.component.html', - styleUrls: ['./project-list.component.scss'] -}) -export class ProjectListComponent implements OnInit { - - projects: Project[]; - - constructor(private route: ActivatedRoute) { } - - ngOnInit() { - this.projects = this.route.snapshot.data['projects']; - } - -} diff --git a/src_/app/members/projects/projects-routing.module.ts b/src_/app/members/projects/projects-routing.module.ts deleted file mode 100644 index 1f03a2efd8085f9f899ee506579b57967b0134ec..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/projects-routing.module.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; -import { ProjectsComponent } from './projects.component'; -import { ProjectDetailComponent } from './project-detail/project-detail.component'; -import { RegisterWizardComponent } from './register-wizard/register-wizard.component'; -import { OverviewComponent } from './overview/overview.component'; -import { MyParticipationsComponent } from './my-participations/my-participations.component'; -import { - ProjectResolver, ProjectListResolver, - EditionOpenRegistrationListResolver, - UserPendingParticipationListResolver, - UserParticipationListResolver, -} from './core'; - -const routes: Routes = [ - { - path: '', - component: ProjectsComponent, - children: [ - { - path: '', - component: OverviewComponent, - resolve: { - projects: ProjectListResolver, - editions: EditionOpenRegistrationListResolver, - participations: UserPendingParticipationListResolver, - }, - },/* - { - path: 'inscription', - component: RegisterWizardComponent, - resolve: { editions: EditionOpenRegistrationListResolver }, - }, - { - path: 'mes-inscriptions', - component: MyParticipationsComponent, - resolve: { participations: UserParticipationListResolver }, - }, - { - path: ':projectId', - component: ProjectDetailComponent, - resolve: { project: ProjectResolver }, - },*/ - ] - }, -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class ProjectsRoutingModule { } diff --git a/src_/app/members/projects/projects.component.html b/src_/app/members/projects/projects.component.html deleted file mode 100644 index c4bc3d7bb19aedf0292fccbbfe49063b7e4cc69c..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/projects.component.html +++ /dev/null @@ -1,5 +0,0 @@ -<div class="material-theme"> - <h1 class="text-center">Projets</h1> - <!--projects-navbar layout="row" layout-align="center center"></projects-navbar--> - <router-outlet></router-outlet> -</div> diff --git a/src_/app/members/projects/projects.component.scss b/src_/app/members/projects/projects.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/members/projects/projects.component.ts b/src_/app/members/projects/projects.component.ts deleted file mode 100644 index 8c617379ce7c70f7c4f62a3a4626a47316423c3c..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/projects.component.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-projects', - templateUrl: './projects.component.html', - styleUrls: ['./projects.component.scss'] -}) -export class ProjectsComponent { } diff --git a/src_/app/members/projects/projects.module.ts b/src_/app/members/projects/projects.module.ts deleted file mode 100644 index c0bbd6bedf3043c6ab20b06309788d6efe2bd815..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/projects.module.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; - -import { - MatButtonModule, - MatSnackBarModule, - MatCardModule, - MatStepperModule, - MatInputModule, - MatFormFieldModule, - MatAutocompleteModule, - MatSelectModule, - MatCheckboxModule, - MatDialogModule, - MatExpansionModule, - MatIconModule, - MatListModule, - MatMenuModule, - MatDividerModule, - MatTooltipModule, -} from '@angular/material'; - -import { MomentModule } from 'ngx-moment'; - -import { SharedModule } from 'app/shared'; -import { DynamicFormsModule } from 'app/dynamic-forms'; -import { PanesModule } from 'app/panes'; - -import { ProjectsRoutingModule } from './projects-routing.module'; -import { ProjectsComponent } from './projects.component'; -import { ProjectListComponent } from './project-list/project-list.component'; -import { ProjectDetailComponent } from './project-detail/project-detail.component'; -import { OverviewComponent, OpenRegistrationsComponent, MyParticipationsOverviewComponent } from './overview'; -import { RegisterWizardComponent } from './register-wizard/register-wizard.component'; -import { MyParticipationsComponent } from './my-participations/my-participations.component'; -import { NavbarComponent } from './navbar/navbar.component'; -import { ParticipationStateComponent } from './participation-state/participation-state.component'; -import { AnswersDialogComponent } from './answers-dialog/answers-dialog.component'; -import { DocumentsDialogComponent } from './documents-dialog/documents-dialog.component'; -import { DocumentsRecipientComponent } from './documents-recipient/documents-recipient.component'; -import { EditionContactComponent } from './edition-contact/edition-contact.component'; -import { EditionContactDialogComponent } from './edition-contact-dialog/edition-contact-dialog.component'; -import { UnregisterDialogComponent } from './unregister-dialog/unregister-dialog.component'; -import { ActivateDialogComponent } from './activate-dialog/activate-dialog.component'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - ReactiveFormsModule, - // Third party - MomentModule, - // Angular Material - MatButtonModule, - MatSnackBarModule, - MatCardModule, - MatStepperModule, - MatInputModule, - MatAutocompleteModule, - MatFormFieldModule, - MatSelectModule, - MatCheckboxModule, - MatDialogModule, - MatExpansionModule, - MatIconModule, - MatListModule, - MatMenuModule, - MatDividerModule, - MatTooltipModule, - // App modules - SharedModule, - ProjectsRoutingModule, - PanesModule, - DynamicFormsModule, - ], - declarations: [ - ProjectsComponent, - NavbarComponent, - ProjectListComponent, - ProjectDetailComponent, - OverviewComponent, - OpenRegistrationsComponent, - MyParticipationsComponent, - RegisterWizardComponent, - MyParticipationsOverviewComponent, - ParticipationStateComponent, - AnswersDialogComponent, - DocumentsDialogComponent, - DocumentsRecipientComponent, - EditionContactComponent, - EditionContactDialogComponent, - UnregisterDialogComponent, - ActivateDialogComponent, - ], - entryComponents: [ - AnswersDialogComponent, - DocumentsDialogComponent, - EditionContactDialogComponent, - UnregisterDialogComponent, - ActivateDialogComponent, - ], -}) -export class ProjectsModule { } diff --git a/src_/app/members/projects/register-wizard/register-wizard.component.html b/src_/app/members/projects/register-wizard/register-wizard.component.html deleted file mode 100644 index f65e56b5e260473a293fcbbb07fad2e8a7447fc4..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/register-wizard/register-wizard.component.html +++ /dev/null @@ -1,166 +0,0 @@ -<!-- Step-by-step wizard provided by Angular Material --> -<mat-horizontal-stepper linear="true" #stepper id="stepper" (selectionChange)="onChangeStep($event)"> - - <!-- Select project --> - <mat-step [stepControl]="formGroup.controls.project" label="Sélection du projet"> - <h3>À quel projet souhaites-tu t'inscrire ?</h3> - <form [formGroup]="formGroup.controls.project"> - <mat-form-field> - <mat-select placeholder="Projet" formControlName="editionId" required> - <mat-option *ngFor="let edition of editions" [value]="edition.id"> - {{ edition.project }} {{ edition.year }} - </mat-option> - </mat-select> - </mat-form-field> - <section> - <button mat-button color="primary" [disabled]="!formGroup.controls.project.valid" matStepperNext>Suivant</button> - </section> - </form> - </mat-step> - - <!-- Fill in the project's form --> - <mat-step [stepControl]="editionForm.formGroup" label="Remplissage du formulaire"> - <dynamic-form #editionForm (submitted)="onEditionFormSubmitted()" [submitButton]="false"></dynamic-form> - <section class="nav-buttons" *ngIf="editionForm.formGroup"> - <button mat-button matStepperPrevious>Précédent</button> - <button mat-button color="primary" [disabled]="!editionForm.formGroup.valid" matStepperNext>Suivant</button> - </section> - </mat-step> - - <!-- - Allow to download edition-specific attachments - that student needs to send back via post - --> - <mat-step label="Documents"> - <h3>Documents</h3> - - <form *ngIf="edition && edition.editionForm.form.files.length > 0; else noFiles"> - <p>Tu peux maintenant télécharger les documents papiers.</p> - - <!-- Deadline and address where documents need to be sent --> - <app-documents-recipient [deadline]="edition.editionForm.deadline" [recipient]="edition.editionForm.recipient"></app-documents-recipient> - - <!-- List of downloable files --> - <mat-nav-list> - <mat-list-item *ngFor="let document of edition.editionForm.form.files"> - <mat-icon matListIcon>get_app</mat-icon> - <a [href]="document.url" download target="_blank" matLine> - {{ document.name }} - </a> - </mat-list-item> - </mat-nav-list> - <p> - <a mat-raised-button [href]="downloadUrl"> - <mat-icon>archive</mat-icon> - Télécharger au format ZIP - </a> - </p> - <p class="text-muted"> - Tu pourras retrouver ces documents plus tard dans la section "Mes inscriptions". - </p> - </form> - - <ng-template #noFiles> - <p>Il n'y a pas de documents supplémentaires à remplir pour ce projet.</p> - <p>Tu peux passer à l'étape suivante.</p> - </ng-template> - - <section class="nav-buttons"> - <button mat-button matStepperPrevious>Précédent</button> - <button mat-button matStepperNext color="primary">Suivant</button> - </section> - </mat-step> - - <!-- Recap --> - <mat-step label="Récapitulatif"> - <h3>Récapitulatif</h3> - <p> - Vérifie tes réponses ci-dessous. - Si tout est correct, clique sur "Confirmer mon inscription" pour envoyer - le formulaire. - </p> - <!-- Show a read-only version of the form --> - <mat-card id="form-entry"> - <app-form-entry [form]="form"></app-form-entry> - </mat-card> - <section class="nav-buttons"> - <button mat-button matStepperPrevious>Précédent</button> - <button mat-raised-button color="primary" (click)="register()" type="button"> - Confirmer mon inscription - <app-load-spinner *ngIf="loading" [block]="false"></app-load-spinner> - </button> - </section> - </mat-step> - - <!-- Done --> - <mat-step label="Terminé"> - <div *ngIf="edition"> - <h1> - Merci de t'être inscrit à {{ edition.project }} ! - </h1> - - <p> - Ta demande d'inscription pour l'édition {{ edition.year }} de <strong>{{ edition.project }}</strong> a bien été envoyée. - </p> - - <p> - <a mat-raised-button routerLink="/projets"> - Retour aux projets - </a> - </p> - - <h2>Prochaines étapes</h2> - - <mat-accordion> - - <mat-expansion-panel> - <mat-expansion-panel-header> - <mat-panel-title> - J'envoie mes documents justificatifs - </mat-panel-title> - <mat-panel-description> - Avant le {{ edition.deadline | amLocale: 'fr' | amDateFormat: 'LL' }} - </mat-panel-description> - </mat-expansion-panel-header> - <p> - En cas de besoin, tu peux télécharger à nouveau ces documents dans la section <a routerLink="/projets/mes-inscriptions">Mes inscriptions</a>. - </p> - </mat-expansion-panel> - - <mat-expansion-panel> - <mat-expansion-panel-header> - <mat-panel-title> - Les tuteurs valident mon dossier - </mat-panel-title> - <mat-panel-description> - Avant le {{ edition.deadline | amLocale: 'fr' | amDateFormat: 'LL' }} - </mat-panel-description> - </mat-expansion-panel-header> - <p> - Une fois tous les documents justificatifs reçus, les tuteurs valideront ton dossier et tu recevras un email t'indiquant que celui-ci est complet. - </p> - </mat-expansion-panel> - <mat-expansion-panel> - <mat-expansion-panel-header> - <mat-panel-title> - Les tuteurs confirment ma participation - </mat-panel-title> - <mat-panel-description> - À partir du {{ edition.deadline | amLocale: 'fr' | amDateFormat: 'LL' }} - </mat-panel-description> - </mat-expansion-panel-header> - <p> - Les tuteurs étudieront chaque demande d'inscription et établiront la liste des inscrits. Tu recevras un email confirmant ta participation à {{ edition.project }}. - </p> - <p> - Si tu n'as pas été retenu pour participer à {{ edition.project }}, les tuteurs pourront te recontacter en cas de désistement. - </p> - </mat-expansion-panel> - </mat-accordion> - - <p> - <app-edition-contact [edition]="edition"></app-edition-contact> - </p> - </div> - </mat-step> -</mat-horizontal-stepper> diff --git a/src_/app/members/projects/register-wizard/register-wizard.component.scss b/src_/app/members/projects/register-wizard/register-wizard.component.scss deleted file mode 100644 index feeb2ac43a735b4e59204fbe9020dc471f22d509..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/register-wizard/register-wizard.component.scss +++ /dev/null @@ -1,18 +0,0 @@ -@import '~sass/variables'; - -#stepper { - max-width: 60em; - padding: 0 2em; - margin: auto; -} - -#form-entry { - max-width: 30em; - margin: 1em auto; -} - -.nav-buttons { - display: flex; - flex-flow: row wrap; - justify-content: space-between; -} diff --git a/src_/app/members/projects/register-wizard/register-wizard.component.ts b/src_/app/members/projects/register-wizard/register-wizard.component.ts deleted file mode 100644 index 5f03446b2090ab9b4f0fe7f42255cff564626880..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/register-wizard/register-wizard.component.ts +++ /dev/null @@ -1,116 +0,0 @@ -import { Component, OnInit, ViewChild, ElementRef } from '@angular/core'; -import { FormGroup, FormControl, Validators } from '@angular/forms'; -import { ActivatedRoute } from '@angular/router'; -import { AuthService } from 'app/core'; -import { Edition, EditionService, ParticipationService } from '../core'; -import { DynamicFormComponent, Form } from 'app/dynamic-forms'; -import { MatStepper, MatSnackBar } from '@angular/material'; - -@Component({ - selector: 'app-register-wizard', - templateUrl: './register-wizard.component.html', - styleUrls: ['./register-wizard.component.scss'] -}) -export class RegisterWizardComponent implements OnInit { - - editions: Edition[]; - edition: Edition; - initialEditionId: number; - form: Form; - @ViewChild(DynamicFormComponent) editionForm: DynamicFormComponent; - @ViewChild('stepper') stepper: MatStepper; - formSent = false; - loading = false; - - formGroup: FormGroup; - - constructor( - private route: ActivatedRoute, - private auth: AuthService, - private editionService: EditionService, - private participationService: ParticipationService, - private snackBar: MatSnackBar, - ) { } - - ngOnInit() { - this.editions = this.route.snapshot.data['editions']; - this.initForms(); - } - - private initForms() { - this.formGroup = new FormGroup({ - project: new FormGroup({ - editionId: new FormControl(null, Validators.required), - }), - documents: new FormGroup({}), - }); - } - - private loadForm() { - this.editionService.retrieve(this.formGroup.value.project.editionId).subscribe( - edition => { - this.edition = edition; - this.editionForm.form = edition.editionForm.form; - if (this.editionForm.form.files.length >= 0) { - this.formGroup.controls.documents['downloaded'] = new FormControl(false, Validators.required); - } - }, - e => console.log(e), - ); - } - - onEditionFormSubmitted() { - this.form = this.editionForm.form; - this.stepper.next(); - } - - register() { - if (!this.formSent) { - const userId = this.auth.getUserSnapshot().id; - this.loading = true; - this.participationService.create(userId, this.edition.id, this.form).subscribe( - (participation) => { - this.loading = false; - this.formSent = true; - this.stepper.next(); - // Open a confirmation snackbar - const message = `Demande d'inscription envoyée. Tu recevras bientôt un email de confirmation.`; - this.snackBar.open(message, 'OK', { duration: 3000 }); - }, - e => { - this.loading = false; - console.log(e); - // TODO Notify that something went wrong - } - ); - } else { - this.stepper.next(); - } - } - - onChangeStep(stepperSelectionEvent) { - const current = stepperSelectionEvent.selectedIndex; - const previous = stepperSelectionEvent.previouslySelectedIndex; - // When going to the 'select' step, record the current edition ID - if (current === 0) { - this.initialEditionId = this.formGroup.value.project.editionId; - } - // When switching to the 'form' step, only load the edition's form if the - // edition has changed - if (previous === 0 && current === 1) { - const editionChanged = this.formGroup.value.project.editionId !== this.initialEditionId - if (editionChanged) { - this.loadForm(); - } - } - if (previous === 1 && current === 2) { - this.editionForm.save(); - this.form = this.editionForm.form; - } - } - - get downloadUrl(): string { - return this.editionService.getDownloadUrl(this.edition.id); - } - -} diff --git a/src_/app/members/projects/unregister-dialog/unregister-dialog.component.html b/src_/app/members/projects/unregister-dialog/unregister-dialog.component.html deleted file mode 100644 index 16ed1d6aa786adc9a9094b796bc068567e3cb6fc..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/unregister-dialog/unregister-dialog.component.html +++ /dev/null @@ -1,52 +0,0 @@ -<ng-template [ngIf]="delete"> - <h1 mat-dialog-title> - Supprimer ton inscription à {{ edition.project }} {{ edition.year }} ? - <span [ngSwitch]="delete"> - <span *ngSwitchCase="true"> - </span> - <span *ngSwitchDefault> - Annuler ton inscription à {{ edition.project }} {{ edition.year }} ? - </span> - </span> - </h1> - - <mat-dialog-content> - <p> - Tu sortiras du processus d'inscription et les organisateurs seront informés de ta décision. - </p> - <p> - Tu devras à nouveau effectuer le processus d'inscription pour te réinscrire. - </p> - <p> - <strong> - Cette action est irréversible. - </strong> - </p> - </mat-dialog-content> - - <mat-dialog-actions> - <button mat-button [matDialogClose]="false">Ne pas supprimer mon inscription</button> - <button mat-raised-button color="warn" [matDialogClose]="true">Supprimer mon inscription</button> - </mat-dialog-actions> -</ng-template> - -<ng-template [ngIf]="!delete"> - <h1 mat-dialog-title> - Annuler ton inscription à {{ edition.project }} {{ edition.year }} ? - </h1> - - <mat-dialog-content> - <p> - Tu sortiras du processus d'inscription et les organisateurs en seront informés. - </p> - <p> - Si tu souhaites finalement participer, - tu pourras réactiver ton inscription depuis la section "Mes inscriptions". - </p> - </mat-dialog-content> - - <mat-dialog-actions> - <button mat-button [matDialogClose]="false">Ne pas annuler mon inscription</button> - <button mat-raised-button color="warn" [matDialogClose]="true">Annuler mon inscription</button> - </mat-dialog-actions> -</ng-template> diff --git a/src_/app/members/projects/unregister-dialog/unregister-dialog.component.scss b/src_/app/members/projects/unregister-dialog/unregister-dialog.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/members/projects/unregister-dialog/unregister-dialog.component.ts b/src_/app/members/projects/unregister-dialog/unregister-dialog.component.ts deleted file mode 100644 index 7045e951506ef53b47b66c8b0abdd68ed6e4ebce..0000000000000000000000000000000000000000 --- a/src_/app/members/projects/unregister-dialog/unregister-dialog.component.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Component, Inject, OnInit } from '@angular/core'; -import { MAT_DIALOG_DATA } from '@angular/material'; -import { Edition } from '../core'; - - -@Component({ - selector: 'app-unregister-dialog', - templateUrl: './unregister-dialog.component.html', - styleUrls: ['./unregister-dialog.component.scss'] -}) -export class UnregisterDialogComponent implements OnInit { - - edition: Edition; - delete: boolean; - - constructor(@Inject(MAT_DIALOG_DATA) private data: any) { } - - ngOnInit() { - this.edition = this.data.edition; - this.delete = this.data.delete || false; - } - -} diff --git a/src_/app/members/student-home/account-overview/account-overview.component.html b/src_/app/members/student-home/account-overview/account-overview.component.html deleted file mode 100644 index 1619aacb978c99ab34482bb342046997d0e41ae3..0000000000000000000000000000000000000000 --- a/src_/app/members/student-home/account-overview/account-overview.component.html +++ /dev/null @@ -1,19 +0,0 @@ -<div class="container"> - <h2 id="title">Mon Compte</h2> - - <p> - - - - Remplie ou modifie tes données personnelles qui te serviront pour valider ton inscription à OSER. - - - - - </p> - <a mat-raised-button color="accent" routerLink="compte/donnees"> - Voir mon compte - </a> - - </div> - \ No newline at end of file diff --git a/src_/app/members/student-home/account-overview/account-overview.component.scss b/src_/app/members/student-home/account-overview/account-overview.component.scss deleted file mode 100644 index 7c2d3209e215d6ad3a736555123a3e65c73b4fec..0000000000000000000000000000000000000000 --- a/src_/app/members/student-home/account-overview/account-overview.component.scss +++ /dev/null @@ -1,15 +0,0 @@ -@import '~sass/variables'; - -#title { - margin: 0; - padding: 0; -} - -.row { - padding-bottom: 0.5em; - - p { - margin: 0; - padding: 0; - } -} diff --git a/src_/app/members/student-home/account-overview/account-overview.component.ts b/src_/app/members/student-home/account-overview/account-overview.component.ts deleted file mode 100644 index f3194fec84c74d158c152c5da35460d2e853c3e5..0000000000000000000000000000000000000000 --- a/src_/app/members/student-home/account-overview/account-overview.component.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'account-overview', - templateUrl: './account-overview.component.html', - styleUrls: ['./account-overview.component.scss'] -}) - -export class AccountOverviewComponent {} diff --git a/src_/app/members/student-home/projects-overview/projects-overview.component.html b/src_/app/members/student-home/projects-overview/projects-overview.component.html deleted file mode 100644 index 9d4fae027a12d023d8060c37f52fc49346b3e5aa..0000000000000000000000000000000000000000 --- a/src_/app/members/student-home/projects-overview/projects-overview.component.html +++ /dev/null @@ -1,11 +0,0 @@ -<div class="container"> - <h2 id="title">Projets</h2> - - <p> - Retrouve les descriptions des projets que le secteur Projets te propose, et inscris-toi à tes projets préférés. - </p> - <a mat-raised-button color="accent" routerLink="projets"> - Voir les projets - </a> - -</div> diff --git a/src_/app/members/student-home/projects-overview/projects-overview.component.scss b/src_/app/members/student-home/projects-overview/projects-overview.component.scss deleted file mode 100644 index 7c2d3209e215d6ad3a736555123a3e65c73b4fec..0000000000000000000000000000000000000000 --- a/src_/app/members/student-home/projects-overview/projects-overview.component.scss +++ /dev/null @@ -1,15 +0,0 @@ -@import '~sass/variables'; - -#title { - margin: 0; - padding: 0; -} - -.row { - padding-bottom: 0.5em; - - p { - margin: 0; - padding: 0; - } -} diff --git a/src_/app/members/student-home/projects-overview/projects-overview.component.ts b/src_/app/members/student-home/projects-overview/projects-overview.component.ts deleted file mode 100644 index ecb2e2adc256ddbace179bff7adef9c9c037d651..0000000000000000000000000000000000000000 --- a/src_/app/members/student-home/projects-overview/projects-overview.component.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'projects-overview', - templateUrl: './projects-overview.component.html', - styleUrls: ['./projects-overview.component.scss'] -}) - -export class ProjectsOverviewComponent {} diff --git a/src_/app/members/student-home/student-home.component.html b/src_/app/members/student-home/student-home.component.html deleted file mode 100644 index 540c5f14f01be246773ff3ad286235f400a58f6b..0000000000000000000000000000000000000000 --- a/src_/app/members/student-home/student-home.component.html +++ /dev/null @@ -1,25 +0,0 @@ -<h1 class="text-center"> - Mon espace -</h1> - -<app-three-panes> - <app-pane id="visits"> - <visits-overview class="pane-content"></visits-overview> - </app-pane> - <app-pane id="projects"> - <projects-overview class="pane-content"></projects-overview> - </app-pane> - <app-pane id="account"> - <account-overview class="pane-content"></account-overview> - </app-pane> -</app-three-panes> - -<div class="container"> - <h2> - Notifications - </h2> - <p> - Les informations importantes concernant ton <strong>inscription aux sorties et projets</strong> te seront envoyées par email à l'adresse que tu nous as fournie - ({{ userEmail }}). - </p> -</div> diff --git a/src_/app/members/student-home/student-home.component.scss b/src_/app/members/student-home/student-home.component.scss deleted file mode 100644 index 62a40567bfae2c5995659c50696d5206a01782d8..0000000000000000000000000000000000000000 --- a/src_/app/members/student-home/student-home.component.scss +++ /dev/null @@ -1,18 +0,0 @@ -@import '~sass/mixins'; -@import '~sass/variables'; - -.container { - @include margin-page; -} - -#visits { - // TODO use a background image? - background: $color-light-blue; -} - -#projects { - // TODO use a background image? - background: $color-purple-lighter; -} - - diff --git a/src_/app/members/student-home/student-home.component.ts b/src_/app/members/student-home/student-home.component.ts deleted file mode 100644 index 50d2ff5eba9a97148f2695379fb4af5a2d64c038..0000000000000000000000000000000000000000 --- a/src_/app/members/student-home/student-home.component.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Component } from '@angular/core'; -import { AuthService } from 'app/core'; - -@Component({ - selector: 'student-home', - templateUrl: './student-home.component.html', - styleUrls: ['./student-home.component.scss'] -}) -export class StudentHomeComponent { - - userEmail: string; - - constructor(private auth: AuthService) { } - - ngOnInit() { - this.userEmail = this.auth.getUserSnapshot().email; - } -} diff --git a/src_/app/members/student-home/student-home.module.ts b/src_/app/members/student-home/student-home.module.ts deleted file mode 100644 index 778d82db466c6f63ce0d15f959dfaec1486f01a1..0000000000000000000000000000000000000000 --- a/src_/app/members/student-home/student-home.module.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { RouterModule } from '@angular/router'; -import { CoreModule } from 'app/core'; -import { SharedModule } from 'app/shared'; -import { PanesModule } from 'app/panes'; -import { - MatButtonModule, -} from '@angular/material'; - -// Components -import { StudentHomeComponent } from './student-home.component'; -import { ProjectsOverviewComponent } from './projects-overview/projects-overview.component'; -import { VisitsOverviewComponent } from './visits-overview/visits-overview.component'; -import {AccountOverviewComponent} from './account-overview/account-overview.component'; - -@NgModule({ - imports:[ - CommonModule, - RouterModule, - CoreModule, - PanesModule, - SharedModule, - MatButtonModule, - ], - declarations: [ - StudentHomeComponent, - ProjectsOverviewComponent, - VisitsOverviewComponent, - AccountOverviewComponent, - ] -}) - -export class StudentHomeModule { } diff --git a/src_/app/members/student-home/visits-overview/visits-overview.component.html b/src_/app/members/student-home/visits-overview/visits-overview.component.html deleted file mode 100644 index 41fe659ae4d7911eebc9b7ef72909f86cf543032..0000000000000000000000000000000000000000 --- a/src_/app/members/student-home/visits-overview/visits-overview.component.html +++ /dev/null @@ -1,12 +0,0 @@ -<div class="container"> - <h2 id="title">Sorties</h2> - <p> - Retrouve toutes les informations concernant les prochanes sorties que le secteur Sorties a concocté pour toi ! - </p> - <p> - Dates, lieux et horaires, formulaires d'inscription, tout est disponible ici. - </p> - <a mat-raised-button color="accent" routerLink="sorties"> - Voir les dernières sorties - </a> -</div> diff --git a/src_/app/members/student-home/visits-overview/visits-overview.component.scss b/src_/app/members/student-home/visits-overview/visits-overview.component.scss deleted file mode 100644 index b1aeaa288585fcd044b4a614007ea5722cf04fff..0000000000000000000000000000000000000000 --- a/src_/app/members/student-home/visits-overview/visits-overview.component.scss +++ /dev/null @@ -1,12 +0,0 @@ -@import '~sass/variables'; - -.container { - .text-muted { - color: $color-purple-light; - } -} - -#title { - margin: 0; - padding: 0; -} diff --git a/src_/app/members/student-home/visits-overview/visits-overview.component.ts b/src_/app/members/student-home/visits-overview/visits-overview.component.ts deleted file mode 100644 index 4dd75a0f68a00d92283f1aaa3ade32c109952815..0000000000000000000000000000000000000000 --- a/src_/app/members/student-home/visits-overview/visits-overview.component.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'visits-overview', - templateUrl: './visits-overview.component.html', - styleUrls: ['./visits-overview.component.scss'] -}) - -export class VisitsOverviewComponent {} diff --git a/src_/app/members/visits/leave-form/leave-form.component.html b/src_/app/members/visits/leave-form/leave-form.component.html deleted file mode 100644 index 858e324c92863a8619cc8694fad607cd0579e35f..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/leave-form/leave-form.component.html +++ /dev/null @@ -1,19 +0,0 @@ -<!-- Modal register form --> -<div id="leave-form" class="modal" [hidden]="!visible" (click)="clickModal($event)"> - <form name="form" class="modal-content" (ngSubmit)="form.valid && onLeave()" novalidate #form="ngForm"> - <h2>Désistement : {{ visit.title }}</h2> - <p> - Merci de prendre le temps de nous signaler que tu ne peux pas être présent. - </p> - <p> - Peux-tu expliquer aux tuteurs organisateurs la raison de ton désistement ? - </p> - <div> - <textarea name="reason" [(ngModel)]="reason" required rows="3"></textarea> - </div> - <div class="text-center"> - <button class="btn-success" type="submit" [disabled]="loading || !form.valid">Me désinscrire</button> - <app-load-spinner *ngIf="loading"></app-load-spinner> - </div> - </form> -</div> diff --git a/src_/app/members/visits/leave-form/leave-form.component.scss b/src_/app/members/visits/leave-form/leave-form.component.scss deleted file mode 100644 index c606e5714e2d4fc12e38aad124adb6c1526ee1fa..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/leave-form/leave-form.component.scss +++ /dev/null @@ -1,4 +0,0 @@ -textarea { - width: 100%; - resize: vertical; -} diff --git a/src_/app/members/visits/leave-form/leave-form.component.ts b/src_/app/members/visits/leave-form/leave-form.component.ts deleted file mode 100644 index 861f03bca624ce26c6408145f7ef9f14b8b6c30e..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/leave-form/leave-form.component.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; -import { Visit, Participant, ParticipantService } from '../shared'; - -@Component({ - selector: 'app-leave-form', - templateUrl: './leave-form.component.html', - styleUrls: ['./leave-form.component.scss'] -}) -export class LeaveFormComponent implements OnInit { - - @Input() visible: boolean; - @Input() visit: Visit; - @Input() userId: number; - @Output() left: EventEmitter<any> = new EventEmitter(); - @Output() closed: EventEmitter<any> = new EventEmitter(); - loading = false; - reason: string; - - constructor(private participantService: ParticipantService) { } - - ngOnInit() { - } - - clickModal(e): void { - if (e.target === document.getElementById('leave-form')) { - this.onClose(); - } - } - - onClose() { - this.closed.emit(); - this.visible = false; - } - - onLeave() { - const participant = this.visit.participants.find( - p => p.user.id === this.userId - ); - this.loading = true; - this.participantService.remove(participant, this.visit, this.userId, this.reason).subscribe( - () => { - this.loading = false; - const index = this.visit.participants.indexOf(participant); - this.visit.participants.splice(index, 1); - this.onClose(); - this.reason = null; - this.left.emit(); - } - ); - } -} diff --git a/src_/app/members/visits/organizer-card/organizer-card.component.html b/src_/app/members/visits/organizer-card/organizer-card.component.html deleted file mode 100644 index 61471ec368da661ea4b7a9df0a0d9d2d4ea94615..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/organizer-card/organizer-card.component.html +++ /dev/null @@ -1,11 +0,0 @@ -<div class="container drop-shadow-sm"> - <label class="name"> - <strong> - {{ organizer.fullName }} - </strong> - </label> - <div *ngIf="organizer.phoneNumber" class="text-muted-sm"> - <label>Téléphone</label> - <app-reveal [content]="organizer.phoneNumber"></app-reveal> - </div> -</div> diff --git a/src_/app/members/visits/organizer-card/organizer-card.component.scss b/src_/app/members/visits/organizer-card/organizer-card.component.scss deleted file mode 100644 index b19b01d66736f784437c355e21d8629b4876e697..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/organizer-card/organizer-card.component.scss +++ /dev/null @@ -1,12 +0,0 @@ -@import '~sass/variables'; - -.container { - text-align: center; - padding: 1em; - background: white; - width: 8em; - label { - display: block; - margin: .5em 0; - } -} diff --git a/src_/app/members/visits/organizer-card/organizer-card.component.ts b/src_/app/members/visits/organizer-card/organizer-card.component.ts deleted file mode 100644 index 12d6e0213f350f7e315d03ca3f5620e0cab70fa0..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/organizer-card/organizer-card.component.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { User } from 'app/core'; - -@Component({ - selector: 'app-organizer-card', - templateUrl: './organizer-card.component.html', - styleUrls: ['./organizer-card.component.scss'] -}) -export class OrganizerCardComponent { - - @Input() organizer: User; - -} diff --git a/src_/app/members/visits/participant-number-badge/participant-number-badge.component.html b/src_/app/members/visits/participant-number-badge/participant-number-badge.component.html deleted file mode 100644 index d8e954991f590e482208e86767c361f6bc807afe..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/participant-number-badge/participant-number-badge.component.html +++ /dev/null @@ -1,7 +0,0 @@ -<span *ngIf="number > 0" class="badge badge-default badge-lg"> - <i class="fa fa-user"></i> {{ number }} - <span [ngPlural]="number"> - <ng-template ngPluralCase="=1">participant</ng-template> - <ng-template ngPluralCase="other">participants</ng-template> - </span> -</span> diff --git a/src_/app/members/visits/participant-number-badge/participant-number-badge.component.scss b/src_/app/members/visits/participant-number-badge/participant-number-badge.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/members/visits/participant-number-badge/participant-number-badge.component.ts b/src_/app/members/visits/participant-number-badge/participant-number-badge.component.ts deleted file mode 100644 index 55aa5eb0b55d301c52f1aadd3e0176fc0f28bb8c..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/participant-number-badge/participant-number-badge.component.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Component, Input } from '@angular/core'; - -@Component({ - selector: 'app-participant-number-badge', - templateUrl: './participant-number-badge.component.html', - styleUrls: ['./participant-number-badge.component.scss'] -}) -export class ParticipantNumberBadgeComponent { - - @Input() number: number; - -} diff --git a/src_/app/members/visits/participation-badge/participation-badge.component.html b/src_/app/members/visits/participation-badge/participation-badge.component.html deleted file mode 100644 index 469b3adb8c6b7195255fa0ef8e4f405d6d26c5b2..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/participation-badge/participation-badge.component.html +++ /dev/null @@ -1,14 +0,0 @@ -<span [ngSwitch]="accepted"> - <span *ngSwitchCase="true" class="badge badge-success badge-lg"> - <i class="fa fa-ticket"></i> Tu <span [ngSwitch]="passed"> - <span *ngSwitchCase="true">as participé</span> - <span *ngSwitchDefault>participes</span> - </span> à cette sortie. - </span> - <span *ngSwitchCase="false" class="badge badge-danger badge-lg"> - <i class="fa fa-times"></i> Ton inscription a été rejetée. - </span> - <span *ngSwitchDefault class="badge badge-info badge-lg"> - <i class="fa fa-info"></i> Ton inscription est en attente de validation par les organisateurs. - </span> -</span> diff --git a/src_/app/members/visits/participation-badge/participation-badge.component.scss b/src_/app/members/visits/participation-badge/participation-badge.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/members/visits/participation-badge/participation-badge.component.ts b/src_/app/members/visits/participation-badge/participation-badge.component.ts deleted file mode 100644 index 92b7c42435f1edb250d9906ad31fd26429c8f6c8..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/participation-badge/participation-badge.component.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Component, Input } from '@angular/core'; - -@Component({ - selector: 'app-participation-badge', - templateUrl: './participation-badge.component.html', - styleUrls: ['./participation-badge.component.scss'] -}) -export class ParticipationBadgeComponent { - - @Input() accepted: boolean; - @Input() passed: boolean; - -} diff --git a/src_/app/members/visits/register-form/register-form.component.html b/src_/app/members/visits/register-form/register-form.component.html deleted file mode 100644 index aff8c49832d22fcfb563f79df95da0e0d979c98f..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/register-form/register-form.component.html +++ /dev/null @@ -1,14 +0,0 @@ -<!-- Modal register form --> -<div id="register-form" class="modal" [hidden]="!visible" (click)="clickModal($event)"> - <form name="form" class="modal-content" (ngSubmit)="onParticipate()" novalidate> - <h2>Inscription à la sortie</h2> - <p> - Tu t'apprêtes à t'inscrire à la sortie : - <strong>{{ visit.title}}.</strong> - </p> - <div class="text-center"> - <button class="btn-success">Confirmer mon inscription</button> - <app-load-spinner *ngIf="loading"></app-load-spinner> - </div> - </form> -</div> diff --git a/src_/app/members/visits/register-form/register-form.component.scss b/src_/app/members/visits/register-form/register-form.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/members/visits/register-form/register-form.component.ts b/src_/app/members/visits/register-form/register-form.component.ts deleted file mode 100644 index 1318df366967a3f2ff39a1a562e82b1d5e4e0eb5..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/register-form/register-form.component.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; -import { Visit, Participant, ParticipantService } from '../shared'; - -@Component({ - selector: 'app-register-form', - templateUrl: './register-form.component.html', - styleUrls: ['./register-form.component.scss'] -}) -export class RegisterFormComponent implements OnInit { - - @Input() visible: boolean; - @Input() visit: Visit; - @Input() userId: number; - @Output() participate: EventEmitter<Participant> = new EventEmitter(); - @Output() closed: EventEmitter<any> = new EventEmitter(); - loading = false; - - constructor(private participantService: ParticipantService) { } - - ngOnInit() { - } - - clickModal(e): void { - if (e.target === document.getElementById('register-form')) { - this.onClose(); - } - } - - onClose() { - this.closed.emit(); - this.visible = false; - } - - onParticipate(): void { - this.loading = true; - this.participantService.add(this.visit.id, this.userId).subscribe( - (participant: Participant) => { - this.loading = false; - this.participate.emit(participant); - this.onClose(); - } - ); - } - -} diff --git a/src_/app/members/visits/registration-badge/registration-badge.component.html b/src_/app/members/visits/registration-badge/registration-badge.component.html deleted file mode 100644 index 5ba04e9eae313ef33d49ca0340925dde165add2b..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/registration-badge/registration-badge.component.html +++ /dev/null @@ -1,11 +0,0 @@ -<span *ngIf="open" class="badge badge-warning badge-lg"><i class="fa fa-clock-o"></i> - Inscriptions avant le {{ deadline | date:"dd/MM à HH:mm" }} -</span> - -<span *ngIf="!open && !passed" class="badge badge-danger badge-lg" [ngClass]="{'tooltip bottom': !passed}"> - <i class="fa fa-times"></i> Inscriptions fermées {{ deadline | amLocale:'fr' | amTimeAgo }} - <span class="tooltip-text drop-shadow-sm" *ngIf="!passed"> - Tu peux encore tenter de t'inscrire - <a href="mailto:oser.sortie@gmail.com?subject=Inscription à la sortie : {{ title }}">par email</a>. - </span> -</span> diff --git a/src_/app/members/visits/registration-badge/registration-badge.component.scss b/src_/app/members/visits/registration-badge/registration-badge.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/members/visits/registration-badge/registration-badge.component.ts b/src_/app/members/visits/registration-badge/registration-badge.component.ts deleted file mode 100644 index a547d6e9483a6a1b81603fd4f0926ad36636026f..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/registration-badge/registration-badge.component.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { Visit } from '../shared'; - -@Component({ - selector: 'app-registration-badge', - templateUrl: './registration-badge.component.html', - styleUrls: ['./registration-badge.component.scss'] -}) -export class RegistrationBadgeComponent { - - @Input() title: string; - @Input() open: boolean; - @Input() passed: boolean; - @Input() deadline: Date; - -} diff --git a/src_/app/members/visits/shared/adapters.ts b/src_/app/members/visits/shared/adapters.ts deleted file mode 100644 index dbad8426cea443ec316b5758a61d6adeb14e9c13..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/shared/adapters.ts +++ /dev/null @@ -1,119 +0,0 @@ -import { Visit, Place, Participant, Organizer } from './models'; -import { UserAdapter, AddressAdapter, IAdapter } from 'app/core'; - - -export class PlaceAdapter implements IAdapter<Place> { - - private addressAdapter = new AddressAdapter(); - - adapt(data: any): Place { - return { - id: data.id, - name: data.name, - description: data.description, - address: data.address ? this.addressAdapter.adapt(data.address) : null, - } - } -} - - -export class ParticipantAdapter implements IAdapter<Participant> { - - private userAdapter = new UserAdapter(); - - adapt(data: any): Participant { - return { - id: data.id, - present: data.present, - accepted: data.accepted, - user: this.userAdapter.adapt(data.user), - visitId: data.visit, - } - } -} - - -export class OrganizerAdapter implements IAdapter<Organizer> { - - private userAdapter = new UserAdapter(); - - adapt(data: any): Organizer { - return { - id: data.id, - user: data.user ? this.userAdapter.adapt(data.user) : null, - } - } -} - - -export class SimpleVisitAdapter implements IAdapter<Visit> { - - private placeAdapter = new PlaceAdapter(); - private participantAdapter = new ParticipantAdapter(); - - adapt(data: any): Visit { - const fromUserIds = (arr: number[]) => (arr || []).map( - id => ({ - id: null, - user: { id: id }, - visitId: data.id, - }) - ); - const participants = data.participants.map( - p => this.participantAdapter.adapt(p) - ); - const place = this.placeAdapter.adapt({ name: data.place }); - return new Visit({ - id: data.id, - title: data.title, - summary: data.summary, - description: data.description, - place: place, - date: new Date(data.date), - startTime: new Date(Date.parse(`1 Jan 2000 ${data.start_time}`)), - endTime: new Date(Date.parse(`1 Jan 2000 ${data.end_time}`)), - passed: data.passed, - deadline: new Date(data.deadline), - registrationsOpen: data.registrations_open, - image: data.image, - participants: participants, - organizers: fromUserIds(data.organizers), - }) - } -} - - -export class VisitAdapter implements IAdapter<Visit> { - - private placeAdapter = new PlaceAdapter(); - private participantAdapter = new ParticipantAdapter(); - private organizerAdapter = new OrganizerAdapter(); - - adapt(data: any): Visit { - const participants = data.participants.map( - p => this.participantAdapter.adapt(p) - ); - const organizers = data.organizers.map( - o => this.organizerAdapter.adapt(o) - ); - return new Visit({ - id: data.id, - title: data.title, - summary: data.summary, - description: data.description, - place: data.place ? this.placeAdapter.adapt(data.place) : null, - date: new Date(data.date), - startTime: new Date(Date.parse(`1 Jan 2000 ${data.start_time}`)), - endTime: new Date(Date.parse(`1 Jan 2000 ${data.end_time}`)), - passed: data.passed, - meetingPlace: data.meeting, - deadline: new Date(data.deadline), - registrationsOpen: data.registrations_open, - image: data.image, - factSheet: data.fact_sheet, - permissionSheet: data.permission, - participants: participants, - organizers: organizers, - }); - } -} diff --git a/src_/app/members/visits/shared/index.ts b/src_/app/members/visits/shared/index.ts deleted file mode 100644 index 5631752af6a0affeb2f72c0a7a567a899bdddab2..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/shared/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './models'; -export * from './visit.service'; -export * from './participant.service'; -export * from './resolvers'; diff --git a/src_/app/members/visits/shared/models.ts b/src_/app/members/visits/shared/models.ts deleted file mode 100644 index 12ac07539825eb47ecf8d0f6ab9f43a0d4e50784..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/shared/models.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { Address, UserInfo } from 'app/core'; - - -export interface Place { - id: number; - name: string; - address: Address; - description: string; -} - -export interface Participant { - id: number; - present?: boolean; - accepted?: boolean; - user: UserInfo; - visitId?: number; -} - -export interface Organizer { - id: number; - user: UserInfo; -} - -export class Visit { - id: number; - title: string; - summary: string; - description: string; - place: Place; - date: Date; - startTime: Date; - endTime: Date; - meetingPlace: string; - passed: boolean; - deadline: Date; - registrationsOpen: boolean; - image: string; - factSheet: string; - permissionSheet: string; - participants: Participant[]; - organizers: Organizer[]; - - constructor(opts: { - id: number, - title: string, - summary: string; - description?: string, - place: Place, - date: Date, - startTime: Date, - endTime: Date, - passed: boolean, - meetingPlace?: string; - deadline: Date, - registrationsOpen: boolean, - image: string; - factSheet?: string; - permissionSheet?: string; - participants?: Participant[]; - organizers?: Organizer[], - }) { - this.id = opts.id; - this.title = opts.title || null; - this.summary = opts.summary || null; - this.description = opts.description || null; - this.place = opts.place; - this.date = opts.date; - this.startTime = opts.startTime; - this.endTime = opts.endTime; - this.passed = opts.passed; - this.meetingPlace = opts.meetingPlace; - this.deadline = opts.deadline; - this.registrationsOpen = opts.registrationsOpen; - this.image = opts.image; - this.factSheet = opts.factSheet; - this.permissionSheet = opts.permissionSheet; - this.participants = opts.participants || []; - this.organizers = opts.organizers || []; - } - - get address(): string { - if (this.place.address) { - // Preprend the place's name for better geocoding results - return this.place.name + ', ' + this.place.address.toString(); - } else { - return this.place.name; - } - } - -} diff --git a/src_/app/members/visits/shared/participant.service.ts b/src_/app/members/visits/shared/participant.service.ts deleted file mode 100644 index 91cd68edcb9c4c38eadb1781627a227eb09c87bd..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/shared/participant.service.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs'; -import { mergeMap, map, tap } from 'rxjs/operators'; -import { Router, ActivatedRoute } from '@angular/router'; -import { HttpClient, HttpHeaders, HttpErrorResponse } from '@angular/common/http'; -import { Visit, Place, Participant } from './models'; -import { VisitAdapter, SimpleVisitAdapter, ParticipantAdapter } from './adapters'; -import { environment } from 'environments/environment'; - - -@Injectable({ - providedIn: 'root', -}) -export class ParticipantService { - - private apiUrl: string = environment.apiUrl + 'participations/'; - private adapter = new ParticipantAdapter(); - - constructor( - private http: HttpClient, - private router: Router, - private route: ActivatedRoute) { } - - add(visitId: number | string, userId: number | string): Observable<any> { - const body = { user: userId, visit: visitId }; - return this.http.post(this.apiUrl, body).pipe( - map((data: any) => this.adapter.adapt(data)), - ); - } - - remove(participant: Participant, visit: Visit, userId: number | string, reason: string): Observable<any> { - let url = this.apiUrl + `${participant.id}/notify_cancelled/`; - const body = { user: userId, visit: visit.id, reason: reason }; - return this.http.post(url, body).pipe( - mergeMap(() => { - url = this.apiUrl + `${participant.id}/`; - return this.http.delete(url); - }) - ); - } - -} diff --git a/src_/app/members/visits/shared/resolvers.ts b/src_/app/members/visits/shared/resolvers.ts deleted file mode 100644 index 540854a4f8e28a0f35143dba25d0762c80ebb667..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/shared/resolvers.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Resolve, ActivatedRouteSnapshot, Router } from '@angular/router'; -import { Observable, of } from 'rxjs'; -import { catchError } from 'rxjs/operators'; -import { Visit } from './models'; -import { ErrorService } from 'app/core'; -import { VisitService } from './visit.service'; - - -@Injectable({ - providedIn: 'root', -}) -export class VisitsResolver implements Resolve<Visit[]> { - - constructor( - private visitService: VisitService, - private errorService: ErrorService) { } - - resolve(): Observable<Visit[]> { - return this.visitService.list().pipe( - catchError(e => of(null)) - ); - } -} - -@Injectable({ - providedIn: 'root', -}) -export class VisitResolver implements Resolve<Visit> { - - constructor( - private visitService: VisitService, - private errorService: ErrorService) { } - - resolve(route: ActivatedRouteSnapshot): Observable<Visit> { - return this.visitService.retrieve(route.paramMap.get('id')).pipe( - catchError(e => of(null)) - ); - } -} diff --git a/src_/app/members/visits/shared/visit.service.ts b/src_/app/members/visits/shared/visit.service.ts deleted file mode 100644 index 637f9c7aa4109951f28e874f0a8e39e7151d211e..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/shared/visit.service.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs'; -import { HttpClient } from '@angular/common/http'; -import { map, tap } from 'rxjs/operators'; -import { Visit, Place } from './models'; -import { VisitAdapter, SimpleVisitAdapter } from './adapters'; -import { environment } from 'environments/environment'; - - -@Injectable({ - providedIn: 'root', -}) -export class VisitService { - - baseUrl = environment.apiUrl + 'visits/'; - - private adapter = new VisitAdapter(); - private simpleAdapter = new SimpleVisitAdapter(); - - constructor( - private http: HttpClient) { } - - list(): Observable<Visit[]> { - return this.http.get<Visit>(this.baseUrl).pipe( - map((visits: any) => visits.map(v => this.simpleAdapter.adapt(v))), - ); - } - - retrieve(id: number | string): Observable<Visit> { - let url = this.baseUrl + `${id}/`; - return this.http.get<Visit>(url).pipe( - map(v => this.adapter.adapt(v)), - ); - } - -} diff --git a/src_/app/members/visits/toggle-button/toggle-button.component.html b/src_/app/members/visits/toggle-button/toggle-button.component.html deleted file mode 100644 index 4a25d4af90a3809b8cb0ee05dc67c063bcff6c56..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/toggle-button/toggle-button.component.html +++ /dev/null @@ -1,3 +0,0 @@ -<button type="button" (click)="toggle()" [class]="baseClassName" [ngClass]="className"> - {{ label }} -</button> diff --git a/src_/app/members/visits/toggle-button/toggle-button.component.scss b/src_/app/members/visits/toggle-button/toggle-button.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/members/visits/toggle-button/toggle-button.component.ts b/src_/app/members/visits/toggle-button/toggle-button.component.ts deleted file mode 100644 index 18ceeabed5df0cb7b0611e3639690db6c4bf860c..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/toggle-button/toggle-button.component.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; - -@Component({ - selector: 'toggle-button', - templateUrl: './toggle-button.component.html', - styleUrls: ['./toggle-button.component.scss'] -}) -export class ToggleButtonComponent implements OnInit { - - @Input() state: boolean = false; - @Input() labelOn: string; - @Input() labelOff: string; - @Input() classOn: string; - @Input() classOff: string; - @Input() baseClassName: string = ""; - @Output() onChange = new EventEmitter<boolean>(); - - constructor() { } - - ngOnInit() { - } - - get label(): string { - if (this.state) { return this.labelOn; } else { return this.labelOff; } - } - - get className(): string { - if (this.state) { return this.classOn; } else { return this.classOff; } - } - - toggle(): void { - this.state = !this.state; - this.onChange.emit(this.state); - } - -} diff --git a/src_/app/members/visits/useful-information/useful-information.component.html b/src_/app/members/visits/useful-information/useful-information.component.html deleted file mode 100644 index cc764ffad9af9a2c0809e3b0acc75544a08a7d46..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/useful-information/useful-information.component.html +++ /dev/null @@ -1,26 +0,0 @@ -<table> - <tr> - <td>Lieu</td> - <td>{{ visit.place.name }}</td> - </tr> - <tr> - <td>Adresse</td> - <td>{{ visit.place.address.toString() }}</td> - </tr> - <tr> - <td>Date</td> - <td>{{ visit.date | date:"fullDate" }}</td> - </tr> - <tr> - <td>Heure de début</td> - <td>{{ visit.startTime | date:"shortTime"}}</td> - </tr> - <tr> - <td>Heure de fin estimée</td> - <td>{{ visit.endTime | date:"shortTime"}}</td> - </tr> - <tr> - <td>Lieu de rendez-vous</td> - <td>{{ visit.meetingPlace }}</td> - </tr> -</table> diff --git a/src_/app/members/visits/useful-information/useful-information.component.scss b/src_/app/members/visits/useful-information/useful-information.component.scss deleted file mode 100644 index 31da90a97549013c7c0f4af8dffd6470261244ea..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/useful-information/useful-information.component.scss +++ /dev/null @@ -1,11 +0,0 @@ -@import '~sass/media-queries'; - -table { - width: 100%; - border: none; - border-spacing: .5em; - - td:nth-child(1) { - font-weight: bold; - } -} diff --git a/src_/app/members/visits/useful-information/useful-information.component.ts b/src_/app/members/visits/useful-information/useful-information.component.ts deleted file mode 100644 index c291dedc75672a94dd5063396645fd557f4c45dc..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/useful-information/useful-information.component.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { Visit } from '../shared'; - -@Component({ - selector: 'app-useful-information', - templateUrl: './useful-information.component.html', - styleUrls: ['./useful-information.component.scss'] -}) -export class UsefulInformationComponent { - - @Input() visit: Visit; - -} diff --git a/src_/app/members/visits/visit-card/visit-card.component.html b/src_/app/members/visits/visit-card/visit-card.component.html deleted file mode 100644 index 7e46cff93f1b86d556825d18870943a944dc9b56..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/visit-card/visit-card.component.html +++ /dev/null @@ -1,49 +0,0 @@ -<a [routerLink]="['./', visit.id]" id="visit" class="no-style drop-shadow-sm-md"> - <img *ngIf="visit.image" [src]="visit.image" [alt]="visit.title"> - - <div class="body"> - - <div class="visit-content"> - <h3>{{ visit.title }}</h3> - - <!-- Visit's date and time --> - <strong>{{ visit.date | date:"EEEE d MMMM" }} – {{ visit.date | date:"shortTime"}}</strong><br /> - {{ visit.place.name }} - - <!-- Metadata represented as badges --> - <div> - - <span *ngIf="visit.registrationsOpen" class="badge badge-warning "> - <i class="fa fa-clock-o"></i> Inscriptions avant le - {{ visit.deadline | date:"dd/MM à HH:mm" }} - </span> - - <span *ngIf="!visit.registrationsOpen" class="badge badge-danger "> - <i class="fa fa-times"></i> Inscriptions fermées - </span> - - <span *ngIf="acceptedParticipants > 0" class="badge badge-info"> - {{ acceptedParticipants }} participants - </span> - - <span *ngIf="participant && participant.accepted" class="badge badge-success"> - Inscrit - </span> - - <span *ngIf="participant && participant.accepted === null" class="badge badge-info"> - En attente - </span> - - <span *ngIf="participant && participant.accepted === false" class="badge badge-danger"> - Inscription rejetée - </span> - - </div> - - </div> - - <div class="detail-link"> - <i class="fa fa-angle-down fa-3x"></i> - </div> - </div> -</a> diff --git a/src_/app/members/visits/visit-card/visit-card.component.scss b/src_/app/members/visits/visit-card/visit-card.component.scss deleted file mode 100644 index 3ec2282997cf657e040339064064cf43284a2906..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/visit-card/visit-card.component.scss +++ /dev/null @@ -1,33 +0,0 @@ -@import '~app/showcase-site/sass/mixins'; - -#visit { - display: block; - border-radius: 3px; - margin-bottom: auto; - overflow: hidden; - max-width: 20em; - cursor: pointer; - &:hover { - .detail-link { - color: $color-text; - } - } - img { - width: 100%; - height: auto; - } - .body { - padding: 1em 2em; - box-sizing: border-box; - h3 { - margin-top: 0; - } - } - .visit-content { - height: 100%; - } - .detail-link { - color: transparentize($color-text, .7); - text-align: center; - } -} diff --git a/src_/app/members/visits/visit-card/visit-card.component.ts b/src_/app/members/visits/visit-card/visit-card.component.ts deleted file mode 100644 index f7492cc71def961a45aba72a7ba9673e4b23f4bb..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/visit-card/visit-card.component.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { Observable } from 'rxjs'; -import { Visit, Participant } from '../shared'; - -@Component({ - selector: 'visit-card', - templateUrl: './visit-card.component.html', - styleUrls: ['./visit-card.component.scss'] -}) -export class VisitCardComponent implements OnInit { - - visit: Visit; - @Input('visit') set _visit(visit: Visit) { - this.visit = visit; - this.acceptedParticipants = this.visit.participants.filter( - p => p.accepted - ).length; - } - @Input() participant$: Observable<Participant>; - @Input() participant: Participant; - acceptedParticipants = 0; - - constructor() { } - - ngOnInit() { - this.participant$.subscribe( - (participant: Participant) => { - this.participant = participant; - } - ); - } - -} diff --git a/src_/app/members/visits/visit-detail/index.ts b/src_/app/members/visits/visit-detail/index.ts deleted file mode 100644 index 2cdb7394c90494b830d133d0c47dcf438a1c1403..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/visit-detail/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './visit-detail.component'; diff --git a/src_/app/members/visits/visit-detail/visit-detail.component.html b/src_/app/members/visits/visit-detail/visit-detail.component.html deleted file mode 100644 index 21cfd6af38a246655d5380c541901e84b78acb70..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/visit-detail/visit-detail.component.html +++ /dev/null @@ -1,86 +0,0 @@ -<div id="visit"> - <app-register-form [visible]="registerFormActive" (closed)="registerFormActive = false" [userId]="userId" [visit]="visit" (participate)="onParticipate($event)"></app-register-form> - - <app-leave-form [visible]="leaveFormActive" (closed)="leaveFormActive = false" [visit]="visit" [userId]="userId" (left)="participant = null"></app-leave-form> - - <div class="text-center"> - <h1>{{ visit.title }}</h1> - <p> - <strong>{{ visit.date | date:"EEEE d MMMM" }} – {{ visit.startTime | date:"shortTime"}}</strong> – {{ visit.place.name }} - </p> - - <p *ngIf="visit.summary" class="text-muted"> - {{ visit.summary }} - </p> - - <!-- Metadata badges --> - <div> - <app-registration-badge - [title]="visit.title" - [open]="visit.registrationsOpen" - [passed]="visit.passed" - [deadline]="visit.deadline"></app-registration-badge> - <app-participant-number-badge - [number]="acceptedParticipants"></app-participant-number-badge> - - <span *ngIf="participant"> - <app-participation-badge - [accepted]="participant.accepted" - [passed]="visit.passed"></app-participation-badge> - </span> - </div> - - <!-- Show register button if user does not participate --> - <div *ngIf="visit.registrationsOpen && !participant" class="text-center"> - <button id="participate-btn" type="button" name="button" class="btn-success" (click)="registerFormActive = true">Je m'inscris</button> - </div> - - <div *ngIf="participant && !visit.passed"> - - <!-- And a shy-ish unregister link --> - <p class="text-muted-sm"> - Tu as un empêchement et souhaites - <span class="link-muted" (click)="leaveFormActive = true"> - te désinscrire ? - </span> - </p> - - <!-- Related documents --> - <p class="alert alert-info" *ngIf="visit.permissionSheet"> - <i class="fa fa-exclamation-triangle"></i>Avant de te rendre à la sortie, télécharge <a [href]="visit.permissionSheet">l'autorisation de sortie</a>. Fais-la remplir par tes parents et remets-la aux tuteurs le jour de la sortie. - </p> - <p class="alert alert-default" *ngIf="visit.factSheet"> - <i class="fa fa-file-text"></i> Les organisateurs ont rédigé une <a [href]="visit.factSheet">fiche sortie</a>. N'hésite pas à en prendre connaissance avant de te rendre à la sortie ! - </p> - </div> - - <img id="illustration" *ngIf="visit.image" [src]="visit.image" [alt]="visit.title" class="drop-shadow-sm"> - </div> - - <div *ngIf="visit.description"> - <h2>Détail des activités</h2> - <markdown [data]="visit.description"></markdown> - </div> - - <div *ngIf="visit.place.description"> - <h2>À propos du lieu</h2> - <markdown [data]="visit.place.description"></markdown> - </div> - - <h2>Informations pratiques</h2> - <app-useful-information [visit]="visit"></app-useful-information> - - <h2>Se rendre à cette sortie</h2> - <app-visit-location-map - [geocoder]="geocoder" - [address]="visit.address"></app-visit-location-map> - - <div *ngIf="visit.organizers.length > 0"> - <h2>Tuteurs organisateurs</h2> - - <div class="organizers"> - <app-organizer-card *ngFor="let organizer of visit.organizers" [organizer]="organizer.user"></app-organizer-card> - </div> - </div> - -</div> diff --git a/src_/app/members/visits/visit-detail/visit-detail.component.scss b/src_/app/members/visits/visit-detail/visit-detail.component.scss deleted file mode 100644 index db849a895ace9be539f1a83784189e119de6a438..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/visit-detail/visit-detail.component.scss +++ /dev/null @@ -1,53 +0,0 @@ -@import '~sass/mixins'; -@import '~sass/variables'; - -#visit { - @include margin-page; - margin: 0 auto; - max-width: 40em; - position: relative; - - &::before { - content: ''; - position: absolute; - top: 0; - left: 0; - height: 100%; - width: 100%; - z-index: -10; - @include drop-shadow($shadow-sm); - } -} - -#participate-btn { - margin-top: 1em; -} - -img#illustration { - display: block; - margin: 1em auto; -} - -#header { - margin-bottom: $margin-page; -} - -.columns { - display: grid; - grid-template-columns: repeat(2, 1fr); - grid-column-gap: $margin-page; -} - -img { - display: block; - max-width: 100%; - height: auto; -} - -.organizers { - display: flex; - flex-flow: row wrap; - app-organizer-card { - margin: .5em; - } -} diff --git a/src_/app/members/visits/visit-detail/visit-detail.component.ts b/src_/app/members/visits/visit-detail/visit-detail.component.ts deleted file mode 100644 index ce98d8d176022b07af11dd07088ae94e3eeefb75..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/visit-detail/visit-detail.component.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { Observable, Subject } from 'rxjs'; -import { ActivatedRoute } from '@angular/router'; -import { AuthService, Geocoder } from 'app/core'; -import { Visit, Participant } from '../shared'; - -@Component({ - selector: 'app-visit-detail', - templateUrl: './visit-detail.component.html', - styleUrls: ['./visit-detail.component.scss'] -}) -export class VisitDetailComponent implements OnInit { - - visit: Visit; - userId: number; - participant: Participant; - acceptedParticipants = 0; - registerFormActive = false; - formLoading: boolean = false; - leaveFormActive = false; - geocoder: Geocoder; - - constructor( - private route: ActivatedRoute, - private auth: AuthService, - ) { } - - ngOnInit() { - this.visit = this.route.snapshot.data['visit']; - this.geocoder = this.route.snapshot.data['geocoder']; - this.userId = this.auth.getUserSnapshot().id; - this.getParticipant(); - this.getAcceptedParticipants(); - } - - getParticipant() { - this.participant = this.visit.participants.find( - p => p.user.id === this.userId - ); - } - - onParticipate(participant: Participant) { - this.visit.participants.push(participant); - this.getParticipant(); - this.getAcceptedParticipants(); - } - - getAcceptedParticipants() { - this.acceptedParticipants = this.visit.participants.filter( - p => p.accepted - ).length; - } - -} diff --git a/src_/app/members/visits/visit-location-map/visit-location-map.component.html b/src_/app/members/visits/visit-location-map/visit-location-map.component.html deleted file mode 100644 index 1181c5cbaff3cd2be4138c067725f400cea5ecf9..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/visit-location-map/visit-location-map.component.html +++ /dev/null @@ -1,3 +0,0 @@ -<agm-map [latitude]="lat" [longitude]="lng" [zoom]="17"> - <agm-marker [latitude]="lat" [longitude]="lng"></agm-marker> -</agm-map> diff --git a/src_/app/members/visits/visit-location-map/visit-location-map.component.scss b/src_/app/members/visits/visit-location-map/visit-location-map.component.scss deleted file mode 100644 index e9d4133784d1d279a2c79fb0402eca8632b6d5b5..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/visit-location-map/visit-location-map.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -agm-map { - height: 400px; -} diff --git a/src_/app/members/visits/visit-location-map/visit-location-map.component.ts b/src_/app/members/visits/visit-location-map/visit-location-map.component.ts deleted file mode 100644 index fd360cc003186580d1a925af00446afa6c409115..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/visit-location-map/visit-location-map.component.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { GeocodingService, Geocoder } from 'app/core'; - -@Component({ - selector: 'app-visit-location-map', - templateUrl: './visit-location-map.component.html', - styleUrls: ['./visit-location-map.component.scss'] -}) -export class VisitLocationMapComponent implements OnInit { - - @Input() address: string; - @Input() geocoder: Geocoder; - lat = 50; - lng = 3; - - constructor( - private geocoding: GeocodingService, - private route: ActivatedRoute, - ) { } - - ngOnInit() { - this.getVisitLocation(); - } - - getVisitLocation() { - this.geocoding.locate(this.geocoder, this.address).subscribe( - location => { - this.lat = location.lat; - this.lng = location.lng; - } - ); - } - -} diff --git a/src_/app/members/visits/visits-list/index.ts b/src_/app/members/visits/visits-list/index.ts deleted file mode 100644 index 39e3d6bca9b29effa3e3abbd3073b5addb13607e..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/visits-list/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './visits-list.component'; diff --git a/src_/app/members/visits/visits-list/visits-list.component.html b/src_/app/members/visits/visits-list/visits-list.component.html deleted file mode 100644 index e02367bc3f393710fbe067581abc3f1b250bb8c9..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/visits-list/visits-list.component.html +++ /dev/null @@ -1,25 +0,0 @@ -<div id="page"> - <ul class="tabs"> - <li [ngClass]="{active: !passed}" (click)="passed = false"> - Sorties à venir - </li> - <li [ngClass]="{active: passed}"(click)="passed = true"> - Sorties passées - </li> - </ul> - <div *ngIf="visits; else loading"> - <ul id="visits" *ngIf="displayedVisits && displayedVisits.length > 0; else empty"> - <li *ngFor="let visit of displayedVisits"> - <visit-card [visit]="visit" [participant$]="userParticipant(visit)"></visit-card> - </li> - </ul> - <ng-template #empty> - <p class="text-center">Pas de sorties à afficher ici.</p> - </ng-template> - </div> - <ng-template #loading> - <app-load-spinner></app-load-spinner> - </ng-template> -<!-- h2>On y travaille…</h2> -<p>Nos tuteurs t'informeront lors des premières inscriptions aux sorties !</p--> -</div> diff --git a/src_/app/members/visits/visits-list/visits-list.component.scss b/src_/app/members/visits/visits-list/visits-list.component.scss deleted file mode 100644 index 6703549f08dc49566b857f6e608cfd839d8441df..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/visits-list/visits-list.component.scss +++ /dev/null @@ -1,48 +0,0 @@ -@import '~app/showcase-site/sass/mixins'; - -#page { - @include margin-page; -} - -$grid-gap: 1em; -#visits { - list-style-type: none; - margin: 0 auto; - width: fit-content; - padding: 0; - display: grid; - grid-template-columns: 1fr; - @include media-xs { - grid-template-columns: repeat(2, 1fr); - } - @include media-md { - grid-template-columns: repeat(3, 1fr); - } - grid-auto-flow: dense; - grid-column-gap: $grid-gap; - grid-row-gap: $grid-gap; -} - -ul.tabs { - list-style-type: none; - margin: 0; - padding: 0; - display: flex; - flex-flow: row; - justify-content: center; - text-align: center; - margin-bottom: 2em; - li { - padding: 1em; - cursor: pointer; - color: $color-muted; - font-weight: bold; - &:hover { - color: $color-text; - } - &.active { - color: $color-dark-blue; - } - } - border-bottom: 1px solid $color-light-gray; -} diff --git a/src_/app/members/visits/visits-list/visits-list.component.ts b/src_/app/members/visits/visits-list/visits-list.component.ts deleted file mode 100644 index 721867d1456b3d06aecff507859612b63fd34046..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/visits-list/visits-list.component.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { Observable, BehaviorSubject, Subscription } from 'rxjs'; -import { tap, map, filter, find, first } from 'rxjs/operators'; -import { AuthService } from 'app/core'; -import { Visit, VisitService, Participant } from '../shared/'; - -@Component({ - selector: 'app-visits-list', - templateUrl: './visits-list.component.html', - styleUrls: ['./visits-list.component.scss'] -}) -export class VisitsListComponent implements OnInit { - - visits: Visit[]; - _passed = false; - participations$ = new BehaviorSubject<Participant[]>(null); - sub: Subscription = new Subscription(); - userId: number; - - constructor( - private visitService: VisitService, - private auth: AuthService, - private router: Router, - private route: ActivatedRoute, - ) { } - - ngOnInit() { - this.userId = this.auth.getUserSnapshot().id; - this.visits = this.route.snapshot.data['visits']; - const participations = [].concat(...this.visits.map(v => v.participants)); - this.participations$.next(participations); - this.sub.add(this.route.fragment.subscribe( - fragment => { - if (fragment === 'past') { - this._passed = true; - } else if (fragment === 'next') { - this._passed = false; - } - } - )); - } - - get passed(): boolean { - return this._passed; - } - - set passed(passed: boolean) { - this._passed = passed; - let opts: any = { relativeTo: this.route }; - if (passed) { - opts.fragment = 'past'; - } else { - opts.fragment = 'next'; - } - this.router.navigate(['./'], opts); - } - - userParticipant(visit: Visit): Observable<Participant> { - return this.participations$.pipe( - map(ps => ps.filter(p => p.visitId === visit.id)), - map(ps => ps.filter(p => p.user.id === this.userId)), - map(ps => ps[0]), - ); - } - - get displayedVisits(): Visit[] { - if (!this.visits) return []; - return this.visits.filter(visit => visit.passed === this.passed); - } - - ngOnDestroy() { - this.sub.unsubscribe(); - } -} diff --git a/src_/app/members/visits/visits-routing.module.ts b/src_/app/members/visits/visits-routing.module.ts deleted file mode 100644 index 417e819e8ea8400997a42c93c29521c348b65dbe..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/visits-routing.module.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { MapsAPIResolver } from 'app/core'; - -import { VisitsComponent } from './visits.component'; -import { VisitsListComponent } from './visits-list'; -import { VisitDetailComponent } from './visit-detail'; -import { VisitsResolver, VisitResolver } from './shared'; - -const routes: Routes = [ - { - path: '', - data: { title: 'Sorties' }, - component: VisitsComponent, - children: [ - { - path: '', component: VisitsListComponent, - resolve: { 'visits': VisitsResolver }, - }, - { - path: ':id', component: VisitDetailComponent, - resolve: { 'visit': VisitResolver, 'geocoder': MapsAPIResolver }, - }, - ], - }, -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class VisitsRoutingModule { } diff --git a/src_/app/members/visits/visits.component.html b/src_/app/members/visits/visits.component.html deleted file mode 100644 index e164c363d679af8981e4a54c53f997b0fb5c0c13..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/visits.component.html +++ /dev/null @@ -1,3 +0,0 @@ -<h1 class="text-center">Sorties</h1> -<messages></messages> -<router-outlet></router-outlet> diff --git a/src_/app/members/visits/visits.component.scss b/src_/app/members/visits/visits.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/members/visits/visits.component.ts b/src_/app/members/visits/visits.component.ts deleted file mode 100644 index 4b4c09039749b236f5a9d07f895d5d695c81ae0c..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/visits.component.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; - -@Component({ - selector: 'app-visits', - templateUrl: './visits.component.html', - styleUrls: ['./visits.component.scss'] -}) -export class VisitsComponent implements OnInit { - - constructor( private router: Router ) { } - - ngOnInit() { - } - -} diff --git a/src_/app/members/visits/visits.module.ts b/src_/app/members/visits/visits.module.ts deleted file mode 100644 index aaa13948d9e362f6c42248f7c021b63a56622512..0000000000000000000000000000000000000000 --- a/src_/app/members/visits/visits.module.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { NgModule } from '@angular/core'; - -// Modules -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; -import { RouterModule } from '@angular/router'; -import { AgmCoreModule } from '@agm/core'; -import { MomentModule } from 'ngx-moment'; -import { CoreModule } from 'app/core'; -import { SharedModule } from 'app/shared'; -import { VisitsRoutingModule } from './visits-routing.module'; - -// Components -import { VisitsComponent } from './visits.component'; -import { VisitsListComponent } from './visits-list/visits-list.component'; -import { ToggleButtonComponent } from './toggle-button/toggle-button.component'; -import { VisitCardComponent } from './visit-card/visit-card.component'; -import { VisitDetailComponent } from './visit-detail/visit-detail.component'; -import { RegistrationBadgeComponent } from './registration-badge/registration-badge.component'; -import { ParticipantNumberBadgeComponent } from './participant-number-badge/participant-number-badge.component'; -import { ParticipationBadgeComponent } from './participation-badge/participation-badge.component'; -import { UsefulInformationComponent } from './useful-information/useful-information.component'; -import { VisitLocationMapComponent } from './visit-location-map/visit-location-map.component'; -import { OrganizerCardComponent } from './organizer-card/organizer-card.component'; -import { LeaveFormComponent } from './leave-form/leave-form.component'; -import { RegisterFormComponent } from './register-form/register-form.component'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - MomentModule, - RouterModule, - AgmCoreModule, - CoreModule, - SharedModule, - VisitsRoutingModule, - ], - declarations: [ - VisitsComponent, - VisitsListComponent, - ToggleButtonComponent, - VisitCardComponent, - VisitDetailComponent, - LeaveFormComponent, - RegisterFormComponent, - RegistrationBadgeComponent, - ParticipantNumberBadgeComponent, - ParticipationBadgeComponent, - UsefulInformationComponent, - VisitLocationMapComponent, - OrganizerCardComponent, - ], -}) -export class VisitsModule { } diff --git a/src_/app/panes/index.ts b/src_/app/panes/index.ts deleted file mode 100644 index 5e6e851ba96b7d08b066282416c3f672b7dfad6d..0000000000000000000000000000000000000000 --- a/src_/app/panes/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './panes.module'; diff --git a/src_/app/panes/pane/pane.component.html b/src_/app/panes/pane/pane.component.html deleted file mode 100644 index f9dfff2777e58c37e0a741d9a04c7087780671a6..0000000000000000000000000000000000000000 --- a/src_/app/panes/pane/pane.component.html +++ /dev/null @@ -1,5 +0,0 @@ -<div class="pane"> - <div class="pane-content"> - <ng-content></ng-content> - </div> -</div> diff --git a/src_/app/panes/pane/pane.component.scss b/src_/app/panes/pane/pane.component.scss deleted file mode 100644 index a0ca093984bbaf4b4c4d6b9bd7c3168c4e1c3644..0000000000000000000000000000000000000000 --- a/src_/app/panes/pane/pane.component.scss +++ /dev/null @@ -1,12 +0,0 @@ -@import '~sass/mixins'; -@import '~sass/variables'; - -.pane { - height: 100%; - @include drop-shadow($shadow-sm, $inset: true); -} - -.pane-content { - padding: 3em; - width: fit-content; -} diff --git a/src_/app/panes/pane/pane.component.ts b/src_/app/panes/pane/pane.component.ts deleted file mode 100644 index 3d98c3dc72004bab5f6746ffb0d45be3f976e3e4..0000000000000000000000000000000000000000 --- a/src_/app/panes/pane/pane.component.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-pane', - templateUrl: './pane.component.html', - styleUrls: ['./pane.component.scss'] -}) -export class PaneComponent {} diff --git a/src_/app/panes/panes.module.ts b/src_/app/panes/panes.module.ts deleted file mode 100644 index b7b74763fb0c4f10e794858a8546faadb6470170..0000000000000000000000000000000000000000 --- a/src_/app/panes/panes.module.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; - -import { ThreePanesComponent } from './three-panes/three-panes.component'; -import { PaneComponent } from './pane/pane.component'; - -@NgModule({ - imports: [ - CommonModule - ], - declarations: [ - ThreePanesComponent, - PaneComponent, - ], - exports: [ - ThreePanesComponent, - PaneComponent, - ] -}) -export class PanesModule { } diff --git a/src_/app/panes/three-panes/three-panes.component.html b/src_/app/panes/three-panes/three-panes.component.html deleted file mode 100644 index 6dbc74306383aaa6efc4216ee6c449c3b38ceaa9..0000000000000000000000000000000000000000 --- a/src_/app/panes/three-panes/three-panes.component.html +++ /dev/null @@ -1 +0,0 @@ -<ng-content></ng-content> diff --git a/src_/app/panes/three-panes/three-panes.component.scss b/src_/app/panes/three-panes/three-panes.component.scss deleted file mode 100644 index 60c5bdc1a6a77686bb7b9979c7334d72dc2f3435..0000000000000000000000000000000000000000 --- a/src_/app/panes/three-panes/three-panes.component.scss +++ /dev/null @@ -1,9 +0,0 @@ -@import '~sass/media-queries'; - -:host { - display: grid; - grid-template-columns: 1fr; - @include media-xs { - grid-template-columns: 1fr 1fr 1fr; - } -} diff --git a/src_/app/panes/three-panes/three-panes.component.ts b/src_/app/panes/three-panes/three-panes.component.ts deleted file mode 100644 index 4167f7532cfa6f8f02fdbe3f4735d75bf17631ee..0000000000000000000000000000000000000000 --- a/src_/app/panes/three-panes/three-panes.component.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-three-panes', - templateUrl: './three-panes.component.html', - styleUrls: ['./three-panes.component.scss'] -}) -export class ThreePanesComponent {} diff --git a/src_/app/reset-confirm/reset-confirm.component.html b/src_/app/reset-confirm/reset-confirm.component.html deleted file mode 100644 index b9d07f9a30ba2ca9a6958783b04259985392e3fe..0000000000000000000000000000000000000000 --- a/src_/app/reset-confirm/reset-confirm.component.html +++ /dev/null @@ -1,24 +0,0 @@ -<app-form-page> - <h1>Réinitialiser le mot de passe</h1> - <form [formGroup]="formGroup" (ngSubmit)="resetConfirm()"> - - <!-- Password field --> - <mat-form-field class="block"> - <input matInput type="password" formControlName="new_password1" placeholder="Mot de passe" required autofocus /> - </mat-form-field> - - <!-- Confirm password --> - <mat-form-field class="block"> - <input matInput type="password" formControlName="new_password2" placeholder="Confirmer le mot de passe" required - autofocus /> - </mat-form-field> - - <!-- Submit--> - <div class="text-center"> - <button mat-raised-button color="primary" [disabled]="!formGroup.valid || loading" id="login-btn"> - Confirmer<i *ngIf="loading" class="fa fa-spinner fa-pulse"></i> - </button> - </div> - </form> - -</app-form-page> \ No newline at end of file diff --git a/src_/app/reset-confirm/reset-confirm.component.scss b/src_/app/reset-confirm/reset-confirm.component.scss deleted file mode 100644 index 2e0715852a867e745f1483f4f38c515007e32c31..0000000000000000000000000000000000000000 --- a/src_/app/reset-confirm/reset-confirm.component.scss +++ /dev/null @@ -1,38 +0,0 @@ -@import '~sass/variables'; -@import '~sass/mixins'; - -.logo { - width: 100%; - max-width: 20em; - height: auto; - display: block; - margin: auto; -} - -.form-group { - display: flex; - flex-flow: column; -} - -.has-error { - input { - @include style-danger; - } -} -#login-btn { - margin-top: 1em; -} - -.form-control { - position: relative; - font-size: 16px; - height: auto; - padding: 10px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -.block { - width: 100%; -} diff --git a/src_/app/reset-confirm/reset-confirm.component.spec.ts b/src_/app/reset-confirm/reset-confirm.component.spec.ts deleted file mode 100644 index 4d5f02d9a5b900816071e1606ffd0e818bd5cced..0000000000000000000000000000000000000000 --- a/src_/app/reset-confirm/reset-confirm.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ResetConfirmComponent } from './reset-confirm.component'; - -describe('ResetConfirmComponent', () => { - let component: ResetConfirmComponent; - let fixture: ComponentFixture<ResetConfirmComponent>; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ ResetConfirmComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(ResetConfirmComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src_/app/reset-confirm/reset-confirm.component.ts b/src_/app/reset-confirm/reset-confirm.component.ts deleted file mode 100644 index cc2502362d0b5d579ce32a636720f65f2b9a625d..0000000000000000000000000000000000000000 --- a/src_/app/reset-confirm/reset-confirm.component.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { Router, ActivatedRoute } from '@angular/router'; -import { FormGroup, FormBuilder } from '@angular/forms'; -import { MatSnackBar } from '@angular/material'; -import { AuthService, MessageService } from 'app/core'; -import { of } from 'rxjs'; -import { filter, map, tap, catchError } from 'rxjs/operators'; - -@Component({ - selector: 'app-reset-confirm', - templateUrl: './reset-confirm.component.html', - styleUrls: ['./reset-confirm.component.scss'] -}) -export class ResetConfirmComponent implements OnInit { - - loading: boolean = false; - defaultRedirectUrl: string = '/connexion'; - formGroup: FormGroup; - public uid: string; - public token: string; - - constructor( - private router: Router, - private auth: AuthService, - private messageService: MessageService, - private fb: FormBuilder, - private snackBar: MatSnackBar, - private route: ActivatedRoute - ) { } - - ngOnInit() { - if (this.auth.fromGuard) { - this.messageService.error('Oops ! Vous devez vous connecter pour accéder à cette page.'); - } - if (this.auth.fromUnauthorized) { - this.messageService.error("Oops ! Vous n'avez pas les permissions requises pour accéder à cette page."); - } - - this.createForm(); - this.uid = this.route.snapshot.paramMap.get('uid'); - this.token = this.route.snapshot.paramMap.get('token'); - console.log(this.uid); - console.log(this.token); - } - private createForm() { - this.formGroup = this.fb.group({ - new_password1: '', - new_password2: '' - }); - } - - resetConfirm() { - this.loading = true; - const { new_password1, new_password2 } = this.formGroup.value; - this.messageService.clear(); - this.auth.resetConfirm(this.uid, this.token, new_password1, new_password2).pipe( - catchError(() => { - this.snackBar.open('Erreur lors de la réinitialisation du mot de passe : vérifiez que les mots de passes sont identiques et assez forts (8 caractères). Evitez également les mots de passes courants', 'OK', { duration: 5000 }); - return of(false); - }), - tap(() => this.loading = false), - filter(Boolean), - map(() =>this.auth.redirectUrl ? this.auth.redirectUrl : this.defaultRedirectUrl), - tap(() => this.snackBar.open('Mot de passe réinitialisé', 'OK', { duration: 2000 })), - tap((redirectUrl: string) => this.router.navigate([redirectUrl])), - ).subscribe()} - -} diff --git a/src_/app/reset/reset.component.html b/src_/app/reset/reset.component.html deleted file mode 100644 index eee197047ddcc91ac09e79faf39fda5ac6a55fc8..0000000000000000000000000000000000000000 --- a/src_/app/reset/reset.component.html +++ /dev/null @@ -1,19 +0,0 @@ -<app-form-page> - <h1>Réinitialisation du mot de passe</h1> - - <form [formGroup]="formGroup" (ngSubmit)="reset()"> - - <!-- Email field --> - <mat-form-field class="block"> - <input matInput type="email" formControlName="email" required placeholder="Adresse email" autofocus> - </mat-form-field> - - <!-- Submit --> - <div class="text-center"> - <button mat-raised-button color="primary" [disabled]="!formGroup.valid || loading" id="login-btn"> - Recevoir un mail<i *ngIf="loading" class="fa fa-spinner fa-pulse"></i> - </button> - </div> - </form> - -</app-form-page> \ No newline at end of file diff --git a/src_/app/reset/reset.component.scss b/src_/app/reset/reset.component.scss deleted file mode 100644 index 2e0715852a867e745f1483f4f38c515007e32c31..0000000000000000000000000000000000000000 --- a/src_/app/reset/reset.component.scss +++ /dev/null @@ -1,38 +0,0 @@ -@import '~sass/variables'; -@import '~sass/mixins'; - -.logo { - width: 100%; - max-width: 20em; - height: auto; - display: block; - margin: auto; -} - -.form-group { - display: flex; - flex-flow: column; -} - -.has-error { - input { - @include style-danger; - } -} -#login-btn { - margin-top: 1em; -} - -.form-control { - position: relative; - font-size: 16px; - height: auto; - padding: 10px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -.block { - width: 100%; -} diff --git a/src_/app/reset/reset.component.spec.ts b/src_/app/reset/reset.component.spec.ts deleted file mode 100644 index 15ce951092d54ab68fdd487dd9d340edc08439fc..0000000000000000000000000000000000000000 --- a/src_/app/reset/reset.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ResetComponent } from './reset.component'; - -describe('ResetComponent', () => { - let component: ResetComponent; - let fixture: ComponentFixture<ResetComponent>; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ ResetComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(ResetComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src_/app/reset/reset.component.ts b/src_/app/reset/reset.component.ts deleted file mode 100644 index f35be7adbddac5fb4410176634036a50b7b5f981..0000000000000000000000000000000000000000 --- a/src_/app/reset/reset.component.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; -import { FormGroup, FormBuilder } from '@angular/forms'; -import { MatSnackBar } from '@angular/material'; -import { AuthService, MessageService } from 'app/core'; -import { of } from 'rxjs'; -import { filter, map, tap, catchError } from 'rxjs/operators'; - -@Component({ - selector: 'app-reset', - templateUrl: './reset.component.html', - styleUrls: ['./reset.component.scss'] -}) -export class ResetComponent implements OnInit { - - loading: boolean = false; - defaultRedirectUrl: string = '/'; - formGroup: FormGroup; - - constructor( - private router: Router, - private auth: AuthService, - private messageService: MessageService, - private fb: FormBuilder, - private snackBar: MatSnackBar, - ) { } - - ngOnInit() { - if (this.auth.fromGuard) { - this.messageService.error('Oops ! Vous devez vous connecter pour accéder à cette page.'); - } - if (this.auth.fromUnauthorized) { - this.messageService.error("Oops ! Vous n'avez pas les permissions requises pour accéder à cette page."); - } - this.createForm(); - } - - private createForm() { - this.formGroup = this.fb.group({ - email: '', - }); - } - - reset() { - this.loading = true; - const { email } = this.formGroup.value; - this.messageService.clear(); - this.auth.reset(email).pipe( - catchError(() => { - this.snackBar.open('Adresse incorrecte', 'OK', { duration: 5000 }); - return of(false); - }), - tap(() => this.loading = false), - filter(Boolean), - map(() =>this.auth.redirectUrl ? this.auth.redirectUrl : this.defaultRedirectUrl), - tap(() => this.snackBar.open('Mail de réinitialisation envoyé !', 'OK', { duration: 2000 })), - tap((redirectUrl: string) => this.router.navigate([redirectUrl])), - ).subscribe()} -} diff --git a/src_/app/shared/filter/filter.component.html b/src_/app/shared/filter/filter.component.html deleted file mode 100644 index 6b02d4746ae4cd50340b9c12054f9088365a31ed..0000000000000000000000000000000000000000 --- a/src_/app/shared/filter/filter.component.html +++ /dev/null @@ -1,9 +0,0 @@ -<div class="filter-group"> - <strong>{{ title }}</strong> - <ul class="choices"> - <li *ngFor="let value of values" (click)="select(value)" [ngClass]="{'selected': current === value}"> - {{ value }} - <span class="badge badge-default" *ngIf="counted">{{ numberOf(value) }}</span> - </li> - </ul> -</div> diff --git a/src_/app/shared/filter/filter.component.scss b/src_/app/shared/filter/filter.component.scss deleted file mode 100644 index b06109c03e12a3efcd09a5b367faf75ce7fb909d..0000000000000000000000000000000000000000 --- a/src_/app/shared/filter/filter.component.scss +++ /dev/null @@ -1,25 +0,0 @@ -@import '~app/showcase-site/sass/mixins'; - - -ul.choices { - list-style-type: none; - margin: .3em 0 .6em 0; - padding: 0; - font-weight: normal; - li { - cursor: pointer; - padding: .3em 1em; - display: flex; - justify-content: space-between; - align-items: center; - border-radius: 3px; - &:hover { - color: $color-dark-blue; - background-color: lighten($color-light-blue, 5%); - } - } -} -.selected { - color: $color-dark-blue !important; - background-color: $color-light-blue !important; -} diff --git a/src_/app/shared/filter/filter.component.ts b/src_/app/shared/filter/filter.component.ts deleted file mode 100644 index e8140c4bfc71e8cac06f93ffa9a5e149e94dafd9..0000000000000000000000000000000000000000 --- a/src_/app/shared/filter/filter.component.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { Component, Input, Output, OnInit, EventEmitter } from '@angular/core'; - -@Component({ - selector: 'app-filter', - templateUrl: './filter.component.html', - styleUrls: ['./filter.component.scss'] -}) -export class FilterComponent implements OnInit { - - @Input() values: string[]; - @Input() title: string; - current: string; - @Output() onSelect = new EventEmitter<string>(); - @Input() countContains: any[]; - - constructor() { } - - ngOnInit() { - this.current = null; - } - - select(value: string): void { - if (this.current === value) { - this.current = null; - } else {this.current = value;} - this.onSelect.emit(this.current); - } - - numberOf(value: string): number { - if (this.countContains) { - return this.countContains.filter(x => x.includes(value)).length; - } - return 0; - } - - get counted(): boolean { - return (this.countContains !== null); - } - -} diff --git a/src_/app/shared/footer/footer.component.html b/src_/app/shared/footer/footer.component.html deleted file mode 100644 index 41e8c7410dccdfcab395caddc6980b33d3bc4daf..0000000000000000000000000000000000000000 --- a/src_/app/shared/footer/footer.component.html +++ /dev/null @@ -1,25 +0,0 @@ -<div id="footer" class="drop-shadow-md"> - <ul class="list"> - <!-- - <li> - Newsletter : recevez toute notre actualité - <a href="#" class="newsletter-button">M'inscrire</a> - </li> - --> - <li> - <a [routerLink]="'/contact'">Contact</a> - </li> - <li> - <!-- TODO add router link --> - <a [routerLink]="'/mentions-legales'">Mentions légales & crédits</a> - </li> - </ul> - <ul class="list"> - <a target="_blank" href="https://www.facebook.com/OSERCentraleSupelec/"> - <i class="social fa fa-2x fa-facebook"></i> - </a> - <a target="_blank" href="https://twitter.com/OSER_CS"> - <i class="social fa fa-2x fa-twitter"></i> - </a> - </ul> -</div> diff --git a/src_/app/shared/footer/footer.component.scss b/src_/app/shared/footer/footer.component.scss deleted file mode 100644 index ad2a00fd28893e54be1f0606679c9e2cf9f78113..0000000000000000000000000000000000000000 --- a/src_/app/shared/footer/footer.component.scss +++ /dev/null @@ -1,44 +0,0 @@ -@import '~app/showcase-site/sass/variables'; -@import '~app/showcase-site/sass/mixins'; -@import '~sass/media-queries'; - -$background: $color-darkest-blue; -$text: $color-purple-light; - -#footer { - @include margin-page; - position: relative; - z-index: 10; - background: $background; - color: $text; - display: flex; - flex-flow: row wrap; - justify-content: space-between; - a { - color: inherit; - } -} - -ul.list { - display: flex; - flex-flow: row wrap; - justify-content: start; - align-items: center; - list-style-type: none; - margin: .5em 0; - padding: 0; - li { - display: flex; - flex-flow: row wrap; - align-items: center; - margin: .5em 1em; - } -} -.newsletter-button { - display: inline-block; - @include btn($text, $background); -} -.social { - margin: 0 0.5em; - color: $color-light-blue; -} diff --git a/src_/app/shared/footer/footer.component.ts b/src_/app/shared/footer/footer.component.ts deleted file mode 100644 index da17d824231ebb84b3dd5872e8ad33b5ef659771..0000000000000000000000000000000000000000 --- a/src_/app/shared/footer/footer.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-footer', - templateUrl: './footer.component.html', - styleUrls: ['./footer.component.scss'] -}) -export class FooterComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/src_/app/shared/form-page/form-page.component.html b/src_/app/shared/form-page/form-page.component.html deleted file mode 100644 index afd03907fe4d3fefc497dc134942276329e5dd38..0000000000000000000000000000000000000000 --- a/src_/app/shared/form-page/form-page.component.html +++ /dev/null @@ -1,6 +0,0 @@ -<div class="well"> - <a routerLink="/"> - <img *ngIf="logo" class="logo" src="assets/img/oser-logo.png" alt=""> - </a> - <ng-content></ng-content> -</div> diff --git a/src_/app/shared/form-page/form-page.component.scss b/src_/app/shared/form-page/form-page.component.scss deleted file mode 100644 index c341cffd45687464ab063e02d860cd1ae3a437e3..0000000000000000000000000000000000000000 --- a/src_/app/shared/form-page/form-page.component.scss +++ /dev/null @@ -1,33 +0,0 @@ -@import '~sass/variables'; -@import '~sass/mixins'; -@import '~sass/media-queries'; - -:host { - display: flex; - flex-flow: column nowrap; - align-items: center; - min-height: 100vh; - background: $color-light-gray; - padding: 1em; -} - -.well { - width: 100%; - max-width: 40em; - background: white; - border: 1px solid lightgray; - border-radius: 8px; - padding: 1em; - @include media-xs { - padding: 2em 3em; - } - box-sizing: border-box; -} - -.logo { - width: 100%; - max-width: 20em; - height: auto; - display: block; - margin: auto; -} diff --git a/src_/app/shared/form-page/form-page.component.ts b/src_/app/shared/form-page/form-page.component.ts deleted file mode 100644 index aa8bb4c4a85cda083837d5dcd0eaa31d840a21bd..0000000000000000000000000000000000000000 --- a/src_/app/shared/form-page/form-page.component.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Component, Input } from '@angular/core'; - -/** Container for building components that display a simple form (like login or registration) */ -@Component({ - selector: 'app-form-page', - templateUrl: './form-page.component.html', - styleUrls: ['./form-page.component.scss'] -}) -export class FormPageComponent { - @Input() logo = true; -} diff --git a/src_/app/shared/index.ts b/src_/app/shared/index.ts deleted file mode 100644 index 772b50734347d0d7ee20f81ae94214221043bf48..0000000000000000000000000000000000000000 --- a/src_/app/shared/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './shared.module'; -export * from './navbar/navbar.component'; -export * from './footer/footer.component'; -export * from './ui-gallery/ui-gallery.component'; -export * from './nav.model'; diff --git a/src_/app/shared/layout/layout.component.html b/src_/app/shared/layout/layout.component.html deleted file mode 100644 index 20b9d419800a57a6c4c0e110db2c765aecad6419..0000000000000000000000000000000000000000 --- a/src_/app/shared/layout/layout.component.html +++ /dev/null @@ -1,10 +0,0 @@ -<div id="layout"> - <app-navbar [links]="links" [theme]="theme"> - <ng-content app-navbar-extra select="[app-navbar-extra]"></ng-content> - <ng-content app-navbar-extra-narrow select="[app-navbar-extra-narrow]"></ng-content> - </app-navbar> - <main class="content"> - <router-outlet (deactivate)="onDeactivate()"></router-outlet> - </main> - <app-footer></app-footer> -</div> diff --git a/src_/app/shared/layout/layout.component.scss b/src_/app/shared/layout/layout.component.scss deleted file mode 100644 index dbb1a1a4d4cd1207f51b99188c1c122225b6b9b8..0000000000000000000000000000000000000000 --- a/src_/app/shared/layout/layout.component.scss +++ /dev/null @@ -1,14 +0,0 @@ -/* -Sticky footer solution from -https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ -*/ -#layout { - display: flex; - min-height: 100vh; - flex-direction: column; -} - -/* Make main content expand to pull footer to the bottom */ -.content { - flex: 1; -} diff --git a/src_/app/shared/layout/layout.component.ts b/src_/app/shared/layout/layout.component.ts deleted file mode 100644 index a362fcd1b9887f47921c382a44d5828e49def8f9..0000000000000000000000000000000000000000 --- a/src_/app/shared/layout/layout.component.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Component, Input, Renderer } from '@angular/core'; -import { Link } from '../nav.model'; - - -@Component({ - selector: 'app-layout', - templateUrl: './layout.component.html', - styleUrls: ['./layout.component.scss'] -}) -export class LayoutComponent { - - @Input() links: Link[]; - @Input() theme: string; - - constructor(private renderer: Renderer) { - this.links = []; - } - - onDeactivate() { - // on page reload, scroll to top of window - this.renderer.setElementProperty(document.body, 'scrollTop', 0); - } - -} diff --git a/src_/app/shared/load-spinner/load-spinner.component.html b/src_/app/shared/load-spinner/load-spinner.component.html deleted file mode 100644 index 23f5148c1ffc77820d6cf482ea9beed78bedede9..0000000000000000000000000000000000000000 --- a/src_/app/shared/load-spinner/load-spinner.component.html +++ /dev/null @@ -1,8 +0,0 @@ -<div class="text-center" *ngIf="block; else notBlock"> - <i class="fa fa-pulse fa-spinner"></i> -</div> -<ng-template #notBlock> - <span class="text-center"> - <i class="fa fa-pulse fa-spinner"></i> - </span> -</ng-template> diff --git a/src_/app/shared/load-spinner/load-spinner.component.scss b/src_/app/shared/load-spinner/load-spinner.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/shared/load-spinner/load-spinner.component.ts b/src_/app/shared/load-spinner/load-spinner.component.ts deleted file mode 100644 index 357e1157c692062277ea9b685d9cf1a8f24808d2..0000000000000000000000000000000000000000 --- a/src_/app/shared/load-spinner/load-spinner.component.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Component, Input } from '@angular/core'; - -@Component({ - selector: 'app-load-spinner', - templateUrl: './load-spinner.component.html', - styleUrls: ['./load-spinner.component.scss'] -}) -export class LoadSpinnerComponent { - - @Input() block = true; - -} diff --git a/src_/app/shared/login-button/login-button.component.html b/src_/app/shared/login-button/login-button.component.html deleted file mode 100644 index fd628506fc92d6e08f7ead0151da9bc7380f2a0d..0000000000000000000000000000000000000000 --- a/src_/app/shared/login-button/login-button.component.html +++ /dev/null @@ -1,4 +0,0 @@ -<a *ngIf="!user" routerLink="/connexion">Connexion</a> -<a *ngIf="user" routerLink="/membres"> - <mat-icon inline="true">person</mat-icon> {{ user.fullName }} -</a> diff --git a/src_/app/shared/login-button/login-button.component.scss b/src_/app/shared/login-button/login-button.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/shared/login-button/login-button.component.ts b/src_/app/shared/login-button/login-button.component.ts deleted file mode 100644 index 49da19285fd9dec86b8515a0b1b5a539e4d22cce..0000000000000000000000000000000000000000 --- a/src_/app/shared/login-button/login-button.component.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Component, OnInit, OnDestroy } from '@angular/core'; -import { tap } from 'rxjs/operators'; -import { Subscription } from 'rxjs'; -import { AuthService, User } from 'app/core'; - -@Component({ - selector: 'app-login-button', - templateUrl: './login-button.component.html', - styleUrls: ['./login-button.component.scss'] -}) -export class LoginButtonComponent implements OnInit, OnDestroy { - - user: User; - private sub = new Subscription(); - - constructor(private auth: AuthService) { } - - ngOnInit() { - const sub = this.auth.getUser().pipe( - tap((user) => this.user = user), - ).subscribe(); - this.sub.add(sub); - } - - ngOnDestroy() { - this.sub.unsubscribe(); - } - -} diff --git a/src_/app/shared/mailto/mailto.component.html b/src_/app/shared/mailto/mailto.component.html deleted file mode 100644 index 0ae49466d7f477db212ee31ef44da4bae547d8dc..0000000000000000000000000000000000000000 --- a/src_/app/shared/mailto/mailto.component.html +++ /dev/null @@ -1,3 +0,0 @@ -<a [href]="href"> - <ng-content></ng-content> -</a> diff --git a/src_/app/shared/mailto/mailto.component.scss b/src_/app/shared/mailto/mailto.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/shared/mailto/mailto.component.ts b/src_/app/shared/mailto/mailto.component.ts deleted file mode 100644 index e7a0037a58334c728d599a8223f7997d8e380aa9..0000000000000000000000000000000000000000 --- a/src_/app/shared/mailto/mailto.component.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Component, Input } from '@angular/core'; - -@Component({ - selector: 'app-mailto', - templateUrl: './mailto.component.html', - styleUrls: ['./mailto.component.scss'] -}) -export class MailtoComponent { - - @Input() dest = 'contact@oser-cs.fr'; - @Input() subject = ''; - @Input() label: string; - - get href(): string { - return `mailto:${this.dest}?subject=${this.subject}`; - } - -} diff --git a/src_/app/shared/nav-group/nav-group.component.html b/src_/app/shared/nav-group/nav-group.component.html deleted file mode 100644 index a184f3b149c406c3d42a0efd7a43b6b2521dc3de..0000000000000000000000000000000000000000 --- a/src_/app/shared/nav-group/nav-group.component.html +++ /dev/null @@ -1,5 +0,0 @@ -<ul [ngClass]="{'vertical': vertical}"> - <li *ngFor="let link of links"> - <app-nav-item [link]="link" [theme]="theme"></app-nav-item> - </li> -</ul> diff --git a/src_/app/shared/nav-group/nav-group.component.scss b/src_/app/shared/nav-group/nav-group.component.scss deleted file mode 100644 index 71a11ba4efce736322ffe672e4102160b5dbc765..0000000000000000000000000000000000000000 --- a/src_/app/shared/nav-group/nav-group.component.scss +++ /dev/null @@ -1,17 +0,0 @@ -ul { - list-style-type: none; - margin: 0; - padding: 0; - display: flex; - &.vertical { - flex-direction: column; - } - - &.vertical { - flex-direction: column; - } - - li { - text-align: center; - } -} diff --git a/src_/app/shared/nav-group/nav-group.component.ts b/src_/app/shared/nav-group/nav-group.component.ts deleted file mode 100644 index 44d9d7587ded708ea78c4fe35ba70aac9759625d..0000000000000000000000000000000000000000 --- a/src_/app/shared/nav-group/nav-group.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { Link } from '../nav.model'; - -@Component({ - selector: 'app-nav-group', - templateUrl: './nav-group.component.html', - styleUrls: ['./nav-group.component.scss'] -}) -export class NavGroupComponent { - - @Input() links: Link[]; - @Input() theme: string; - @Input() vertical = false; - -} diff --git a/src_/app/shared/nav-item/nav-item.component.html b/src_/app/shared/nav-item/nav-item.component.html deleted file mode 100644 index 0052aa0e74af78f18dd75321bd8733d2f1e4bafa..0000000000000000000000000000000000000000 --- a/src_/app/shared/nav-item/nav-item.component.html +++ /dev/null @@ -1,8 +0,0 @@ -<div class="nav-link" [ngClass]="{'blue': theme === 'blue'}"> - <a *ngIf="link.href; else action" class="no-style" [routerLink]="link.href"> - {{ link.text }} - </a> - <ng-template #action> - <div class="clickable" (click)="link.action()">{{ link.text }}</div> - </ng-template> -</div> diff --git a/src_/app/shared/nav-item/nav-item.component.scss b/src_/app/shared/nav-item/nav-item.component.scss deleted file mode 100644 index bc6391e9d67366425218822da8981e78aaa1c183..0000000000000000000000000000000000000000 --- a/src_/app/shared/nav-item/nav-item.component.scss +++ /dev/null @@ -1,30 +0,0 @@ -@import '~sass/variables'; - -.nav-link { - text-decoration: none; - color: $color-purple; - font-weight: bold; - padding: 1em .5em; - box-sizing: border-box; - border-bottom: 2px solid transparent; - transition: color 200ms, border-color 200ms; - - a { - display: block; - } - - &:hover { - color: $color-dark-blue; - border-color: $color-dark-blue; - } - - &.blue { - color: $color-purple-light; - &:hover { - &:hover { - color: $color-light-gray; - border-color: $color-light-gray; - } - } - } -} diff --git a/src_/app/shared/nav-item/nav-item.component.ts b/src_/app/shared/nav-item/nav-item.component.ts deleted file mode 100644 index 25168ec968ade09e165b7a8ad5faa5348e148001..0000000000000000000000000000000000000000 --- a/src_/app/shared/nav-item/nav-item.component.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { Link } from '../nav.model'; - -@Component({ - selector: 'app-nav-item', - templateUrl: './nav-item.component.html', - styleUrls: ['./nav-item.component.scss'] -}) -export class NavItemComponent { - - @Input() link: Link; - @Input() theme: string; - -} diff --git a/src_/app/shared/nav.model.ts b/src_/app/shared/nav.model.ts deleted file mode 100644 index 704f34e025629baf10ca10a19501a4f860cc807d..0000000000000000000000000000000000000000 --- a/src_/app/shared/nav.model.ts +++ /dev/null @@ -1,5 +0,0 @@ -export class Link { - href?: string; - action?: () => void; - text: string; -} diff --git a/src_/app/shared/navbar/navbar.component.html b/src_/app/shared/navbar/navbar.component.html deleted file mode 100644 index 383d7eddf635ba28d3311c3907552bc132f6087c..0000000000000000000000000000000000000000 --- a/src_/app/shared/navbar/navbar.component.html +++ /dev/null @@ -1,19 +0,0 @@ -<div class="navbar drop-shadow-md" [ngClass]="{'blue': theme === 'blue'}"> - <div class="top"> - <a routerLink="/" class='logo-container'> - <span [ngSwitch]="theme"> - <img *ngSwitchCase="'blue'" src='assets/img/oser-logo-white.png' alt='Logo' class='logo'> - <img *ngSwitchDefault src='assets/img/oser-logo.png' alt='Logo' class='logo'> - </span> - </a> - <div class="nav-wide"> - <app-nav-group [theme]="theme" [links]="links"></app-nav-group> - <ng-content select="[app-navbar-extra]"></ng-content> - </div> - <i (click)="toggle()" class="hamburger fa fa-bars fa-2x"></i> - </div> - <div class="nav-narrow" *ngIf="visible"> - <app-nav-group [links]="links" [vertical]="true" [theme]="theme" (click)="toggle()"></app-nav-group> - <ng-content select="[app-navbar-extra-narrow]"></ng-content> - </div> -</div> diff --git a/src_/app/shared/navbar/navbar.component.scss b/src_/app/shared/navbar/navbar.component.scss deleted file mode 100644 index 1e058e1dbadfc2faf6fb6133d0022e816329df72..0000000000000000000000000000000000000000 --- a/src_/app/shared/navbar/navbar.component.scss +++ /dev/null @@ -1,71 +0,0 @@ -@import '~sass/media-queries'; -@import '~sass/variables'; -$margin-page: 2em; -$col-padding: 10px; - -.navbar { - position: static; - top: 0; - padding: 0 $margin-page; - margin: 0; - background: white; - &.blue { - background: $color-dark-blue; - i.hamburger { - color: white !important; - } - } - z-index: 10; - display: flex; - flex-flow: column nowrap; -} - -.top { - display: flex; - flex-direction: row; - align-items: center; - width: 100%; -} - -a.logo-container { - display: block; - padding: $col-padding; - margin: 0; - margin-right: auto; -} - -img.logo { - width: 100%; - max-width: 15em; - padding-top: .3em; - padding-bottom: .2em; -} - -i.hamburger { - cursor: pointer; - margin-left: auto; - margin-right: 0; - color: $color-dark-blue; - display: block; - @include media-md { - display: none; - } -} - -.nav-wide { - height: 100%; - margin-top: auto; - display: none; - flex: 1; - @include media-md { - display: flex; - justify-content: space-between; - } -} - -.nav-narrow { - display: block; - @include media-md() { - display: none; - } -} diff --git a/src_/app/shared/navbar/navbar.component.ts b/src_/app/shared/navbar/navbar.component.ts deleted file mode 100644 index 031453b766d6ed7a1d4639b10f81719d4865373f..0000000000000000000000000000000000000000 --- a/src_/app/shared/navbar/navbar.component.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { AuthService } from 'app/core'; -import { Link } from '../nav.model'; - -@Component({ - selector: 'app-navbar', - templateUrl: './navbar.component.html', - styleUrls: ['./navbar.component.scss'] -}) -export class NavbarComponent { - - visible = false; - @Input() links: Link[] = []; - @Input() theme: string; - - constructor() { } - - toggle(): void { - this.visible = !this.visible; - } - -} diff --git a/src_/app/shared/reveal/reveal.component.html b/src_/app/shared/reveal/reveal.component.html deleted file mode 100644 index afbd0962a5681af68c5a8a2c754e547c51e274fc..0000000000000000000000000000000000000000 --- a/src_/app/shared/reveal/reveal.component.html +++ /dev/null @@ -1,4 +0,0 @@ -<span *ngIf="revealed"> - {{ content }} -</span> -<span *ngIf="!revealed" class="click-to-reveal" (click)="revealed = true">{{ label }}</span> diff --git a/src_/app/shared/reveal/reveal.component.scss b/src_/app/shared/reveal/reveal.component.scss deleted file mode 100644 index 827830b08fd56984097ba8e410c1782204c9ee64..0000000000000000000000000000000000000000 --- a/src_/app/shared/reveal/reveal.component.scss +++ /dev/null @@ -1,11 +0,0 @@ -@import '~sass/variables'; - -.click-to-reveal { - background: $color-light-gray; - padding: .5em; - cursor: pointer; - &:hover { - background: $color-light-blue; - } - border-radius: 4px; -} diff --git a/src_/app/shared/reveal/reveal.component.ts b/src_/app/shared/reveal/reveal.component.ts deleted file mode 100644 index 1739ddbce47218af944acdd55e89f85c5344a187..0000000000000000000000000000000000000000 --- a/src_/app/shared/reveal/reveal.component.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Component, Input } from '@angular/core'; - -@Component({ - selector: 'app-reveal', - templateUrl: './reveal.component.html', - styleUrls: ['./reveal.component.scss'] -}) -export class RevealComponent { - - @Input() content: string; - @Input() label = 'Révéler'; - revealed = false; - -} diff --git a/src_/app/shared/shared.module.ts b/src_/app/shared/shared.module.ts deleted file mode 100644 index cd9eff2cdd7893b70d42d299e69d0e27012e9279..0000000000000000000000000000000000000000 --- a/src_/app/shared/shared.module.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { RouterModule } from '@angular/router'; -import { FormsModule } from '@angular/forms'; -import { - MatIconModule, -} from '@angular/material'; -import { CoreModule } from 'app/core'; -import { NavbarComponent } from './navbar/navbar.component'; -import { FooterComponent } from './footer/footer.component'; -import { UiGalleryComponent } from './ui-gallery/ui-gallery.component'; -import { LoadSpinnerComponent } from './load-spinner/load-spinner.component'; -import { RevealComponent } from './reveal/reveal.component'; -import { FilterComponent } from './filter/filter.component'; -import { NavItemComponent } from './nav-item/nav-item.component'; -import { NavGroupComponent } from './nav-group/nav-group.component'; -import { MailtoComponent } from './mailto/mailto.component'; - -import { LoginButtonComponent } from './login-button/login-button.component'; -import { FormPageComponent } from './form-page/form-page.component'; -import { LayoutComponent } from './layout/layout.component'; - -@NgModule({ - imports: [ - CommonModule, - RouterModule, - FormsModule, - CoreModule, - MatIconModule, - ], - declarations: [ - NavbarComponent, - FooterComponent, - UiGalleryComponent, - LoadSpinnerComponent, - RevealComponent, - FilterComponent, - NavItemComponent, - NavGroupComponent, - MailtoComponent, - LoginButtonComponent, - FormPageComponent, - LayoutComponent, - ], - exports: [ - NavbarComponent, - FooterComponent, - LoadSpinnerComponent, - RevealComponent, - FilterComponent, - NavGroupComponent, - MailtoComponent, - LoginButtonComponent, - FormPageComponent, - LayoutComponent, - ] -}) -export class SharedModule { } diff --git a/src_/app/shared/ui-gallery/ui-gallery.component.html b/src_/app/shared/ui-gallery/ui-gallery.component.html deleted file mode 100644 index d6bef940cd785dbe339ea2530e086a5cafd25d47..0000000000000000000000000000000000000000 --- a/src_/app/shared/ui-gallery/ui-gallery.component.html +++ /dev/null @@ -1,99 +0,0 @@ -<div class="page"> - <h1>Gallerie des styles</h1> - - <h2>Les basiques</h2> - - <div id="margin-page" class="bg page"> - .page <br /> - Les marges internes de ce conteneur sont plus petites sur un écran plus petit (aussi appliqué à cette page entière). - </div> - - <br /> - - <div class="bg text-center"> - .text-center - </div> - - <p><a href="#">a (Un simple lien)</a></p> - - <a class="no-style" href="#"> - <div class="bg"> - a.no-style <br /> - Permet de rendre un élément entier cliquable en l'entourant d'une balise <code>a.no-style</code>. - </div> - </a> - - <div id="headers"> - <h1>Titre 1</h1> - <h2>Titre 2</h2> - <h3>Titre 3</h3> - <h4>Titre 4</h4> - <h5>Titre 5</h5> - <h6>Titre 6</h6> - </div> - - <p class="text-muted-sm">.text-muted : un texte adouci</p> - - <p> - Une entrée de texte : - <input type="text" placeholder="Prénom"> - </p> - - <p> - Boîte de sélection : - <select class="" name=""> - <option value="1">Option 1</option> - <option value="2">Option 2</option> - </select> - </p> - - <h2>Badges</h2> - - <p> - À placer dans un <code>div class="badge-list"</code> pour garantir le reflow des badges (redimensionnez la page pour voir !). - </p> - <div class="badge-list"> - <div *ngFor="let style of styles" [innerHTML]="badgeHtml(style)"></div> - </div> - <p>Version agrandie : <span class="badge badge-info badge-lg">badge badge-lg badge-info</span></p> - <p>Version réduite : <span class="badge badge-info badge-sm">badge badge-sm badge-info</span></p> - - <h2>Alertes</h2> - <div class=""> - <div *ngFor="let style of styles" [innerHTML]="alertHtml(style)"></div> - </div> - - <h2>Boutons</h2> - <div class=""> - <button *ngFor="let style of styles" [className]="buttonClass(style)">.btn-{{ style }}</button> - </div> - - <h2>Effets</h2> - - <h3>Ombres</h3> - - <div id="shadows"> - <div id="shadow" class="bg drop-shadow-sm"> - .drop-shadow-sm - </div> - <div id="shadow" class="bg drop-shadow-md"> - .drop-shadow-lg - </div> - <div id="shadow" class="bg drop-shadow-lg"> - .drop-shadow-lg - </div> - </div> - - <h3>Animation : raise</h3> - <div id="shadows"> - <div id="shadow" class="bg drop-shadow-sm-md"> - .drop-shadow-sm-md - </div> - <div id="shadow" class="bg drop-shadow-md-lg"> - .drop-shadow-md-lg - </div> - <div id="shadow" class="bg drop-shadow-sm-lg"> - .drop-shadow-sm-lg - </div> - </div> -</div> diff --git a/src_/app/shared/ui-gallery/ui-gallery.component.scss b/src_/app/shared/ui-gallery/ui-gallery.component.scss deleted file mode 100644 index 0c8e52f9579f38d4c8574348c98fcc2f683b0cce..0000000000000000000000000000000000000000 --- a/src_/app/shared/ui-gallery/ui-gallery.component.scss +++ /dev/null @@ -1,24 +0,0 @@ -@import '~sass/variables'; - -#shadows { - display: grid; - width: fit-content; - grid-gap: 3em; - grid-template-rows: 1fr; - grid-template-columns: repeat(3, 1fr); -} -#shadow { - width: 13em; - height: 7em; - display: inline-flex; - justify-content: center; - align-items: center; -} -#margin-page { - display: flex; - justify-content: center; - align-items: center; -} -.bg { - background: $color-light-gray; -} diff --git a/src_/app/shared/ui-gallery/ui-gallery.component.ts b/src_/app/shared/ui-gallery/ui-gallery.component.ts deleted file mode 100644 index 88dac29eb5c9a5f9f25e48eaccacf9e7690f85b1..0000000000000000000000000000000000000000 --- a/src_/app/shared/ui-gallery/ui-gallery.component.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-ui-gallery', - templateUrl: './ui-gallery.component.html', - styleUrls: ['./ui-gallery.component.scss'] -}) -export class UiGalleryComponent implements OnInit { - - constructor() { } - - ngOnInit() { - this.encodePreElements(); - } - - styles: any = ['info', 'success', 'warning', 'danger', 'primary', 'secondary', 'default']; - - element(className: string, elt: string = 'span'): string { - return `<${elt} class="${className}">${className}</${elt}>`; - } - - badgeHtml(style: string): string { - return this.element(`badge badge-${style}`); - } - alertHtml(style: string): string { - return this.element(`alert alert-${style}`, 'div'); - } - buttonClass(style: string): string { - return `btn-${style}`; - } - - encodePreElements(): void { - var pre = document.getElementsByTagName('code'); - for (let i = 0; i < pre.length; i++) { - let encoded = this.htmlEncode(pre[i].innerHTML); - pre[i].innerHTML = encoded; - } - }; - - htmlEncode(value): string { - let div = document.createElement('div'); - let text = document.createTextNode(value); - div.appendChild(text); - return div.innerHTML; - } - -} diff --git a/src_/app/showcase-site/about-page/about-page.component.html b/src_/app/showcase-site/about-page/about-page.component.html deleted file mode 100644 index c69c64395cee7c4f8be3714e04a66481913df512..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/about-page/about-page.component.html +++ /dev/null @@ -1,84 +0,0 @@ -<div class="page-content"> - <span class="page-background"></span> - <section id="header" class="drop-shadow-md"> - <h1> - <span class="colorized">Nous sommes</span> des étudiantes et étudiants de CentraleSupélec <span class="colorized">engagés</span> pour l'égalité des chances<span class="colorized">.</span> - </h1> - - <p> - Notre association porte l'action d'ouverture sociale de <a href="http://www.centralesupelec.fr" class="no-color">CentraleSupélec</a>, Grande École d'ingénieurs dont les étudiants s'engagent pour favoriser le lien social et la réussite de chacun. <br /> - Notre association loi 1901 est reconnue d'intérêt général et labellisée <a href="http://www.cordeesdelareussite.fr" class="no-color">Cordées de la Réussite</a>. - </p> - </section> - - <section id="split"> - <section class="content"> - <h2>Notre mission</h2> - <p class="claim"> - Que chacun, quelles que soient ses origines sociales, économiques ou culturelles, ait les moyens de forger son avenir et de réaliser ses ambitions. - </p> - <p> - De la Seconde à la Terminale, nous accompagnons plus de 300 lycéens issus de tous milieux socioculturels. Nous leur donnons les clés nécessaires pour écrire leur avenir et luttons contre l'autocensure afin qu'ils aient confiance en leur potentiel. - </p> - - <h2>Notre philosophie</h2> - <p class="claim"> - Des lycéens qui osent être acteurs de leur parcours. - </p> - <p> - Les lycéens que nous accompagnons sont acteurs de leur orientation et de leurs ambitions. Nous travaillons avec eux pour leur donner l'ouverture d'esprit, la curiosité et l'esprit critique nécessaires pour comprendre le monde qui les entoure et les changements qui s'y opèrent. - </p> - </section> - <section class="carrousel"> - <!-- TODO implement multi-image carrousel --> - <img src="assets/img/aboutus-img1.jpg" class="image drop-shadow-md"> - </section> - </section> - - <section id="figures" class="drop-shadow-md"> - <div *ngIf="keyFigures; else loading"> - <ul *ngIf="keyFigures.length > 0; else empty"> - <li *ngFor="let figure of keyFigures"> - <span class="figure">{{ figure.value }}</span>{{ figure.text }} - </li> - </ul> - <ng-template #empty> - Les chiffres clés de l'association seront bientôt disponibles. - </ng-template> - </div> - <ng-template #loading> - <app-load-spinner></app-load-spinner> - </ng-template> - </section> - - <section id="history" class="drop-shadow-md"> - <section> - <h2>Un engagement de longue date</h2> - <p> - L'histoire d'OSER s'inscrit dans le cadre de la fusion de Supélec et de l'École Centrale Paris, processus qui donna lieu à la création de CentraleSupélec en janvier 2015. - </p> - <p> - Côté Supélec, un programme d'ouverture sociale de type "PQPM" accompagnait chaque année une trentaine de lycéens. Côté École Centrale Paris, l'association loi 1901 Centrale Égalité des Chances est créée en 2010 suite au regroupement de diverses cordées qui s'étaient développées depuis 2007. - </p> - <p> - Se retrouvant dans les mêmes valeurs de partage, de justice sociale et d'égalité, les deux programmes se rapprochent naturellement. C'est ainsi que s'officialise la fusion entre Centrale Égalité des Chances et le programme PQPM Supélec : <strong>le 14 décembre 2016, Ouverture Sociale pour l'Égalité et la Réussite est née.</strong> - </p> - </section> - <section class="image"> - <img class="drop-shadow-md" src="assets/img/soiree-lancement.jpg" alt="Soirée de lancement du 14 décembre 2017"> - <p class="legend">Soirée de lancement du 14 décembre 2016, officialisant la création d'Ouverture Sociale pour l'égalité et la Réussite.</p> - </section> - </section> - - <section id="site-makers" class="drop-shadow-md"> - <p> - <strong> - 🚀 Ce site a été réalisé bénévolement par les tuteurs et tutrices membres du secteur Geek. - </strong> - </p> - <p> - Notre secteur développe et entretient les systèmes d'information de l'association. Nous utilisons les dernières technologies du web pour vous offrir une expérience fluide et agréable. - </p> - <p>Un problème à signaler, un message à faire passer ? <a href="mailto:support@oser-cs.fr">Contactez-nous</a> !</p> - </section> -</div> diff --git a/src_/app/showcase-site/about-page/about-page.component.scss b/src_/app/showcase-site/about-page/about-page.component.scss deleted file mode 100644 index 7e4e37c3dc8117cc4ba09a6b4f22cff684b740db..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/about-page/about-page.component.scss +++ /dev/null @@ -1,169 +0,0 @@ -@import '~app/showcase-site/sass/variables'; -@import '~app/showcase-site/sass/mixins'; - -.colorized { - color: $color-light-blue; -} - -.page-background { - position: fixed; - /* fixed with respect to screen */ - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: -50; - /* push image behind everything */ - background: url("/assets/img/groupe-oser-bw.jpg") no-repeat center; - background-size: cover; - filter: blur(2px); - /* improve text readability */ -} - -#header { - position: relative; - /* To allow background to be relative */ - display: flex; - flex-direction: column; - justify-content: center; - @include margin-page; - overflow: hidden; - color: white; - - h1 { - font-size: 24pt; - @include media-sm { - font-size: 32pt; - } - } - z-index: 1; - @include color-bg($color-dark-blue); -} - -#split { - background-color: white; - @include media-lg { - display: grid; - grid-template-areas: "left right" "left ."; - grid-template-columns: 1fr auto; - grid-template-rows: 1fr auto; - } - - .content { - @include margin-page; - grid-area: "left"; - grid-rows: 1/2; /* Span all rows */ - } - - .claim { - color: $color-dark-blue; - font-weight: bold; - } - - .carrousel { - @include margin-page; - padding-top: 0; - grid-area: "right"; - @include media-lg { - padding: 0; - display: flex; - flex-direction: column; - justify-content: center; - } - - .image { - display: block; - margin: 0 auto; - width: 100%; - max-width: 40em; - height: auto; - } - } -} - -#figures { - position: relative; - @include margin-page; - z-index: 4; - text-align: center; - color: white; - @include color-bg($color-light-blue); - - ul { - list-style-type: none; - margin: $margin-page 0; - padding: 0; - display: flex; - flex-flow: row wrap; - justify-content: space-around; - color: white; - text-align: center; - - li { - margin: 1em; - padding: 1em; - box-sizing: border-box; - // include padding in size - background-color: transp($color-dark-blue, 0.2); - font-size: small; - /* round shape */ - $size: 13em; - width: $size; - height: $size; - border-radius: $size / 2; - /* center content */ - display: flex; - flex-direction: column; - justify-content: center; - } - } -} - -.figure { - color: $color-light-blue; - font-family: $font-title; - font-size: 36pt; - font-style: italic; - font-weight: bold; - - &::after { - /* Add line break after figure */ - content: '\A'; - white-space: pre; - } -} - -#history { - background-color: white; - @include margin-page; - position: relative; - z-index: 2; - @include media-lg { - display: grid; - grid-template-columns: 1fr auto; - grid-column-gap: 2em; - } - - .image { - max-width: 30em; - margin: auto; - - img { - width: 100%; - height: auto; - } - - .legend { - font-size: small; - color: $color-purple; - font-style: italic; - } - } -} - -#site-makers { - @include margin-page; - position: relative; - z-index: 0; - background-color: $color-light-blue; -} diff --git a/src_/app/showcase-site/about-page/about-page.component.ts b/src_/app/showcase-site/about-page/about-page.component.ts deleted file mode 100644 index c802a245c459848dd0bb5b322e72a01480666576..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/about-page/about-page.component.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { KeyFigure } from '../shared/keyfigure.model'; - - -@Component({ - selector: 'app-about-page', - templateUrl: './about-page.component.html', - styleUrls: ['./about-page.component.scss'] -}) -export class AboutPageComponent implements OnInit { - - keyFigures: KeyFigure[]; - - constructor(private route: ActivatedRoute) { } - - ngOnInit() { - this.keyFigures = this.route.snapshot.data['keyFigures']; - } - -} diff --git a/src_/app/showcase-site/about-page/index.ts b/src_/app/showcase-site/about-page/index.ts deleted file mode 100644 index 5998e0149414a82df4f79e2167844951e1d8dff7..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/about-page/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './about-page.component'; diff --git a/src_/app/showcase-site/actions-page/actions-page.component.html b/src_/app/showcase-site/actions-page/actions-page.component.html deleted file mode 100644 index b021f794afcdd6032b01f0eca29bb42ea048fcee..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/actions-page/actions-page.component.html +++ /dev/null @@ -1,60 +0,0 @@ -<div class="page-content"> - <span class="page-background"></span> - <section id="header" class="drop-shadow-md"> - <h1>Une action complète, épanouissante et structurante.</h1> - </section> - - <!-- Actions --> - <div class="actions"> - <div *ngIf="actions; else loadingActions"> - <ul *ngIf="actions.length > 0"> - <span class="sideline"></span> - <li *ngFor="let action of actions" class="action"> - <span class="dot drop-shadow-sm"></span> - <h2>{{ action.title }}</h2> - <markdown [data]="action.description"></markdown> - <p class="fact">{{ action.keyFigure }}</p> - </li> - </ul> - </div> - <ng-template #loadingActions> - <app-load-spinner></app-load-spinner> - </ng-template> - </div> - - <!-- Animated slideshow --> - <div class="slideshow drop-shadow-sm"> - <!-- itemWidth must be the length of images in the slideshow --> - <carousel #carousel [itemWidth]="600" [interval]="4500"> - <div *ngFor="let item of slideItems" class="slideshow-list"> - <div *carouselItem class="slideshow-item"> - <img [src]="item.image" [alt]="item.title"> - <div class="legend"> - <h3>{{ item.title }}</h3> - <p>{{ item.shortDescription }}</p> - </div> - </div> - </div> - </carousel> - </div> - - <!-- Testimonies from students or other association relatives --> - <div class="testimonies"> - <h2>Ils témoignent de leur expérience</h2> - <div *ngIf="testimonies; else loading"> - <ul class="testimony-list" *ngIf="testimonies.length > 0; else empty"> - <li *ngFor="let t of testimonies" class="testimony-item"> - <p>{{ t.content }}</p> - <cite>{{ t.source }}</cite> - </li> - </ul> - <ng-template #empty> - <p>Pas de témoignages pour le moment.</p> - </ng-template> - </div> - <ng-template #loading> - <app-load-spinner></app-load-spinner> - </ng-template> - </div> - -</div> diff --git a/src_/app/showcase-site/actions-page/actions-page.component.scss b/src_/app/showcase-site/actions-page/actions-page.component.scss deleted file mode 100644 index a7255cf77928771cd771e80bc38da0657483252e..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/actions-page/actions-page.component.scss +++ /dev/null @@ -1,180 +0,0 @@ -@import '~app/showcase-site/sass/variables'; -@import '~app/showcase-site/sass/mixins'; - -.page-background { - position: fixed; - /* fixed with respect to screen */ - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: -50; - /* push image behind everything */ - background: url("/assets/img/groupe-oser-bw.jpg") no-repeat center; - background-size: cover; - filter: blur(2px); -} - -#header { - position: relative; - /* To allow background to be relative */ - display: flex; - flex-direction: column; - justify-content: center; - @include margin-page; - overflow: hidden; - color: white; - - h1 { - font-size: 24pt; - @include media-sm { - font-size: 32pt; - } - } - z-index: 1; - @include color-bg($color-dark-blue); -} - -.fact { - color: $color-turquoise; -} - -.actions { - ul { - list-style-type: none; - margin: 0; - padding: 0; - } - position: relative; - background-color: white; - @include margin-page; -} -/* Dimensions or sideline */ -$sideline-width: 0.4em; -$sideline-left: 1.5 * $margin-page - $sideline-width/2; - -.sideline { - $width: 0.5em; - position: absolute; - top: 0; - left: $sideline-left; - height: 100%; - width: $sideline-width; - background: linear-gradient(to bottom, $color-turquoise, $color-dark-blue, $color-accent); - display: none; - @include media-xs { - display: block; - } -} - -li.action { - position: relative; - - .dot { - $size: 3*$sideline-width; - position: absolute; - top: 0.3em; - // small correction - left: -$sideline-left - 2*$sideline-width; - width: $size; - height: $size; - border-radius: $size/2; - background-color: white; - } -} - -.slideshow { - display: flex; - flex-flow: column nowrap; - align-items: center; - justify-content: center; - max-width: 100vw; - overflow: hidden; // prevent from going out the page in small screens - @include margin-page; - z-index: 1; - @include color-bg($color-light-blue); -} - -.slideshow-list { - position: relative; - margin: 0; - padding: 0; - list-style-type: none; -} - -.slideshow-item { - position: relative; -} - -.legend { - $fix: 6px; - @include media-md { - position: absolute; - bottom: $fix; - } - margin: 0 auto; - margin-top: -$fix; - background-color: transp($color-darkest-blue); - width: 100%; - max-width: 100vw; - padding: 1em; - box-sizing: border-box; - color: white; - - p { - margin: 0.3em 0 0; - } - - h3 { - margin-top: 0; - margin-bottom: 0; - } -} - -.testimonies { - display: flex; - flex-flow: column wrap; - @include margin-page; - align-items: center; - justify-content: center; - background-color: white; - - h2 { - font-size: xx-large; - } - - .testimony-list { - margin: 2em 0; - padding: 0; - list-style-type: none; - display: flex; - flex-flow: row wrap; - justify-content: center; - - .testimony-item { - margin: 1em; - max-width: 20em; - - p { - margin-top: 0; - margin-bottom: .5em; - } - - p::before { - content: '\201C'; - } - - p::after { - content: '\201D'; - } - - cite { - color: $color-turquoise; - - &::before { - content: '— '; - } - } - } - } -} diff --git a/src_/app/showcase-site/actions-page/actions-page.component.ts b/src_/app/showcase-site/actions-page/actions-page.component.ts deleted file mode 100644 index 799b37c698615d1c3bd1564a802efec3bb86a06e..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/actions-page/actions-page.component.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { - Testimony, - Action, ActionService -} from 'app/showcase-site/shared'; - -class SlideItem { - title: string; - image: string; - shortDescription: string; -} - -const SLIDEITEMS: SlideItem[] = [ - { - title: "Focus Europe", - image: "assets/img/slide-1.jpg", - shortDescription: "Chaque année pendant quatre jours, Focus Europe emmène les lycéens à la découverte d'une grande capitale européenne." - }, - { - title: "Good Morning London", - image: "assets/img/slide-2.jpg", - shortDescription: "Hi there! Good Morning London est notre stage linguistique 100% britanique." - }, - { - title: "Le tutorat", - image: "assets/img/slide-3.jpg", - shortDescription: "Chaque semaine, tuteurs et tutorés se retrouvent en petits groupes pour des activités pédagogiques variées et stimulantes." - } -] - -@Component({ - selector: 'app-actions-page', - templateUrl: './actions-page.component.html', - styleUrls: ['./actions-page.component.scss'] -}) -export class ActionsPageComponent implements OnInit { - - testimonies: Testimony[]; - slideItems: SlideItem[]; - current: SlideItem; - slideInterval: number = 9000; - actions: Action[]; - - constructor(private route: ActivatedRoute) { } - - ngOnInit() { - this.actions = this.route.snapshot.data['actions']; - this.testimonies = this.route.snapshot.data['testimonies']; - this.getSlideItems(); - } - - getSlideItems(): void { - // TODO: convert to SlideItemService - this.slideItems = SLIDEITEMS; - this.current = this.slideItems[0]; - } - - slide(amount: number) { - // TODO: add slide animation effect - let index = this.slideItems.indexOf(this.current) + amount; - index = (index + this.slideItems.length) % this.slideItems.length; - this.current = this.slideItems[index]; - } - -} diff --git a/src_/app/showcase-site/actions-page/index.ts b/src_/app/showcase-site/actions-page/index.ts deleted file mode 100644 index 6c239477347f2c42e5c48a884da8c061d02c9601..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/actions-page/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './actions-page.component'; diff --git a/src_/app/showcase-site/article-card/article-card.component.html b/src_/app/showcase-site/article-card/article-card.component.html deleted file mode 100644 index 73d2fa7e1dbedde61f4f25ab2b7f34608bac611f..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/article-card/article-card.component.html +++ /dev/null @@ -1,13 +0,0 @@ -<a class="no-style" [routerLink]="['actualites/', article.slug]"> - <div class="card"> - <div class="image"> - <img *ngIf="article.image" [src]="article.image" [alt]="article.title"/> - </div> - <div class="card-body"> - <h3>{{ article.title }}</h3> - <h5>Publié le {{ article.published | date:"shortDate" }}</h5> - <p [innerHTML]="article.preview | emojis"></p> - <a>Lire la suite</a> - </div> - </div> -</a> diff --git a/src_/app/showcase-site/article-card/article-card.component.scss b/src_/app/showcase-site/article-card/article-card.component.scss deleted file mode 100644 index 2fa91df645371d72db815289b732642487b3f10b..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/article-card/article-card.component.scss +++ /dev/null @@ -1,62 +0,0 @@ -@import '~app/showcase-site/sass/variables'; -@import '~app/showcase-site/sass/mixins'; -$padding: 1em 1.5em; - -.card { - display: flex; - min-height: 100%; - margin: 0; - padding: 0; - @include media-md { - background-color: $color-light-gray; - border-radius: 4px; - overflow: hidden; - display: block; - max-width: 20em; - } - @include media-md { - @include drop-shadow-animate($shadow-sm, $shadow-md); - } -} - -.image { - display: none; - margin-bottom: auto; - margin-right: 2em; - max-height: 12em; - @include media-xs { - display: block; - } - @include media-md { - margin: 0; - overflow: hidden; - } -} - -img { - width: 10em; - height: auto; - border-radius: 4px; - overflow: hidden; - @include media-md { - width: 100%; - border-radius: 0; - } -} - -.card-body { - @include media-md { - padding: $padding; - } - - h3 { - font-weight: bold; - margin: 0; - } - - h5 { - color: gray; - font-weight: normal; - margin-top: 0.5em; - } -} diff --git a/src_/app/showcase-site/article-card/article-card.component.ts b/src_/app/showcase-site/article-card/article-card.component.ts deleted file mode 100644 index d93d497d6335219dbe2273f9273e2665084ffa38..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/article-card/article-card.component.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { Article } from '../shared/article.model'; - -@Component({ - selector: 'app-article-card', - templateUrl: './article-card.component.html', - styleUrls: ['./article-card.component.scss'] -}) -export class ArticleCardComponent implements OnInit { - - @Input() article: Article; - - constructor() { } - - ngOnInit() { - } - -} diff --git a/src_/app/showcase-site/article-card/index.ts b/src_/app/showcase-site/article-card/index.ts deleted file mode 100644 index eeb83384b50f00fde61874d89392399f0fb90ea5..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/article-card/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './article-card.component'; diff --git a/src_/app/showcase-site/article-item/article-item.component.html b/src_/app/showcase-site/article-item/article-item.component.html deleted file mode 100644 index dc62a3bba131a82adecdfbfdef7d8e4f547668d0..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/article-item/article-item.component.html +++ /dev/null @@ -1,19 +0,0 @@ -<a class="no-style" [routerLink]="['../actualites', article.slug]"> - <div class="card" [ngClass]="{'has-image': article.image}"> - <div class="image"> - <img *ngIf="article.image" [src]="article.image" [alt]="article.title"/> - </div> - <div class="card-body"> - <h3> - {{ article.title }} - <span *ngIf="article.pinned" class="pinned"> <i class="fa fa-map-pin"></i> À la une</span> - </h3> - <p class="date text-muted-sm">Publié le {{ article.published | date:'shortDate' }}</p> - <ul class="badge-list"> - <span *ngFor="let category of article.categories" class="badge badge-default">{{ category }}</span> - </ul> - <p [innerHTML]="article.preview | emojis"></p> - <a [routerLink]="['../actualites', article.slug]">Lire la suite</a> - </div> - </div> -</a> diff --git a/src_/app/showcase-site/article-item/article-item.component.scss b/src_/app/showcase-site/article-item/article-item.component.scss deleted file mode 100644 index 78c8a8ccf84bc560cb383132b6bb0d5280b952a0..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/article-item/article-item.component.scss +++ /dev/null @@ -1,59 +0,0 @@ -@import '~app/showcase-site/sass/variables'; -@import '~app/showcase-site/sass/mixins'; -$padding: 1em 1.5em; - -.card { - display: grid; - grid-template-columns: 1fr; - @include media-md { - &.has-image { - grid-template-columns: 0.4fr 1fr; - } - } - grid-column-gap: 0.5em; - // display: flex; - min-height: 100%; - margin: 0; - padding: 1em; - &:hover { - background: $color-light-gray; - } -} - -.image { - display: none; - margin: 0 0.5em auto 0; - @include media-md { - display: block; - } - - img { - width: 100%; - height: auto; - border-radius: 4px; - overflow: hidden; - } -} - -.card-body { - h3 { - font-weight: bold; - margin: 0; - } - - .date { - font-weight: normal; - margin-top: 0.5em; - margin-bottom: 0; - } - p { - $m: .5em; - margin-top: $m; - margin-bottom: $m; - } -} - -.pinned { - color: $color-dark-blue; - font-size: 10pt; -} diff --git a/src_/app/showcase-site/article-item/article-item.component.ts b/src_/app/showcase-site/article-item/article-item.component.ts deleted file mode 100644 index 15b65aeb2f43afa7779b574d95e3a80b54b9951c..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/article-item/article-item.component.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { Article } from '../shared/article.model'; - -@Component({ - selector: 'app-article-item', - templateUrl: './article-item.component.html', - styleUrls: ['./article-item.component.scss'] -}) -export class ArticleItemComponent implements OnInit { - - @Input() article: Article; - - constructor() { } - - ngOnInit() { - } - -} diff --git a/src_/app/showcase-site/article-item/index.ts b/src_/app/showcase-site/article-item/index.ts deleted file mode 100644 index c579fee9cd9edb30ac83baee4d465adddb5ee2d4..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/article-item/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './article-item.component'; diff --git a/src_/app/showcase-site/carousel/carousel.component.html b/src_/app/showcase-site/carousel/carousel.component.html deleted file mode 100644 index 039c517c1e0d794b1e2b9fb0ddce375ec6433c4f..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/carousel/carousel.component.html +++ /dev/null @@ -1,15 +0,0 @@ -<div class="carousel-wrapper" [ngStyle]="carouselWrapperStyle"> - <ul class="carousel" #carousel> - <li *ngFor="let item of items" class="carousel-item"> - <ng-template [ngTemplateOutlet]="item.tpl"></ng-template> - </li> - </ul> - <ul class="controls"> - <li *ngFor="let item of items; let i = index" (click)="goToForce(i)"> - <i *ngIf="i == currentSlide; else notCurrent" class="fa fa-circle"></i> - <ng-template #notCurrent> - <i class="fa fa-circle-thin"></i> - </ng-template> - </li> - </ul> -</div> diff --git a/src_/app/showcase-site/carousel/carousel.component.scss b/src_/app/showcase-site/carousel/carousel.component.scss deleted file mode 100644 index 30fe67c7c99b69728234e0a0f7e7e87e5c987e78..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/carousel/carousel.component.scss +++ /dev/null @@ -1,27 +0,0 @@ -.carousel-wrapper { - overflow: hidden; -} - -.carousel { - list-style-type: none; - margin: 0; - padding: 0; - width: 480px; - display: flex; -} - -.controls { - color: white; - list-style-type: none; - margin: 0; - padding: 0; - z-index: 3; - display: flex; - justify-content: center; - width: 100%; - li { - $m: .3em; - margin: .4em $m 0 $m; - cursor: pointer; - } -} diff --git a/src_/app/showcase-site/carousel/carousel.component.ts b/src_/app/showcase-site/carousel/carousel.component.ts deleted file mode 100644 index f927459e6d07398f5f3b7ea1b756dd4691c2c4eb..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/carousel/carousel.component.ts +++ /dev/null @@ -1,100 +0,0 @@ -// Hugely inspired by https://netbasal.com/building-a-simple-carousel-component-with-angular-3a94092b7080 - -import { - Component, OnInit, OnDestroy, Input, AfterViewInit, AfterContentInit, - ContentChildren, ViewChildren, ViewChild, QueryList, ElementRef, -} from '@angular/core'; -import { - AnimationFactory, AnimationBuilder, AnimationPlayer, - animate, style -} from '@angular/animations'; -import { Observable, interval, timer } from 'rxjs'; -import { CarouselDirective, CarouselItemElement } from './carousel.directive'; - -@Component({ - selector: 'carousel', - exportAs: 'carousel', - templateUrl: './carousel.component.html', - styleUrls: ['./carousel.component.scss'] -}) -export class CarouselComponent implements OnInit, AfterViewInit, AfterContentInit, OnDestroy { - - @ContentChildren(CarouselDirective) items: QueryList<CarouselDirective>; - @ViewChildren(CarouselItemElement, { read: ElementRef }) itemsElements: QueryList<ElementRef>; - @ViewChild('carousel') private carousel : ElementRef; - @Input() itemWidth = 480; - carouselWrapperStyle: any = {}; - @Input() interval = 5000; // in ms - @Input() timing = '700ms ease-in-out'; - private player: AnimationPlayer; - private currentSlide = 0; - slideSub: any; - private paused: boolean = false; - pausedSub: any; - - constructor(private builder: AnimationBuilder) { } - - ngOnInit() { - } - - ngAfterViewInit() { - this.carouselWrapperStyle = { - width: `${this.itemWidth}px` - } - } - ngAfterContentInit() { - // Go to the next element - this.slideSub = interval(this.interval).subscribe(_ => { - if (this.paused) return; - this.next(); - }); - } - - playAnim() { - // Build and play an animation - const offset = this.currentSlide * this.itemWidth; - const myAnimation : AnimationFactory = this.builder.build([ - animate(this.timing, style({ transform: `translateX(-${offset}px)` })) - ]); - this.player = myAnimation.create(this.carousel.nativeElement); - this.player.play(); - } - - goTo(index: number) { - this.currentSlide = index; - this.playAnim(); - } - - goToForce(index: number) { - // Pause the automatic sliding - this.paused = true; - if (this.pausedSub) { - this.pausedSub.unsubscribe(); - } - // Turn on automatic sliding back after an interval - this.pausedSub = timer(this.interval).subscribe( - _ => this.paused = false - ); - this.goTo(index); - } - - next() { - if (!this.items) return; - const index = (this.currentSlide + 1) % this.items.length; - this.goTo(index); - } - - prev() { - if (!this.items) return; - const index = ((this.currentSlide - 1) + this.items.length) % this.items.length; - this.goTo(index); - } - - ngOnDestroy() { - if (this.slideSub) { - this.slideSub.unsubscribe(); - this.slideSub = null; - } - } - -} diff --git a/src_/app/showcase-site/carousel/carousel.directive.ts b/src_/app/showcase-site/carousel/carousel.directive.ts deleted file mode 100644 index f7848b213f8977360bf4b5f37b8a0c4bbfc7bc01..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/carousel/carousel.directive.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Directive, TemplateRef } from '@angular/core'; - -@Directive({ - selector: '[carouselItem]' -}) -export class CarouselDirective { - - constructor(public tpl: TemplateRef<any>) { } - -} - -@Directive({ - selector: '.carousel-item' -}) -export class CarouselItemElement { - - constructor() { } - -} diff --git a/src_/app/showcase-site/carousel/index.ts b/src_/app/showcase-site/carousel/index.ts deleted file mode 100644 index e85620aa59f1d880fc35d50f91a26f0f5bf06c14..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/carousel/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './carousel.component'; -export * from './carousel.directive'; diff --git a/src_/app/showcase-site/contact-page/contact-page.component.html b/src_/app/showcase-site/contact-page/contact-page.component.html deleted file mode 100644 index 0cd4a468054f8f96e03d805f1b69f25452ac88fd..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/contact-page/contact-page.component.html +++ /dev/null @@ -1,12 +0,0 @@ -<div class="container"> - <div class="background"></div> - <div id="sheet" class="drop-shadow-md"> - <div id="content"> - <h1>Nous contacter</h1> - <br> - <p>Pour toute <strong>demande d'information sur nos actions</strong>, contactez-nous à l'adresse <a href="mailto:contact@oser-cs.fr" >contact[@]oser-cs.fr</a>.</p> - <hr class="white"> - <p>Pour toute <strong>demande de partenariat ou presse</strong>, contactez-nous à l'adresse <a href="mailto:partenaires@oser-cs.fr">partenaires[@]oser-cs.fr</a>.</p> - </div> - </div> -</div> diff --git a/src_/app/showcase-site/contact-page/contact-page.component.scss b/src_/app/showcase-site/contact-page/contact-page.component.scss deleted file mode 100644 index d3beb810d7e88190adc06875f2b3f52b5e9ebb8b..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/contact-page/contact-page.component.scss +++ /dev/null @@ -1,61 +0,0 @@ -@import '~app/showcase-site/sass/variables'; -@import '~app/showcase-site/sass/mixins'; - -.container { - @include margin-page; - position: relative; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; -} - -.background { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: -1; - background: url('/assets/img/groupe-bw.jpg'); - filter: blur(5px); - background-size: cover; - background-repeat: no-repeat; - /* Scale to remove white edges because of blur */ - transform: scale(1.1); -} -.background::after { - /* Colorize the background with a color overlay */ - position: absolute; - content: ''; - width: 100%; - height: 100%; - background: transp($color-dark-blue); -} - -#sheet { - background-color: white; - width: auto; - text-align: center; - padding: 5em 2em; - box-sizing: border-box; - - #content { - margin: auto; - max-width: 35em; - - hr { - margin: 2em auto; - width: 8em; - } - } - - img.logo { - max-width: 14em; - height: auto; - } - - h1 { - color: $color-dark-blue; - } -} diff --git a/src_/app/showcase-site/contact-page/contact-page.component.ts b/src_/app/showcase-site/contact-page/contact-page.component.ts deleted file mode 100644 index f304bd28e4e8795bfdfa4d06d1815b77e1b1fac6..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/contact-page/contact-page.component.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-contact-page', - templateUrl: './contact-page.component.html', - styleUrls: ['./contact-page.component.scss'] -}) -export class ContactPageComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - - -} diff --git a/src_/app/showcase-site/contact-page/index.ts b/src_/app/showcase-site/contact-page/index.ts deleted file mode 100644 index d7ac948b43960d4cf44c2475992a76a1ff506ef6..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/contact-page/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './contact-page.component'; diff --git a/src_/app/showcase-site/donate-page/donate-page.component.html b/src_/app/showcase-site/donate-page/donate-page.component.html deleted file mode 100644 index 1897cf94704630be6e7eff0ac7d1903427ff124f..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/donate-page/donate-page.component.html +++ /dev/null @@ -1,19 +0,0 @@ -<div id="content"> - <div id="description"> - <div> - <markdown *ngIf="document; else loading" [data]="document"></markdown> - <ng-template #loading> - <app-load-spinner></app-load-spinner> - </ng-template> - <div id="cta" class="text-center"> - <i class="fa fa-angle-down fa-3x" (click)="goTo()" style="color: gray; cursor:pointer;"></i> - </div> - </div> - <div id="current-campaign" class="text-center" *ngIf="currentCampaignUrl"> - <h3>Ce projet a besoin de votre soutien.</h3> - <iframe id="current-campaign-ha-widget" [src]="currentCampaignUrl"></iframe> - </div> - </div> - - <iframe id="donate-ha-widget" [src]="donateUrl" frameborder="0"></iframe> -</div> diff --git a/src_/app/showcase-site/donate-page/donate-page.component.scss b/src_/app/showcase-site/donate-page/donate-page.component.scss deleted file mode 100644 index 5efeb1fb9c2034e4fc100f597623cc05b80028fe..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/donate-page/donate-page.component.scss +++ /dev/null @@ -1,39 +0,0 @@ -@import '~app/showcase-site/sass/mixins'; - -#description { - @include page-section(1); - display: grid; - grid-gap: $margin-page; - grid-template-columns: 1fr; - @include media-md { - grid-template-rows: 1fr; - grid-template-columns: 1fr auto; - } -} - -#current-campaign-ha-widget { - width: 16em; - height: 32em; - border: none; - @include media-xs { - width: 20em; - height: 30em; - } - @include media-lg { - width: 26em; - height: 26em; - } -} - -#donate-ha-widget { - box-sizing: border-box; - background-color: white; - width: 100%; - height: 1000px; - @include margin-page; - padding-top: 0; -} - -#current-campaign { - // display: none; -} diff --git a/src_/app/showcase-site/donate-page/donate-page.component.ts b/src_/app/showcase-site/donate-page/donate-page.component.ts deleted file mode 100644 index c250d292ca6e373984bce057f801fd25846e1bd8..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/donate-page/donate-page.component.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { DomSanitizer, SafeUrl } from '@angular/platform-browser'; -import jump from 'jump.js'; -import { environment } from 'environments/environment'; - -@Component({ - selector: 'app-donate', - templateUrl: './donate-page.component.html', - styleUrls: ['./donate-page.component.scss'] -}) -export class DonatePageComponent implements OnInit { - - currentCampaignUrl: SafeUrl; - donateUrl: SafeUrl; - document: string; - - constructor( - private route: ActivatedRoute, - private sanitizer: DomSanitizer) { } - - ngOnInit() { - this.document = this.route.snapshot.data['document']; - this.donateUrl = this.getSafe(environment.donateUrl); - if (environment.currentCampaignUrl) { - this.currentCampaignUrl = this.getSafe(environment.currentCampaignUrl); - } - } - - getSafe(url: string): SafeUrl { - return this.sanitizer.bypassSecurityTrustResourceUrl(url); - } - - goTo() { - jump('#donate-ha-widget'); - } - -} diff --git a/src_/app/showcase-site/donate-page/index.ts b/src_/app/showcase-site/donate-page/index.ts deleted file mode 100644 index 3a51c76ca1c42b3ac90000ff7d29eedf512205e5..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/donate-page/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './donate-page.component'; diff --git a/src_/app/showcase-site/index.ts b/src_/app/showcase-site/index.ts deleted file mode 100644 index 360e4033db2babd18c360a5784d2ce014469de08..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -export * from './showcase-site.component'; -export * from './about-page'; -export * from './actions-page'; -export * from './contact-page'; -export * from './donate-page'; -export * from './landing-page'; -export * from './mentions'; -export * from './news-detail-page'; -export * from './news-page'; diff --git a/src_/app/showcase-site/landing-page/index.ts b/src_/app/showcase-site/landing-page/index.ts deleted file mode 100644 index 0a68f829db935c6f52d87504748029bedb7024c7..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/landing-page/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './landing-page.component'; diff --git a/src_/app/showcase-site/landing-page/landing-page.component.html b/src_/app/showcase-site/landing-page/landing-page.component.html deleted file mode 100644 index c2bebb535c54a7a1103e67280801beaefcd5fce1..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/landing-page/landing-page.component.html +++ /dev/null @@ -1,112 +0,0 @@ -<div id="photo" class="drop-shadow-md"> - <div id="discover"> - <div class="content drop-shadow-md"> - <h2 class="slogan"> - Ils ont l'envie,<br /> - nous sommes le coup de pouce. - </h2> - <p> - Depuis plus de dix ans, nous œuvrons en faveur de l'égalité des chances dans les lycées d'Ile-de-France. - </p> - <div class="text-center"> - <button class="btn-discover" (click)="jumpToContent()"> - Découvrez notre association - </button> - </div> - </div> - </div> -</div> - -<div id="qui-sommes-nous" class="drop-shadow-md"> - <h2>Qui sommes-nous ?</h2> - <p> - <strong>Ouverture Sociale pour l'Égalité et la Réussite</strong> est une association loi 1901 composée d'étudiantes et d'étudiants de CentraleSupélec engagés pour plus d'égalité des chances face aux études supérieures. - <br><br> Nous souhaitons que <strong>chacun, quelles que soient ses origines sociales, économiques ou culturelles, puisse forger son avenir et se munir des clés pour réaliser ses ambitions</strong>. - </p> - <div class="next"> - <a type="button" routerLink="qui-sommes-nous">Lire la suite</a> - </div> -</div> - -<div id="actions" class="drop-shadow-md"> - <h2>Nous agissons pour plus d'égalité des chances</h2> - <ul class="action-bubbles" *ngIf="actions; else loading"> - <div class="action-bubble" *ngFor="let action of actions"> - <img [src]="action.thumbnail" [alt]="action.title"> - <div class="label">{{ action.title | uppercase }}</div> - </div> - </ul> - <ng-template #loading> - <app-load-spinner></app-load-spinner> - </ng-template> - <p>De la seconde à la Terminale, nous sommes présents sur tous les fronts pour accompagner le développement de nos lycéens.</p> - <a type="button" routerLink="actions">En savoir plus</a> -</div> - -<div id="articles" class="drop-shadow-md"> - <div class="heading"> - <h2>L'actualité de l'association</h2> - <div class="link-all"> - <a routerLink="actualites" type="button">Tous les articles</a> - </div> - </div> - <div *ngIf="articles; else loading"> - <ul *ngIf="articles.length > 0; else empty" class="article-cards"> - <app-article-card *ngFor="let article of articles" [article]="article"></app-article-card> - </ul> - <ng-template #empty> - <p class="text-center">Pas d'articles pour le moment.</p> - </ng-template> - </div> - <ng-template #loading> - <app-load-spinner></app-load-spinner> - </ng-template> -</div> - -<div id="calls-to-action" class="drop-shadow-md"> - <div class="heading"> - <h2>Ils ont l'envie, nous sommes le coup de pouce.</h2> - </div> - <div class="cta" [ngClass]="{'has-items': premiumPartners.length > 0}"> - <div class="cta-text"> - <p> - Ils nous soutiennent cette année encore : <strong>merci à nos partenaires pour leur engagement !</strong> - </p> - <p> - Vous aussi, engagez-vous à nos côtés en devenant <strong>partenaire d'Ouverture Sociale pour l'Égalité et la Réussite</strong>. - </p> - <div class="cta-btn"> - <a routerLink="contact">Devenir partenaire</a> - </div> - </div> - <div class="cta-well white" *ngIf="partners; else loading"> - <div *ngFor="let partner of premiumPartners"> - <app-partner-logo [partner]="partner"></app-partner-logo> - </div> - </div> - <ng-template #loading> - <app-load-spinner></app-load-spinner> - </ng-template> - </div> - <div class="cta" [ngClass]="{'has-items': otherPartners.length > 0}"> - <div class="cta-text"> - <p> - OSER fait partie de la Cordée Mutualisée de l'Université Paris Saclay, projet visant à favoriser l'accès à l'enseignement supérieur, dont les filières d'excellence, de jeunes quel que soit leur milieu socioculturel. Notre action est ainsi en partie financée par des organismes régionaux et départementaux. - </p> - <p> - Vous aussi, <strong>soutenez notre action auprès des jeunes de la région parisienne</strong>. - </p> - <div class="cta-btn"> - <a routerLink="nous-soutenir">Faire un don</a> - </div> - </div> - <div class="cta-well" *ngIf="partners; else loading"> - <div *ngFor="let partner of otherPartners"> - <app-partner-logo [partner]="partner"></app-partner-logo> - </div> - </div> - <ng-template #loading> - <app-load-spinner></app-load-spinner> - </ng-template> - </div> -</div> diff --git a/src_/app/showcase-site/landing-page/landing-page.component.scss b/src_/app/showcase-site/landing-page/landing-page.component.scss deleted file mode 100644 index c98f22d303559f01cc164378b0fdaa674831cb3e..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/landing-page/landing-page.component.scss +++ /dev/null @@ -1,234 +0,0 @@ -@import '~app/showcase-site/sass/mixins'; -@import '~app/showcase-site/sass/variables'; - -#photo { - position: relative; - height: 85vh; - - &::before { - content: ''; - position: absolute; - min-width: 100%; - height: inherit; - z-index: -1; - background-image: url("/assets/img/groupe.jpg"); - background-size: cover; - background-position: center; - } -} - -#discover { - @include margin-page-horizontal; - height: 100%; - display: flex; - justify-content: center; - align-items: center; - - .content { - padding: $margin-page; - max-width: 30em; - border-radius: 4px; - display: flex; - flex-flow: column; - justify-content: center; - background: transparentize(white, .25); - } - - .logo { - max-width: 20em; - height: auto; - } - - .slogan { - margin: 0; - } - - .btn-discover { - @include btn($color: $color-secondary, $bg: white, $hover-color: $color-secondary, $hover-bg: $color-light-blue, $color-border: none); - } -} - -#qui-sommes-nous { - @include page-section(1, white); - background: $color-dark-blue; - text-align: center; - - h2 { - color: $color-light-blue; - } - - p { - margin-bottom: 2em; - } - - .next { - margin-bottom: 2em; - - a { - @include btn(white, $hover-color: $color-dark-blue); - } - } -} - -#actions { - @include page-section(2); - background: $color-light-blue; - text-align: center; - - a { - @include btn($color-accent); - } - - .action-bubbles { - display: flex; - flex-flow: column wrap; - align-items: center; - padding: 0; - list-style-type: none; - @include media-md { - flex-flow: row wrap; - justify-content: center; - } - } - - p { - margin-bottom: 2em; - } - - .action-bubble { - text-align: left; - display: grid; - grid-template-areas: "image label"; - grid-gap: 1em; - align-items: center; - justify-items: center; - @include media-md { - grid-template-areas: "image" "label"; - } - - img { - display: block; - grid-area: "image"; - max-width: 7em; - height: auto; - border-radius: 50%; - } - - .label { - grid-area: "label"; - font-weight: bold; - color: $color-dark-blue; - } - - & + .action-bubble { - margin-top: 1em; - @include media-md { - margin-left: 1em; - margin-top: 0; - } - } - } -} - -#articles { - @include page-section(3); - - .heading { - text-align: center; - } - - .link-all { - text-align: center; - margin: 0; - margin-bottom: 1em; - - a { - @include btn($color-dark-blue); - } - } - - .article-cards { - display: flex; - flex-direction: column; - justify-content: center; - padding: 0; - list-style-type: none; - margin: 2em 0; - @include media-md() { - flex-direction: row; - } - /* Add space between cards */ - app-article-card + app-article-card { - margin-top: 2em; - @include media-md { - margin-top: 0; - margin-left: 2em; - } - } - } -} - -#calls-to-action { - @include page-section(4); - background-color: $color-dark-blue; - color: white; - - .heading { - text-align: center; - } - - h2 { - color: $color-light-blue; - } - - .cta { - display: grid; - grid-template-areas: - "text" - "well"; - grid-gap: 2em; - margin-bottom: 2em; - @include media-lg { - // Change layout only if there are partners to show - &.has-items { - grid-template-areas: "text well"; - } - } - } - - .cta-text { - grid-area: "text"; - } - - .cta-btn { - text-align: center; - margin-top: 2em; - - a { - @include btn($color-light-blue, $hover-color: $color-dark-blue); - } - } - - .cta-well { - grid-area: "well"; - display: flex; - flex-flow: row wrap; - align-items: center; - justify-content: center; - width: auto; - margin-bottom: auto; - border-radius: 4px; - @include drop-shadow($shadow-sm, $inset: true); - - app-partner { - margin: 0.5em; - } - - &.white { - background: white; - } - @include media-lg { - width: 30em; - } - } -} diff --git a/src_/app/showcase-site/landing-page/landing-page.component.ts b/src_/app/showcase-site/landing-page/landing-page.component.ts deleted file mode 100644 index 80cc79c5ad8c23b8a0e28ecf0ccc6492f0a82378..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/landing-page/landing-page.component.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { Article, ArticleService, Action, Partner } from '../shared'; -import { ActivatedRoute } from '@angular/router'; -import jump from 'jump.js'; -import { environment } from 'environments/environment'; - - -@Component({ - selector: 'app-landing-page', - templateUrl: './landing-page.component.html', - styleUrls: ['./landing-page.component.scss'] -}) -export class LandingPageComponent implements OnInit { - - actions: Action[]; - articles: Article[]; - partners: Partner[]; - numArticles: number = environment.numArticles; - - constructor( - private articleService: ArticleService, - private route: ActivatedRoute, - ) { } - - ngOnInit() { - this.actions = this.route.snapshot.data['actions']; - this.partners = this.route.snapshot.data['partners']; - this.getArticles(); - } - - getArticles(): void { - this.articleService.first(this.numArticles).subscribe( - (articles) => this.articles = articles - ); - } - - get premiumPartners(): Partner[] { - if (!this.partners) return []; - return this.partners.filter(p => p.premium); - } - - get otherPartners(): Partner[] { - if (!this.partners) return []; - return this.partners.filter(p => !p.premium); - } - - jumpToContent(): void { - jump('#qui-sommes-nous'); - } -} diff --git a/src_/app/showcase-site/mentions/index.ts b/src_/app/showcase-site/mentions/index.ts deleted file mode 100644 index 36a33966bebdbfb1f46a9a38731eb5b5ecbb52df..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/mentions/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './mentions.component'; diff --git a/src_/app/showcase-site/mentions/mentions.component.html b/src_/app/showcase-site/mentions/mentions.component.html deleted file mode 100644 index e4fddd46b2aeb67095ca457cabb55feb667260b3..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/mentions/mentions.component.html +++ /dev/null @@ -1,6 +0,0 @@ -<div class="page"> - <markdown *ngIf="document; else loading" [data]="document"></markdown> - <ng-template #loading> - <app-load-spinner></app-load-spinner> - </ng-template> -</div> diff --git a/src_/app/showcase-site/mentions/mentions.component.scss b/src_/app/showcase-site/mentions/mentions.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/app/showcase-site/mentions/mentions.component.ts b/src_/app/showcase-site/mentions/mentions.component.ts deleted file mode 100644 index 06876deeb64d7643e33d98666b54b48ecfe2ec26..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/mentions/mentions.component.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Component } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; - -@Component({ - selector: 'app-mentions', - templateUrl: './mentions.component.html', - styleUrls: ['./mentions.component.scss'] -}) -export class MentionsComponent { - - document: string; - - constructor(private route: ActivatedRoute) { } - - ngOnInit() { - this.document = this.route.snapshot.data['document']; - } - -} diff --git a/src_/app/showcase-site/news-detail-page/index.ts b/src_/app/showcase-site/news-detail-page/index.ts deleted file mode 100644 index 54f98e3b680db24bd7f9a696b55fed708b3df91d..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/news-detail-page/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './news-detail-page.component'; diff --git a/src_/app/showcase-site/news-detail-page/news-detail-page.component.html b/src_/app/showcase-site/news-detail-page/news-detail-page.component.html deleted file mode 100644 index 872230bce3a7a93a7bca413fd97601ce929c556a..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/news-detail-page/news-detail-page.component.html +++ /dev/null @@ -1,40 +0,0 @@ -<div id="article"> - <div *ngIf="article; else loading"> - - <div> - <span *ngFor="let category of article.categories" class="badge badge-default">{{ category }}</span> - </div> - - <h1>{{ article.title }}</h1> - - <p class="intro" *ngIf="article.introduction">{{ article.introduction }}</p> - - <p class="text-muted-sm">—</p> - - <p class="text-muted-sm"> - Publié le {{ article.published | date:'shortDate' }} - à {{ article.published | date:'shortTime' }}. - <span *ngIf="article.modified">Mis à jour le {{ article.modified | date:'shortDate'}} à {{ article.modified | date:'shortTime' }}.</span> - </p> - - <div class="md-content"> - <img *ngIf="article.image && article.displayImage" [src]="article.image" [alt]="article.title" class="drop-shadow-sm"> - <div [innerHTML]="article.content | markdown | emojis"></div> - </div> - - <div id="related" *ngIf="relatedArticles && relatedArticles.length > 0"> - <hr> - <h3>Dans la même catégorie…</h3> - <ul> - <li *ngFor="let related of relatedArticles"> - <a class="related-link" (click)="navigate(related)"> - {{ related.title }} - </a> - </li> - </ul> - </div> - </div> - <ng-template #loading> - <app-load-spinner></app-load-spinner> - </ng-template> -</div> diff --git a/src_/app/showcase-site/news-detail-page/news-detail-page.component.scss b/src_/app/showcase-site/news-detail-page/news-detail-page.component.scss deleted file mode 100644 index ea5cdb0c0837d1eb66ffaa15693d20b81f17597d..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/news-detail-page/news-detail-page.component.scss +++ /dev/null @@ -1,26 +0,0 @@ -@import '~app/showcase-site/sass/mixins'; - -#article { - @include margin-page; - margin: 0 auto; - max-width: 40em; - position: relative; - &::before { - content: ''; - position: absolute; - top: 0; - left: 0; - height: 100%; - width: 100%; - z-index: -10; - @include drop-shadow($shadow-sm); - } -} - -.intro { - color: $color-dark-gray; -} - -.related-link { - cursor: pointer; -} diff --git a/src_/app/showcase-site/news-detail-page/news-detail-page.component.ts b/src_/app/showcase-site/news-detail-page/news-detail-page.component.ts deleted file mode 100644 index 7a202b3b9b3634a4660cdf91559837373762cad6..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/news-detail-page/news-detail-page.component.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { Component, OnInit, Renderer } from '@angular/core'; -import { Title } from '@angular/platform-browser'; -import { ActivatedRoute, Router } from '@angular/router'; -import { Article, ArticleService } from '../shared'; - -@Component({ - selector: 'app-news-detail-page', - templateUrl: './news-detail-page.component.html', - styleUrls: ['./news-detail-page.component.scss'] -}) -export class NewsDetailPageComponent implements OnInit { - - article: Article; - articles: Article[] = []; - relatedArticles: Article[]; - numRelatedArticles: number = 4; - - constructor( - private route: ActivatedRoute, - private router: Router, - private titleService: Title, - ) { } - - ngOnInit() { - this.article = this.route.snapshot.data['article']; - this.articles = this.route.snapshot.data['articles']; - this.relatedArticles = this.getRelatedArticles(this.article); - this.titleService.setTitle( - this.titleService.getTitle() + ' : ' + this.article.title - ); - } - - getRelatedArticles(article: Article): Article[] { - return this.articles.filter(a => { - // The current article is not considered as related - if (a.id === this.article.id) return false; - // Related articles are those that have at least one category - // in common with this article. - let commonCategories = new Set( - this.article.categories.filter( - category => a.categories.includes(category) - ) - ); - return commonCategories.size > 0; - }).slice(0, this.numRelatedArticles); - } - - navigate(other: Article) { - // Don't navigate if it is actually the same article - if (other.id === this.article.id) return; - // Forget the old article - this.article = null; - // Navigate to trigger the fetch of a new article - this.router.navigate(['../', other.id], {relativeTo: this.route}); - } -} diff --git a/src_/app/showcase-site/news-page/index.ts b/src_/app/showcase-site/news-page/index.ts deleted file mode 100644 index 8ec63934a61131476ad28aceea6362b22a594dd6..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/news-page/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './news-page.component'; diff --git a/src_/app/showcase-site/news-page/news-page.component.html b/src_/app/showcase-site/news-page/news-page.component.html deleted file mode 100644 index 84a116fadd5e8e5ade6e6092b39e17fdf97aaa56..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/news-page/news-page.component.html +++ /dev/null @@ -1,47 +0,0 @@ -<div class="wrapper"> - <div class="header"> - <h1>L'actualité d'OSER</h1> - <div class="like-btn"> - <div> - Suivez-nous sur <a href="http://www.facebook.com/OSERCentraleSupelec">Facebook</a>. - </div> - <iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2FOSERCentraleSupelec%2F&width=450&layout=standard&action=like&size=large&show_faces=false&share=false&height=35&appId=117119992260617" width="200" height="35" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe> - </div> - </div> - - <div class="search"> - <div class="search-bar"> - <!-- Enter search term here --> - <input type="text" (keyup)="searchTerm$.next($event.target.value)" placeholder="Rechercher un article…"> - </div> - <div id="filters-title" (click)="toggleFilters()"> - <h4>Filtrer par…</h4> - <span class="dropdown"><i class="fa fa-angle-down"></i></span> - </div> - <ul class="filters" [ngClass]="{'hidden': !filtersVisible}"> - <app-filter class="filter" title="Année" [values]="years" (onSelect)="onSelectYear($event)" [countContains]="articleYears"></app-filter> - <app-filter *ngIf="categories && categories.length > 0" class="filter" title="Catégorie" [values]="categories" (onSelect)="onSelectCategory($event)" [countContains]="articleCategories"></app-filter> - </ul> - <hr id="search-hr"> - </div> - - <div class="main"> - <div *ngIf="visibleArticles; else loading"> - <ul *ngIf="visibleArticles.length > 0; else empty"> - <app-article-item *ngFor="let article of visibleArticles | fuzzy : search : ['title']" [article]="article"></app-article-item> - </ul> - <ng-template #empty> - <p class="text-center"> - Pas d'articles ici pour le moment. Restez à l'écoute ! - </p> - </ng-template> - </div> - <ng-template #loading> - <app-load-spinner></app-load-spinner> - </ng-template> - </div> - - <div class="feeds"> - <iframe src="https://www.facebook.com/plugins/page.php?href=https%3A%2F%2Fwww.facebook.com%2FOSERCentraleSupelec%2F&tabs=timeline&width=300&height=500&small_header=true&adapt_container_width=true&hide_cover=false&show_facepile=false&appId=163201387826770" width="300" height="500" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe> - </div> -</div> diff --git a/src_/app/showcase-site/news-page/news-page.component.scss b/src_/app/showcase-site/news-page/news-page.component.scss deleted file mode 100644 index a612a16d3752cfe37c277aec2d53710fb97efb1d..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/news-page/news-page.component.scss +++ /dev/null @@ -1,124 +0,0 @@ -@import '~app/showcase-site/sass/mixins'; - -$stick: 1em; - -.wrapper { - @include margin-page; - display: grid; - - grid-template-areas: - "hd" - "search" - "main" - "feeds"; - grid-row-gap: 1em; - grid-column-gap: 1em; - - @include media-sm { - grid-template-areas: - "hd hd" - "search main"; - grid-template-columns: 1fr 3fr; - } - - @include media-lg { - grid-template-areas: - ". hd hd" - "search main feeds"; - grid-template-columns: 1fr 3fr auto; - } -} - -.header { - grid-area: hd; - display: grid; - grid-template-columns: 1fr; - grid-template-rows: 1fr auto; - grid-template-areas: - "text" - "like-btn"; - align-items: flex-end; - @include media-sm { - grid-template-columns: 1fr auto; - grid-template-rows: 1fr; - grid-template-areas: "text like-btn"; - } -} -.like-btn { - grid-area: like-btn; - @include media-lg { - display: none; - } -} - -.search { - grid-area: search; - @include media-sm { - height: fit-content; - position: sticky; - top: $stick; - } - background: white; - padding: 0.5em 0em; - box-sizing: border-box; - #filters-title { - cursor: pointer; - display: flex; - flex-flow: row wrap; - justify-content: space-between; - align-items: baseline; - padding-right: 1em; - box-sizing: border-box; - h5 { - display: inline-block; - } - &:hover { - color: $color-accent; - } - } - ul.filters { - list-style-type: none; - margin: 0; - padding: 0; - display: block; - background: white; - } - ul.filters.hidden { - display: none; - } - .filter + .filter { - margin-top: 2em; - } -} -#search-hr { - display: block; - @include media-sm { - display: none; - } -} - -.main { - grid-area: main; - ul { - list-style-type: none; - margin: 0; - padding: 0; - display: flex; - flex-direction: column; - } - /* Add space between article items */ - app-article-item + app-article-item { - // margin-top: 2em; - } -} -.feeds { - grid-area: feeds; - display: none; - height: fit-content; - @include media-lg { - display: block; - position: sticky; - top: $stick; - } - text-align: center; -} diff --git a/src_/app/showcase-site/news-page/news-page.component.ts b/src_/app/showcase-site/news-page/news-page.component.ts deleted file mode 100644 index 9d1c43ee976eaf64bcfd740f1e49de9875a815d1..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/news-page/news-page.component.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { Subject } from 'rxjs'; -import { Article, ArticleService } from '../shared'; -import { FuzzyPipe } from 'app/core'; - - -@Component({ - selector: 'app-news-page', - templateUrl: './news-page.component.html', - styleUrls: ['./news-page.component.scss'] -}) -export class NewsPageComponent implements OnInit { - - articles: Article[]; - visibleArticles: Article[]; - - years: number[]; - currentYear: number; - articleYears: string[]; - - categories: string[]; - currentCategory: string; - articleCategories: string[][]; - - // RxJS subject = observable + observer - searchTerm$ = new Subject<string>(); - search: string; - - filtersVisible: boolean = true; - - constructor( - private route: ActivatedRoute, - private articleService: ArticleService) { } - - ngOnInit() { - this.getArticles(); - this.categories = this.route.snapshot.data['categories']; - this.searchTerm$.subscribe( - (value) => this.search = value - ); - } - - updateVisibleArticles() { - // Only articles corresponding to the current filters should be visible - this.visibleArticles = this.articles.filter( - article => { - if (this.currentYear && article.published.getFullYear() !== this.currentYear) return false; - if (this.currentCategory) { - if (!article.categories.includes(this.currentCategory)) return false; - } - return true; - } - ) - } - - getArticles(): void { - this.articleService.list().subscribe( - (articles) => { - this.articles = articles; - // Update set of years - this.years = Array.from(new Set( - this.articles.map(a => a.published.getFullYear()) - )); - // Update article years - this.articleYears = this.articles - .map(a => a.published.getFullYear().toString()); - // Update article categories - this.articleCategories = this.articles.map(a => a.categories); - this.updateVisibleArticles(); - } - ); - } - - // Respond to filter selection events - onSelectYear(year: number) { - this.currentYear = year; - this.updateVisibleArticles(); - } - onSelectCategory(category: string) { - this.currentCategory = category; - this.updateVisibleArticles(); - } - - toggleFilters(): void { - this.filtersVisible = !this.filtersVisible; - } -} diff --git a/src_/app/showcase-site/partner-logo/index.ts b/src_/app/showcase-site/partner-logo/index.ts deleted file mode 100644 index 6decb55fbe75756d8f5769005de7602bbcf0fd70..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/partner-logo/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './partner-logo.component'; diff --git a/src_/app/showcase-site/partner-logo/partner-logo.component.html b/src_/app/showcase-site/partner-logo/partner-logo.component.html deleted file mode 100644 index fd14c195e1564434f3773103b54b617043bd7379..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/partner-logo/partner-logo.component.html +++ /dev/null @@ -1,3 +0,0 @@ -<a target="_blank" [href]="partner.website"> - <img [src]="partner.logo" [alt]="partner.name"> -</a> diff --git a/src_/app/showcase-site/partner-logo/partner-logo.component.scss b/src_/app/showcase-site/partner-logo/partner-logo.component.scss deleted file mode 100644 index 9d2c6f20c4be274f3fd1ccfc942f7b5f7cbfcb0f..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/partner-logo/partner-logo.component.scss +++ /dev/null @@ -1,4 +0,0 @@ -img { - max-width: 200px; - height: auto; -} diff --git a/src_/app/showcase-site/partner-logo/partner-logo.component.ts b/src_/app/showcase-site/partner-logo/partner-logo.component.ts deleted file mode 100644 index f2ba3533c437a25a16a92698131ac2eee36da8a2..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/partner-logo/partner-logo.component.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { Partner } from '../shared'; - -@Component({ - selector: 'app-partner-logo', - templateUrl: './partner-logo.component.html', - styleUrls: ['./partner-logo.component.scss'] -}) -export class PartnerLogoComponent implements OnInit { - - @Input() partner: Partner; - - constructor() { } - - ngOnInit() { - } - -} diff --git a/src_/app/showcase-site/sass/_mixins.scss b/src_/app/showcase-site/sass/_mixins.scss deleted file mode 100644 index db4452ac30d552621bb8f5f4b12898897170314e..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/sass/_mixins.scss +++ /dev/null @@ -1,84 +0,0 @@ -@import './variables'; -@import '~sass/mixins'; -@import '~sass/media-queries'; - -@mixin link-underline($height: 0.1em, $color: $color-dark-blue) { - // animated underline effect on nav links - &::after { - content: ''; - display: block; - height: $height; - margin-top: $header-margin-bottom - $height; - background: transparent; - transition: background 0.3s; - } - - &:hover::after { - background: $color; - } -} - -/* Navigation */ -@mixin nav-link($underline: false) { - text-decoration: none; - color: $color-purple; - font-weight: bold; - cursor: pointer; - // change color on hover - &:hover { - color: $color-dark-blue; - } - @if $underline { - @include link-underline($height: 0.1em, $color: $color-dark-blue); - } -} - -/* Page sections */ - -@mixin margin-page() { - /* Use for consistent responsive page margins */ - padding: $margin-page; - @content; - @include media-xs { - $m: 3 * $margin-page; - padding-left: $m; - padding-right: $m; - } -} - -@mixin page-section($index, $color: inherit) { - @include margin-page; - position: relative; - z-index: 9 - $index; - margin: 0; - color: $color; - - h2 { - font-size: 28px; - } - -} - -@function transp($color, $amount: 0.4) { - @return transparentize($color, $amount); -} - -@mixin color-bg($color) { - /* - Must be used with a >0 z-index, eg: - z-index: 1; - Otherwise the color overlay won't work - */ - position: relative; - &::before { - /* Colorize the background with a color overlay */ - position: absolute; - z-index: -1; - top: 0; - left: 0; - content: ''; - width: 100%; - height: 100%; - background-color: transp($color); - } -} diff --git a/src_/app/showcase-site/sass/_variables.scss b/src_/app/showcase-site/sass/_variables.scss deleted file mode 100644 index 2a312acc6d71d7b327cab6befd51a2454cb46ae1..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/sass/_variables.scss +++ /dev/null @@ -1,11 +0,0 @@ -@import '~sass/variables'; - -/* 12-column grid system */ -$col-rel: 100%/12; -$col-padding: 10px; -@function col-width($n) { - @return $n * $col-rel; -} - -/* Layout spacing */ -$header-margin-bottom: 1em; diff --git a/src_/app/showcase-site/shared/action.model.ts b/src_/app/showcase-site/shared/action.model.ts deleted file mode 100644 index 71631494ca6c12dc95582cb0c58700146d946dc3..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/shared/action.model.ts +++ /dev/null @@ -1,24 +0,0 @@ -export class Action { - id: number; - title: string; - description: string; - thumbnail: string; - keyFigure: string; - highlight: boolean; - - constructor(options: { - id: number, - title: string, - description: string, - thumbnail: string, - keyFigure: string, - highlight: boolean, - }) { - this.id = options.id; - this.title = options.title; - this.description = options.description; - this.thumbnail = options.thumbnail; - this.keyFigure = options.keyFigure; - this.highlight = options.highlight; - } -} diff --git a/src_/app/showcase-site/shared/action.service.ts b/src_/app/showcase-site/shared/action.service.ts deleted file mode 100644 index e185a6301586bf3d150e01470c3def439dfde088..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/shared/action.service.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { map } from 'rxjs/operators'; -import { Action } from './action.model'; -import { environment } from 'environments/environment'; -import { ObjectListResolver } from 'app/core'; - - -@Injectable({ - providedIn: 'root', -}) -export class ActionService { - - private baseUrl = environment.showcaseApiUrl + 'actions/'; - - constructor(private http: HttpClient) { } - - // Adapt JSON returned by API to match the Action interface - adapt(item: any): Action { - return new Action({ - id: item.id, - title: item.title, - description: item.description, - keyFigure: item.key_figure, - thumbnail: item.thumbnail, - highlight: item.highlight, - }); - } - - list(): Observable<Action[]> { - return this.http.get<Action>(this.baseUrl).pipe( - map((data: any) => data.map(this.adapt)), - ); - } - - listHighlight(): Observable<Action[]> { - return this.list().pipe( - map(actions => actions.filter(action => action.highlight)) - ); - } -} - -@Injectable({ - providedIn: 'root', -}) -export class ActionsResolver extends ObjectListResolver<Action> { - constructor(public service: ActionService) {super();} -} diff --git a/src_/app/showcase-site/shared/article.model.ts b/src_/app/showcase-site/shared/article.model.ts deleted file mode 100644 index abc7b76e42f3512e5b675be79d2290fc62e63000..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/shared/article.model.ts +++ /dev/null @@ -1,57 +0,0 @@ -import * as removeMd from 'remove-markdown'; - -export class Article { - id: number; - slug: string; - title: string; - introduction: string; - content: string; - published: Date; - modified: Date; - image: string; - displayImage: boolean; - pinned: boolean; - categories: string[]; - - constructor(options: { - id: number, - slug: string, - title?: string, - introduction?: string, - content?: string, - published?: Date, - modified?: Date, - image?: string, - displayImage?: boolean, - pinned?: boolean, - categories?: string[], - }) { - this.id = options.id; - this.slug = options.slug; - this.title = options.title || ''; - this.introduction = options.introduction || ''; - this.content = options.content || ''; - this.published = options.published; - this.modified = options.modified; - this.image = options.image; - this.displayImage = options.displayImage; - this.pinned = options.pinned || false; - this.categories = options.categories || []; - } - - previewLength: number = 220; - - get preview(): string { - let preview: string; - // Prepend introduction to content if present - const source: string = this.introduction ? this.introduction + ' ' + this.content : this.content; - if (source.length > this.previewLength) { - // Truncate the content to only show the beginning of it. - preview = source.substring(0, this.previewLength) + ' […]'; - } else { - preview = source; - } - // Strip any Markdown formatting - return removeMd(preview); - } -} diff --git a/src_/app/showcase-site/shared/article.service.ts b/src_/app/showcase-site/shared/article.service.ts deleted file mode 100644 index 796e221b2a6a3b374f3a2f8138b9fd6c5c719efc..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/shared/article.service.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { map } from 'rxjs/operators'; -import { Article } from './article.model'; -import { environment } from 'environments/environment'; -import { ObjectListResolver, ObjectResolver } from 'app/core'; - - -@Injectable({ - providedIn: 'root', -}) -export class ArticleService { - - private baseUrl = environment.showcaseApiUrl + 'articles/'; - - constructor(private http: HttpClient) { } - - adapt(item: any): Article { - return new Article({ - id: item.id, - slug: item.slug, - title: item.title, - introduction: item.introduction, - content: item.content, - published: new Date(item.published), - modified: item.modified ? new Date(item.modified) : null, - image: item.image, - displayImage: item.display_image, - pinned: item.pinned, - categories: item.categories, - }); - } - - list(): Observable<Article[]> { - return this.http.get<Article>(this.baseUrl).pipe( - map((articles: any) => articles.map(this.adapt)), - ); - } - - first(n: number): Observable<Article[]> { - return this.list().pipe( - map((articles: any) => articles.slice(0, n)) - ); - } - - retrieve(slug: string): Observable<Article> { - let url = this.baseUrl + `${slug}/`; - return this.http.get<Article>(url).pipe( - map((article: any) => this.adapt(article)), - ); - } -} - - -@Injectable({ - providedIn: 'root', -}) -export class ArticlesResolver extends ObjectListResolver<Article> { - constructor(public service: ArticleService) { super(); } -} - - -@Injectable({ - providedIn: 'root', -}) -export class ArticleResolver extends ObjectResolver<Article> { - routeLookupKey = 'slug'; - constructor(public service: ArticleService) { super(); } -} diff --git a/src_/app/showcase-site/shared/category.service.ts b/src_/app/showcase-site/shared/category.service.ts deleted file mode 100644 index ec4c3ae6104bfc7ef42f396c4b3ea13333b79774..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/shared/category.service.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Injectable } from '@angular/core'; -import { environment } from 'environments/environment'; -import { SimpleListResolver } from 'app/core'; - - -@Injectable({ - providedIn: 'root', -}) -export class CategoriesResolver extends SimpleListResolver<string> { - - name = 'categories'; - url = environment.showcaseApiUrl + 'categories/'; - - adapt(item: any): string { - return item.title; - } -} diff --git a/src_/app/showcase-site/shared/documents.resolvers.ts b/src_/app/showcase-site/shared/documents.resolvers.ts deleted file mode 100644 index 30f7968a68328df09ec79497e33f181647a49789..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/shared/documents.resolvers.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Injectable } from '@angular/core'; -import { DocumentResolver } from 'app/core'; - -@Injectable({ - providedIn: 'root', -}) -export class MentionsResolver extends DocumentResolver { - slug = 'mentions-legales'; -} - -@Injectable({ - providedIn: 'root', -}) -export class DonateResolver extends DocumentResolver { - slug = 'pourquoi-nous-soutenir'; -} diff --git a/src_/app/showcase-site/shared/index.ts b/src_/app/showcase-site/shared/index.ts deleted file mode 100644 index 4c05f0da2ae0662d8470835107c32a973f2a10f1..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/shared/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -export * from './action.model'; -export * from './action.service'; -export * from './article.model'; -export * from './article.service'; -export * from './category.service'; -export * from './keyfigure.model'; -export * from './keyfigure.service'; -export * from './testimony.model'; -export * from './testimony.service'; -export * from './partner.model'; -export * from './partner.service'; -export * from './documents.resolvers'; diff --git a/src_/app/showcase-site/shared/keyfigure.model.ts b/src_/app/showcase-site/shared/keyfigure.model.ts deleted file mode 100644 index 5e58af2a955827d4d9e5b4586baa0c72430b6d21..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/shared/keyfigure.model.ts +++ /dev/null @@ -1,8 +0,0 @@ -export class KeyFigure { - value: number; - text: string; - - constructor(obj) { - for (const k of Object.keys(obj)) { this[k] = obj[k]; } - } -} diff --git a/src_/app/showcase-site/shared/keyfigure.service.ts b/src_/app/showcase-site/shared/keyfigure.service.ts deleted file mode 100644 index e56805da60ab91784a466781f6b0fbf0a09e4484..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/shared/keyfigure.service.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Injectable } from '@angular/core'; -import { KeyFigure } from './keyfigure.model'; -import { environment } from 'environments/environment'; -import { SimpleListResolver } from 'app/core'; - - -@Injectable({ - providedIn: 'root', -}) -export class KeyFiguresResolver extends SimpleListResolver<KeyFigure> { - - name = 'key figures'; - url = environment.showcaseApiUrl + 'keyfigures/'; - - adapt(item: any): KeyFigure { - return new KeyFigure({ - value: item.figure, - text: item.description, - }); - } -} diff --git a/src_/app/showcase-site/shared/partner.model.ts b/src_/app/showcase-site/shared/partner.model.ts deleted file mode 100644 index 94d4cae3fc5c4ba2cfb9b6c273028e4921848bd8..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/shared/partner.model.ts +++ /dev/null @@ -1,18 +0,0 @@ -export class Partner { - name: string; - website: string; - logo: string; - premium: boolean; - - constructor(options: { - name: string, - website: string, - logo: string, - premium: boolean, - }) { - this.name = options.name; - this.website = options.website; - this.logo = options.logo; - this.premium = options.premium; - } -} diff --git a/src_/app/showcase-site/shared/partner.service.ts b/src_/app/showcase-site/shared/partner.service.ts deleted file mode 100644 index 1f89fb30c71e9763504ec2caf226a0e74ae743f7..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/shared/partner.service.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Partner } from './partner.model'; -import { Injectable } from '@angular/core'; -import { environment } from 'environments/environment'; -import { SimpleListResolver } from 'app/core'; - - -@Injectable({ - providedIn: 'root', -}) -export class PartnersResolver extends SimpleListResolver<Partner> { - - name = 'partners'; - url = environment.showcaseApiUrl + 'partners/'; - - adapt(item: any): Partner { - return new Partner({ - name: item.name, - website: item.website, - logo: item.logo, - premium: item.premium, - }); - } -} diff --git a/src_/app/showcase-site/shared/testimony.model.ts b/src_/app/showcase-site/shared/testimony.model.ts deleted file mode 100644 index ee0fd98e52dd845a77683f95e9978c98cb7ac924..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/shared/testimony.model.ts +++ /dev/null @@ -1,8 +0,0 @@ -export class Testimony { - content: string; - source: string; - - constructor(obj) { - for (const k of Object.keys(obj)) { this[k] = obj[k]; } - } -} diff --git a/src_/app/showcase-site/shared/testimony.service.ts b/src_/app/showcase-site/shared/testimony.service.ts deleted file mode 100644 index 9168ba0f92b9fa750fafd1856f36a83fee2aae0e..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/shared/testimony.service.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Testimony } from './testimony.model'; -import { environment } from 'environments/environment'; -import { SimpleListResolver } from 'app/core'; - - -@Injectable({ - providedIn: 'root', -}) -export class TestimoniesResolver extends SimpleListResolver<Testimony> { - - name = 'testimonies'; - url = environment.showcaseApiUrl + 'testimonies/'; - - adapt(item: any): Testimony { - return new Testimony({ - content: item.quote, - source: item.source, - }); - } -} diff --git a/src_/app/showcase-site/showcase-site-routing.module.ts b/src_/app/showcase-site/showcase-site-routing.module.ts deleted file mode 100644 index df7ddaf805dc88c977134d885bdafbe0b9cfdf09..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/showcase-site-routing.module.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; - -import { ShowcaseSiteComponent } from './showcase-site.component'; -import { LandingPageComponent } from './landing-page'; -import { AboutPageComponent } from './about-page'; -import { DonatePageComponent } from './donate-page'; -import { ContactPageComponent } from './contact-page'; -import { NewsPageComponent } from './news-page'; -import { NewsDetailPageComponent } from './news-detail-page'; -import { ActionsPageComponent } from './actions-page'; -import { MentionsComponent } from './mentions'; - -import { - ActionsResolver, - TestimoniesResolver, - CategoriesResolver, - KeyFiguresResolver, - PartnersResolver, - ArticlesResolver, ArticleResolver, - MentionsResolver, DonateResolver, -} from './shared'; - -const routes: Routes = [ - { - path: '', - component: ShowcaseSiteComponent, - children: [ - { - path: '', - component: LandingPageComponent, - resolve: { - 'actions': ActionsResolver, - 'partners': PartnersResolver, - }, - data: { title: 'Accueil' }, - }, - { - path: 'qui-sommes-nous', - component: AboutPageComponent, - resolve: { 'keyFigures': KeyFiguresResolver }, - data: { title: 'Qui sommes-nous ?' }, - }, - { - path: 'actions', - component: ActionsPageComponent, - resolve: { - 'actions': ActionsResolver, - 'testimonies': TestimoniesResolver, - }, - data: { title: 'Nos actions' }, - }, - { - path: 'nous-soutenir', - component: DonatePageComponent, - resolve: { 'document': DonateResolver }, - data: { title: 'Nous soutenir' }, - }, - { - path: 'actualites', - data: { title: 'Actualités' }, - children: [ - { - path: '', - component: NewsPageComponent, - resolve: { - 'articles': ArticlesResolver, - 'categories': CategoriesResolver, - }, - }, - { - path: ':slug', - component: NewsDetailPageComponent, - resolve: { - 'article': ArticleResolver, - 'articles': ArticlesResolver - }, - }, - ] - }, - { - path: 'contact', - component: ContactPageComponent, - data: { title: 'Contact' }, - }, - { - path: 'mentions-legales', - component: MentionsComponent, - resolve: { 'document': MentionsResolver }, - data: { title: 'Mentions légales' }, - } - ] - }, -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class ShowcaseSiteRoutingModule { } diff --git a/src_/app/showcase-site/showcase-site.component.html b/src_/app/showcase-site/showcase-site.component.html deleted file mode 100644 index 9ea1188b4407d82e26dd71744a989d7a821c71a7..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/showcase-site.component.html +++ /dev/null @@ -1,4 +0,0 @@ -<app-layout [links]="navLinks"> - <app-login-button app-navbar-extra class="login-link"></app-login-button> - <app-login-button app-navbar-extra-narrow class="text-center login-link"></app-login-button> -</app-layout> diff --git a/src_/app/showcase-site/showcase-site.component.scss b/src_/app/showcase-site/showcase-site.component.scss deleted file mode 100644 index 76eba4bf645ebaa572aaeefd0bacdcb8478e283a..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/showcase-site.component.scss +++ /dev/null @@ -1,5 +0,0 @@ -.login-link { - display: block; - margin: auto 0; - padding: 1em 0; -} diff --git a/src_/app/showcase-site/showcase-site.component.ts b/src_/app/showcase-site/showcase-site.component.ts deleted file mode 100644 index 89f9c6d269f87157f00aaf67b613876f9ccf662b..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/showcase-site.component.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Component } from '@angular/core'; -import { Link } from 'app/shared'; - -@Component({ - selector: 'app-showcase-site', - templateUrl: './showcase-site.component.html', - styleUrls: ['./showcase-site.component.scss'] -}) -export class ShowcaseSiteComponent { - - navLinks: Link[] = [ - { href: '/qui-sommes-nous', text: 'Qui sommes-nous ?' }, - { href: '/actions', text: 'Nos actions' }, - { href: '/nous-soutenir', text: 'Soutenez-nous' }, - { href: '/actualites', text: 'Actualités' }, - { href: '/contact', text: 'Contact' } - ]; - -} diff --git a/src_/app/showcase-site/showcase-site.module.ts b/src_/app/showcase-site/showcase-site.module.ts deleted file mode 100644 index 40a18b08910e546a636907b60507bfde73261454..0000000000000000000000000000000000000000 --- a/src_/app/showcase-site/showcase-site.module.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { NgModule } from '@angular/core'; - -// Modules -import { CommonModule } from '@angular/common'; -import { RouterModule } from '@angular/router'; -import { CoreModule } from 'app/core'; -import { SharedModule } from 'app/shared'; -import { Ng2EmojiModule } from 'ng2-emoji'; -import { ShowcaseSiteRoutingModule } from './showcase-site-routing.module'; - -// Components -import { ShowcaseSiteComponent } from './showcase-site.component'; -import { LandingPageComponent } from './landing-page'; -import { ArticleCardComponent } from './article-card'; -import { DonatePageComponent } from './donate-page'; -import { ContactPageComponent } from './contact-page'; -import { ActionsPageComponent } from './actions-page'; -import { AboutPageComponent } from './about-page'; -import { NewsPageComponent } from './news-page'; -import { ArticleItemComponent } from './article-item'; -import { PartnerLogoComponent } from './partner-logo'; -import { NewsDetailPageComponent } from './news-detail-page'; -import { CarouselComponent, CarouselDirective, CarouselItemElement } from './carousel'; -import { MentionsComponent } from './mentions'; - -@NgModule({ - imports: [ - CommonModule, - RouterModule, - CoreModule, - SharedModule, - Ng2EmojiModule.forRoot(), - ShowcaseSiteRoutingModule, - ], - declarations: [ - ShowcaseSiteComponent, - LandingPageComponent, - ArticleCardComponent, - DonatePageComponent, - ContactPageComponent, - ActionsPageComponent, - NewsPageComponent, - AboutPageComponent, - ArticleItemComponent, - NewsDetailPageComponent, - PartnerLogoComponent, - CarouselComponent, - CarouselDirective, - CarouselItemElement, - MentionsComponent, - ], - exports: [ - ShowcaseSiteComponent - ] -}) -export class ShowcaseSiteModule { } diff --git a/src_/app/signup/core/index.ts b/src_/app/signup/core/index.ts deleted file mode 100644 index dbcc0f66bb1c8b7aaa99783d11c58cd70ec1a3e7..0000000000000000000000000000000000000000 --- a/src_/app/signup/core/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './registration.model'; -export * from './registration.service'; -export * from './personnalData.model'; -export * from './personnalData.service'; -export * from './password.matcher'; -// commentaire \ No newline at end of file diff --git a/src_/app/signup/core/password.matcher.ts b/src_/app/signup/core/password.matcher.ts deleted file mode 100644 index 8d9f40ed61fbbfc2adf88f6fdd2ad071e1681abe..0000000000000000000000000000000000000000 --- a/src_/app/signup/core/password.matcher.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { FormControl, FormGroupDirective, NgForm } from '@angular/forms'; -import { ErrorStateMatcher } from '@angular/material'; - -// From: https://stackoverflow.com/a/51606362 -export class PasswordErrorStateMatcher implements ErrorStateMatcher { - isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean { - const invalidParent = !!(control && control.parent && control.parent.invalid && control.parent.dirty); - return (control && control.dirty && invalidParent); - } -} diff --git a/src_/app/signup/core/personnalData.model.ts b/src_/app/signup/core/personnalData.model.ts deleted file mode 100644 index 50e4f3ced39e624b076365250c1bfe2b71d82f1c..0000000000000000000000000000000000000000 --- a/src_/app/signup/core/personnalData.model.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Address, AddressAdapter } from 'app/core'; - -class PersonnalDataSchema { - gender: string; - adressNumber:string; - street:string; - zipCode:string; - city:string; - personnalPhone:string; - parentsPhone:string; - parentsEmail:string; - school:string; - grade:string; - section:string; - specialTeaching:string; - scholarship:string; - fatherActivity:string; - motherActivity:string; - parentsStatus:string; - dependantsNumber:number; -} - -export class PersonnalData extends PersonnalDataSchema { - - constructor(args: PersonnalDataSchema) { - super(); - Object.assign(this, args); - } -} - -@Injectable({ - providedIn: 'root' -}) -export class PersonnalDataAdapter { - - constructor(private addressAdapter: PersonnalDataAdapter) { } - - encode(obj: PersonnalData): any { - return { - gender: obj.gender, - adressNumber: obj.adressNumber, - street:obj.street, - zipCode:obj.zipCode, - city:obj.city, - personnalPhone:obj.personnalPhone, - parentsPhone:obj.parentsPhone, - parentsEmail:obj.parentsEmail, - school:obj.school, - grade:obj.grade, - section:obj.section, - specialTeaching:obj.specialTeaching, - scholarship:obj.scholarship, - fatherActivity:obj.fatherActivity, - motherActivity:obj.motherActivity, - parentsStatus:obj.parentsStatus, - dependantsNumber:obj.dependantsNumber - } - } -} diff --git a/src_/app/signup/core/personnalData.service.ts b/src_/app/signup/core/personnalData.service.ts deleted file mode 100644 index 1b8a2ab4b850ea25d4577eab71cd10722f6f36c2..0000000000000000000000000000000000000000 --- a/src_/app/signup/core/personnalData.service.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { Observable, of } from 'rxjs'; -import { environment } from 'environments/environment'; -import { PersonnalData,PersonnalDataAdapter } from './personnalData.model'; - -@Injectable({ - providedIn: 'root', -}) -export class PersonnalDataService { - - private baseUrl = environment.apiUrl + 'personnalData/'; - - constructor(private http: HttpClient, private adapter: PersonnalDataAdapter) { } - - create(personnalData: PersonnalData): Observable<any> { - const body: any = this.adapter.encode(personnalData); - - return this.http.post(this.baseUrl, body); - } - -} diff --git a/src_/app/signup/core/registration.model.ts b/src_/app/signup/core/registration.model.ts deleted file mode 100644 index 66ec0669fa892235a549a7df8340671b849e54da..0000000000000000000000000000000000000000 --- a/src_/app/signup/core/registration.model.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Address, AddressAdapter } from 'app/core'; - -class RegistrationSchema { - email: string; - firstName: string; - lastName: string; - phoneNumber: string; -} - -export class Registration extends RegistrationSchema { - - constructor(args: RegistrationSchema) { - super(); - Object.assign(this, args); - } -} - -@Injectable({ - providedIn: 'root' -}) -export class RegistrationAdapter { - - constructor(private addressAdapter: AddressAdapter) { } - - encode(obj: Registration): any { - return { - email: obj.email, - first_name: obj.firstName, - last_name: obj.lastName, - phone_number: obj.phoneNumber, - } - } -} diff --git a/src_/app/signup/core/registration.service.ts b/src_/app/signup/core/registration.service.ts deleted file mode 100644 index 615b42c3a567c94fa2b24ccb591811b9c2425255..0000000000000000000000000000000000000000 --- a/src_/app/signup/core/registration.service.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { Observable, of } from 'rxjs'; -import { environment } from 'environments/environment'; -import { Registration, RegistrationAdapter } from './registration.model'; - -@Injectable({ - providedIn: 'root', -}) -export class RegistrationService { - - private baseUrl = environment.apiUrl + 'registrations/'; - - constructor(private http: HttpClient, private adapter: RegistrationAdapter) { } - - create(registration: Registration, password: string): Observable<any> { - const body: any = this.adapter.encode(registration); - body.password = password; - return this.http.post(this.baseUrl, body); - } - -} diff --git a/src_/app/signup/signup-routing.module.ts b/src_/app/signup/signup-routing.module.ts deleted file mode 100644 index d378be52437b82248776985325ee48fa50940b0c..0000000000000000000000000000000000000000 --- a/src_/app/signup/signup-routing.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { StudentSignupComponent } from './student-signup/student-signup.component'; - - -const routes: Routes = [ - { - path: '', - component: StudentSignupComponent - }, -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class SignupRoutingModule { } diff --git a/src_/app/signup/signup.module.ts b/src_/app/signup/signup.module.ts deleted file mode 100644 index 245b3c29f1ab39ba7c6324f80c88bac1bf9fdaa2..0000000000000000000000000000000000000000 --- a/src_/app/signup/signup.module.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; - -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { RouterModule } from '@angular/router'; - -import { - MatFormFieldModule, - MatInputModule, - MatSelectModule, - MatButtonModule, - MatSnackBarModule, - MatCheckboxModule, - MatIconModule, - MatSlideToggleModule, -} from '@angular/material'; - -import { SharedModule } from 'app/shared'; -import { SignupRoutingModule } from './signup-routing.module'; -import { StudentSignupComponent } from './student-signup/student-signup.component'; - -@NgModule({ - declarations: [ - StudentSignupComponent, - ], - imports: [ - CommonModule, - FormsModule, - ReactiveFormsModule, - RouterModule, - SignupRoutingModule, - SharedModule, - // Material - MatFormFieldModule, - MatSelectModule, - MatInputModule, - MatButtonModule, - MatSnackBarModule, - MatCheckboxModule, - MatIconModule, - MatSlideToggleModule, - ], -}) -export class SignupModule { } diff --git a/src_/app/signup/student-signup/student-signup.component.html b/src_/app/signup/student-signup/student-signup.component.html deleted file mode 100644 index 31e460d98d2eb944c214c92d8d263b7074be2824..0000000000000000000000000000000000000000 --- a/src_/app/signup/student-signup/student-signup.component.html +++ /dev/null @@ -1,68 +0,0 @@ -<app-form-page> - - <form [formGroup]="formGroup" (ngSubmit)="submit()"> - - <h1>Inscription</h1> - - <p> - Bienvenue ! Procédons à ton inscription sur l'espace lycéens. - </p> - - <!-- First name --> - <mat-form-field class="full-width"> - <input matInput type="text" formControlName="firstName" placeholder="Prénom" required> - </mat-form-field> - - <!-- Last name --> - <mat-form-field class="full-width"> - <input matInput type="text" formControlName="lastName" placeholder="Nom" required> - </mat-form-field> - - <!-- Email --> - <mat-form-field class="full-width"> - <input matInput type="email" formControlName="email" placeholder="Adresse email" required> - <mat-hint> - Elle te servira d'identifiant de connexion. - </mat-hint> - </mat-form-field> - - <mat-form-field class="full-width"> - <input matInput type="tel" formControlName="phoneNumber" placeholder="Numéro de téléphone" required> - <mat-hint> - Il nous permettra de te contacter en cas de nécessité. - </mat-hint> - </mat-form-field> - - - <p> - Il ne te reste plus qu'à choisir un mot de passe. :-) - </p> - - <!-- Password --> - <mat-form-field class="full-width"> - <input matInput type="password" formControlName="password" placeholder="Mot de passe" required> - </mat-form-field> - - <!-- Confirm password --> - <mat-form-field class="full-width"> - <input matInput type="password" formControlName="passwordConfirm" placeholder="Confirmer le mot de passe" - [errorStateMatcher]="matcher"> - <mat-error *ngIf="formGroup.hasError('passwordsDifferent')"> - Les mots de passe doivent être identiques. - </mat-error> - </mat-form-field> - - <div class="text-center"> - <button mat-raised-button color="primary" [disabled]="!formGroup.valid || loading"> - M'inscrire - <app-load-spinner *ngIf="loading" [block]="false"></app-load-spinner> - </button> - </div> - <p class="text-center">{{error}}</p> - - - <p class="text-center"> - J'ai déjà un compte ! <a routerLink="/connexion">Me connecter</a> - </p> - </form> -</app-form-page> diff --git a/src_/app/signup/student-signup/student-signup.component.scss b/src_/app/signup/student-signup/student-signup.component.scss deleted file mode 100644 index 9c39d1abb3430ba8ddec4521194896d92fdaff6a..0000000000000000000000000000000000000000 --- a/src_/app/signup/student-signup/student-signup.component.scss +++ /dev/null @@ -1,19 +0,0 @@ -.checkbox-field { - display: block; - margin: .5em 0; -} -.form-group{ - display:flex; - flex-direction: row; - justify-content: space-between; -} -.horizontal-display{ - width:45%; -} -.adress-input{ - margin:5px; -} - -.quarter-display{ - width:25%; -} \ No newline at end of file diff --git a/src_/app/signup/student-signup/student-signup.component.ts b/src_/app/signup/student-signup/student-signup.component.ts deleted file mode 100644 index 1069166c86cd905054944b8e17b2f6ee0f1fa435..0000000000000000000000000000000000000000 --- a/src_/app/signup/student-signup/student-signup.component.ts +++ /dev/null @@ -1,154 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { FormGroup, FormBuilder, Validators } from '@angular/forms'; -import { Router } from '@angular/router'; -import { MatSnackBar } from '@angular/material'; -import { Observable } from 'rxjs'; -import { tap, mergeMap } from 'rxjs/operators'; -import { Registration, RegistrationService, PasswordErrorStateMatcher,PersonnalData,PersonnalDataService } from '../core'; -import { AuthService } from 'app/core'; - - -@Component({ - selector: 'app-student-signup', - templateUrl: './student-signup.component.html', - styleUrls: ['./student-signup.component.scss'] -}) -export class StudentSignupComponent implements OnInit { - - registration: Registration; - personnalData: PersonnalData - formGroup: FormGroup; - error: String; - loading = false; - public showPersonnalDataForm = false; - public zipPattern = new RegExp(/^\d{5}(?:\d{2})?$/) - public possibleParentsStatus = [ - {id:"maried",name:"Vos parents vivent ensemble"}, - {id:"cohabitation",name:"Vos parents vivent séparément"}, - {id:"monoparental",name:"Vous avez un seul parent"} - ] - - public possibleParentsActivities = [ - {id:"farmer",name:"Agriculteur"}, - {id:"artisan",name:"Artisan, commerçant, chef d'entreprise"}, - {id:"executive",name:"Cadre, profession intellectuelle supérieure"}, - {id:"teacher",name:"Enseignant et assimilé"}, - {id:"intermediate",name:"Profession intermédiaire"}, - {id:"employee",name:"Employé"}, - {id:"worker",name:"Ouvrier"}, - {id:"retreated",name:"Retraité"}, - {id:"inactive",name:"Inactif"}, - {id:"other",name:"Autre"} - ] - - public possibleScholarships = [ - {id:"echelon1",name:"Oui, échelon 1"}, - {id:"echelon2",name:"Oui, échelon 2"}, - {id:"echelon3",name:"Oui, échelon 3"}, - {id:"echelon4",name:"Oui, échelon 4"}, - {id:"echelon5",name:"Oui, échelon 5"}, - {id:"echelon6",name:"Oui, échelon 6"}, - {id:"no",name:"Non"}, - ] - - matcher = new PasswordErrorStateMatcher(); - - constructor( - private registrationService: RegistrationService, - private personnalDataService : PersonnalDataService, - private formBuilder: FormBuilder, - private router: Router, - private auth: AuthService, - private snackBar: MatSnackBar, - - ) { } - - ngOnInit() { - this.createForm(); - } - - createForm() { - - this.formGroup = this.formBuilder.group({ - firstName: '', - lastName: '', - email: ['', Validators.email], - phoneNumber: '', - gender:'', - adressNumber:'', - street:'', - zipCode:['',Validators.pattern(this.zipPattern)], - city:'', - personnalPhone:'', - parentsPhone:'', - parentsEmail:['',Validators.email], - school:'', - grade:'', - section:'', - specialTeaching:'', - scholarship:'', - fatherActivity:'', - motherActivity:'', - parentsStatus:'', - dependantsNumber:'', - password: '', - passwordConfirm: '', - agree: [false, Validators.required], - filledForm: false, - acceptedConditions: false, - }, { validator: (group) => this.checkPasswords(group)},) - console.log(this.formGroup.value.agree) - } - - private checkPasswords(group: FormGroup): null | any { - const password = group.controls.password.value; - const passwordConfirm = group.controls.passwordConfirm.value; - return password === passwordConfirm ? null : { passwordsDifferent: true }; - } - toggleShowPersonnalDataForm(){ - this.showPersonnalDataForm = !this.showPersonnalDataForm; - } - submit() { - this.loading = true; - const {email,firstName,lastName,phoneNumber} = this.formGroup.value - //const {gender,adressNumber,street,zipCode,city,personnalPhone,parentsPhone,parentsEmail,school,grade,section,specialTeaching,scholarship,fatherActivity,motherActivity,parentsStatus,dependantsNumber} = this.formGroup.value; - const registration: Registration = {email,firstName,lastName,phoneNumber}; - // const personnalData: PersonnalData = {gender,adressNumber,street,zipCode,city,personnalPhone,parentsPhone,parentsEmail,school,grade,section,specialTeaching,scholarship,fatherActivity,motherActivity,parentsStatus,dependantsNumber}; - - const password: string = this.formGroup.controls.password.value; - this.registrationService.create(registration, password).pipe( - mergeMap(() => this.auth.login(registration.email, password)), - tap(() => this.snackBar.open( - `Ton compte a été créé ! Tu es maintenant connecté.`, - 'OK', - { duration: 3000 }, - )), - tap(()=> this.error = ""), - tap(() => this.loading = false), - tap(() => { - setTimeout(()=>{ - this.router.navigate(['./membres']) - - },3000)}) - - ).subscribe( - () => {}, - (error) => { - - - this.loading=false - - if(error.error.email){ - this.error = "Erreur, cet email est déjà utilisé !" - } - } - ); - // this.personnalDataService.create(personnalData).pipe( - // tap(() => this.loading = false), - // tap(() => this.router.navigate(['/'])), - // ).subscribe( - // () => {}, - // (error) => this.loading = false, - // ); - } -} diff --git a/src_/assets/.gitkeep b/src_/assets/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src_/assets/img/aboutus-img1.jpg b/src_/assets/img/aboutus-img1.jpg deleted file mode 100644 index dbce3c6c3c466c5ad02a02e5ad7b360679134b39..0000000000000000000000000000000000000000 Binary files a/src_/assets/img/aboutus-img1.jpg and /dev/null differ diff --git a/src_/assets/img/groupe-bw.jpg b/src_/assets/img/groupe-bw.jpg deleted file mode 100644 index f07ea823a5b979a31712d0d28ff9ffe248a33335..0000000000000000000000000000000000000000 Binary files a/src_/assets/img/groupe-bw.jpg and /dev/null differ diff --git a/src_/assets/img/groupe-oser-bw.jpg b/src_/assets/img/groupe-oser-bw.jpg deleted file mode 100644 index 21599886323ff57e81d65df6b90d87bff933060c..0000000000000000000000000000000000000000 Binary files a/src_/assets/img/groupe-oser-bw.jpg and /dev/null differ diff --git a/src_/assets/img/groupe.jpg b/src_/assets/img/groupe.jpg deleted file mode 100644 index d96732b0f12d9947e1b6b4579bcd66b4e2191851..0000000000000000000000000000000000000000 Binary files a/src_/assets/img/groupe.jpg and /dev/null differ diff --git a/src_/assets/img/oser-logo-white.png b/src_/assets/img/oser-logo-white.png deleted file mode 100644 index 936dee5bfaa8d48b3ba26daa6dcc7754d77a8264..0000000000000000000000000000000000000000 Binary files a/src_/assets/img/oser-logo-white.png and /dev/null differ diff --git a/src_/assets/img/oser-logo.png b/src_/assets/img/oser-logo.png deleted file mode 100644 index 6f12b2d2c799235c0e89ed27b6ac9c25ca5ba6a8..0000000000000000000000000000000000000000 Binary files a/src_/assets/img/oser-logo.png and /dev/null differ diff --git a/src_/assets/img/slide-1.jpg b/src_/assets/img/slide-1.jpg deleted file mode 100644 index 816253c9524080aac67cb1835f294655439b4ceb..0000000000000000000000000000000000000000 Binary files a/src_/assets/img/slide-1.jpg and /dev/null differ diff --git a/src_/assets/img/slide-2.jpg b/src_/assets/img/slide-2.jpg deleted file mode 100644 index da894a94e1e7bc5864bc83159a69ef03916306ea..0000000000000000000000000000000000000000 Binary files a/src_/assets/img/slide-2.jpg and /dev/null differ diff --git a/src_/assets/img/slide-3.jpg b/src_/assets/img/slide-3.jpg deleted file mode 100644 index 6f8555fa684dce6b608d7374d1ab662bacdd1fe9..0000000000000000000000000000000000000000 Binary files a/src_/assets/img/slide-3.jpg and /dev/null differ diff --git a/src_/assets/img/soiree-lancement.jpg b/src_/assets/img/soiree-lancement.jpg deleted file mode 100644 index 6f07a36912a695be5c6e3f417d10bd782cb72dfb..0000000000000000000000000000000000000000 Binary files a/src_/assets/img/soiree-lancement.jpg and /dev/null differ diff --git a/src_/assets/img/sortie-decouverte.jpg b/src_/assets/img/sortie-decouverte.jpg deleted file mode 100644 index 8a38bb25f6dc238308b7cb4fc70fa20f90ae5a81..0000000000000000000000000000000000000000 Binary files a/src_/assets/img/sortie-decouverte.jpg and /dev/null differ diff --git a/src_/assets/img/sortie-marvel.jpg b/src_/assets/img/sortie-marvel.jpg deleted file mode 100644 index 29852c8dc143cba14c22f01350c1b7984f0dbfb6..0000000000000000000000000000000000000000 Binary files a/src_/assets/img/sortie-marvel.jpg and /dev/null differ diff --git a/src_/assets/img/sortie-radio.jpg b/src_/assets/img/sortie-radio.jpg deleted file mode 100644 index dadf53aefbef2bf7c300f96f953474f4aca46d3d..0000000000000000000000000000000000000000 Binary files a/src_/assets/img/sortie-radio.jpg and /dev/null differ diff --git a/src_/environments/environment.local.ts b/src_/environments/environment.local.ts deleted file mode 100644 index 198da5d5c8700a770762c7e14e5ce56e5d913fa0..0000000000000000000000000000000000000000 --- a/src_/environments/environment.local.ts +++ /dev/null @@ -1,9 +0,0 @@ -// For use when you have a local backend server running -export const environment = { - production: false, - showcaseApiUrl: 'https://oser-site-vitrine.herokuapp.com/api/', - apiUrl: 'http://localhost:8000/api/', - numArticles: 3, - donateUrl: "https://www.donnerenligne.fr/ouverture-sociale-pour-l-egalite-et-la-reussite/faire-un-don", - currentCampaignUrl: "", -}; diff --git a/src_/environments/environment.prod.ts b/src_/environments/environment.prod.ts deleted file mode 100644 index cb22e925a76648bb8f8c5a393623d8f41436079b..0000000000000000000000000000000000000000 --- a/src_/environments/environment.prod.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Production environment variables -export const environment = { - production: true, - showcaseApiUrl: 'https://oser-site-vitrine.herokuapp.com/api/', - apiUrl: 'https://oser-backend.herokuapp.com/api/', - numArticles: 3, - donateUrl: "https://www.donnerenligne.fr/ouverture-sociale-pour-l-egalite-et-la-reussite/faire-un-don", - currentCampaignUrl: "", -}; diff --git a/src_/environments/environment.ts b/src_/environments/environment.ts deleted file mode 100644 index 549e327c75d5d5d4d166c26ccf803a24d23db2d3..0000000000000000000000000000000000000000 --- a/src_/environments/environment.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Development environment (the default) -export const environment = { - production: false, - showcaseApiUrl: 'https://oser-site-vitrine.herokuapp.com/api/', - apiUrl: 'https://oser-backend-dev.herokuapp.com/api/', - numArticles: 3, - donateUrl: "https://www.donnerenligne.fr/ouverture-sociale-pour-l-egalite-et-la-reussite/faire-un-don", - currentCampaignUrl: "", -}; diff --git a/src_/favicon.ico b/src_/favicon.ico deleted file mode 100644 index 32695caf0b97ae74b9e7cbe7f5f0e1c39c7261c8..0000000000000000000000000000000000000000 Binary files a/src_/favicon.ico and /dev/null differ diff --git a/src_/index.html b/src_/index.html deleted file mode 100644 index 57e9fbd39d0ba2109b98297956552e9e31ddf6a8..0000000000000000000000000000000000000000 --- a/src_/index.html +++ /dev/null @@ -1,23 +0,0 @@ - -<!doctype html> -<html> -<head> -<!-- Page qui sert à afficher la roue tournante "loading"--> - <meta charset="utf-8"> - <title>OSER</title> - <base href="/"> - - <meta name="viewport" content="width=device-width, initial-scale=1"> - <link rel="icon" type="image/x-icon" href="favicon.ico"> - <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> -</head> -<body> - <!--app-root> - <div id="index-loading"> - <i class="fa fa-spinner fa-pulse fa-2x"></i> - </div> - </app-root--> - <app-root></app-root> - <script src="https://use.fontawesome.com/9f3eb7630e.js"></script> -</body> -</html> diff --git a/src_/main.ts b/src_/main.ts deleted file mode 100644 index f1a4024269db2f8b39c40347816ae462a3c18c06..0000000000000000000000000000000000000000 --- a/src_/main.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { enableProdMode } from '@angular/core'; -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; - -import { AppModule } from './app/app.module'; -import { environment } from './environments/environment'; - -// Angular Material gesture support -import 'hammerjs'; - -if (environment.production) { - enableProdMode(); -} - -platformBrowserDynamic().bootstrapModule(AppModule); diff --git a/src_/polyfills.ts b/src_/polyfills.ts deleted file mode 100644 index 60d9478209e2d29c4294a761ca2b4a7984f6e2d9..0000000000000000000000000000000000000000 --- a/src_/polyfills.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * This file includes polyfills needed by Angular and is loaded before the app. - * You can add your own extra polyfills to this file. - * - * This file is divided into 2 sections: - * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. - * 2. Application imports. Files imported after ZoneJS that should be loaded before your main - * file. - * - * The current setup is for so-called "evergreen" browsers; the last versions of browsers that - * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), - * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. - * - * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html - */ - -/*************************************************************************************************** - * BROWSER POLYFILLS - */ - -/** IE9, IE10 and IE11 requires all of the following polyfills. **/ -// import 'core-js/es6/symbol'; -// import 'core-js/es6/object'; -// import 'core-js/es6/function'; -// import 'core-js/es6/parse-int'; -// import 'core-js/es6/parse-float'; -// import 'core-js/es6/number'; -// import 'core-js/es6/math'; -// import 'core-js/es6/string'; -// import 'core-js/es6/date'; -// import 'core-js/es6/array'; -// import 'core-js/es6/regexp'; -// import 'core-js/es6/map'; -// import 'core-js/es6/set'; - -/** IE10 and IE11 requires the following for NgClass support on SVG elements */ -// import 'classlist.js'; // Run `npm install --save classlist.js`. - -/** IE10 and IE11 requires the following to support `@angular/animation`. */ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. - - -/** Evergreen browsers require these. **/ -import 'core-js/es6/reflect'; -import 'core-js/es7/reflect'; - - -/** ALL Firefox browsers require the following to support `@angular/animation`. **/ -import 'web-animations-js'; // Run `npm install --save web-animations-js`. - - - -/*************************************************************************************************** - * Zone JS is required by Angular itself. - */ -import 'zone.js/dist/zone'; // Included with Angular CLI. - - - -/*************************************************************************************************** - * APPLICATION IMPORTS - */ - -/** - * Date, currency, decimal and percent pipes. - * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 - */ -// import 'intl'; // Run `npm install --save intl`. diff --git a/src_/sass/_material.scss b/src_/sass/_material.scss deleted file mode 100644 index d0a462009eeda1f3c1375a002bb24379d2be9ffb..0000000000000000000000000000000000000000 --- a/src_/sass/_material.scss +++ /dev/null @@ -1,29 +0,0 @@ -@import '~@angular/material/theming'; -@import './palettes'; - -$palette-primary: mat-palette($primary-palette, 700, 300, 900); -$palette-accent: mat-palette($accent-palette); -$palette-warn: mat-palette($warn-palette); - -$theme: mat-light-theme( - $palette-primary, - $palette-accent, - $palette-warn -); - -$typography: mat-typography-config( - $font-family: 'Nunito, sans-serif' -); - - -.radio-v { - display: inline-flex; - flex-direction: column; -} - -mat-radio-button { - margin: .5em 0; -} -mat-radio-group { - margin-bottom: .5em; -} diff --git a/src_/sass/_mixins.scss b/src_/sass/_mixins.scss deleted file mode 100644 index 43287081d728b5b69503fdd819c90d243ebd273e..0000000000000000000000000000000000000000 --- a/src_/sass/_mixins.scss +++ /dev/null @@ -1,398 +0,0 @@ -@import './variables'; -@import './media-queries'; - -@function lightened($color) { - @return lighten(desaturate($color, 20), 45); -} - -/* Spacing */ - -@mixin box-spacing($x: 1) { - padding: $x * .4em $x * .7em; - box-sizing: border-box; -} -/* Use margin-page-X mixins for consistent responsive page margins */ -@mixin margin-page-horizontal() { - padding-left: $margin-page; - padding-right: $margin-page; - @include media-xs { - $m: 3 * $margin-page; - padding-left: $m; - padding-right: $m; - } -} -@mixin margin-page-vertical() { - padding-top: $margin-page; - padding-bottom: $margin-page; -} -@mixin margin-page() { - @include margin-page-horizontal; - @include margin-page-vertical; -} -.page { - @include margin-page; -} - -/* Styles */ - -@mixin style-base($color) { - color: $color; - border-color: $color; -} -@mixin style-danger { - @include style-base($color-danger); -} -@mixin style-success { - @include style-base($color-success); -} -@mixin style-info { - @include style-base($color-info); -} -@mixin style-warning { - @include style-base($color-warning); -} -@mixin style-primary { - @include style-base($color-primary); -} -@mixin style-secondary { - @include style-base($color-secondary); -} -@mixin style-default { - @include style-base($color-default); -} -.style-danger { - @include style-danger; -} -.style-success { - @include style-success; -} -.style-info { - @include style-info; -} -.style-warning { - @include style-warning; -} -.style-primary { - @include style-primary; -} -.style-secondary { - @include style-secondary; -} -.style-default { - @include style-default; -} - -/* Buttons */ - -@mixin btn($color, $hover-color: white, $hover-bg: none, $bg: none, $color-border: 0) { - @if ($hover-bg == none) { - $hover-bg: $color; - } - @if ($color-border == 0) { - $color-border: $hover-bg; - } - -webkit-appearance: none; - -webkit-border-radius: 0; - border: none; - @if ($color-border) { - border: 1px solid $color-border; - } - color: $color; - background: $bg; - padding: 8px; - border-radius: 4px; - transition: background 0.2s, color 0.2s; - font-weight: bold; - cursor: pointer; - - $disabled-color: desaturate($color, 50); - $disabled-hover-color: desaturate($hover-color, 50); - &:hover { - background: $hover-bg; - color: $hover-color !important; - } - &:disabled { - background: $bg; - border-color: $disabled-color; - color: $disabled-color !important; - cursor: not-allowed; - } -} -.btn-success { - @include btn($color-success); -} -.btn-danger { - @include btn($color-danger); -} -.btn-warning { - @include btn($color-warning); -} -.btn-info { - @include btn($color-info); -} -.btn-primary { - @include btn($color-primary); -} -.btn-secondary { - @include btn($color-secondary); -} -.btn-default { - @include btn($color-default); -} -.btn-white { - @include btn(white, $hover-color: $color-text); -} -.btn-light { - @include btn($color-light-blue, $hover-color: $color-text); -} - -/* Alerts */ -@mixin alert($color) { - @include style-base($color); - background: lightened($color); -} -.alert { - @include box-spacing(1.3); - width: 100%; - $m: .2em; - margin-top: $m; - margin-bottom: $m; - border-radius: 4px; -} -.alert-danger { - @include alert($color-danger); -} -.alert-success { - @include alert($color-success); -} -.alert-warning { - @include alert($color-warning); -} -.alert-info { - @include alert($color-info); -} -.alert-primary { - @include alert($color-primary); -} -.alert-secondary { - @include alert($color-secondary); -} -.alert-default { - @include alert($color-default); -} - -/* Effects */ -$shadow-sm: .05em; -$shadow-md: .1em; -$shadow-lg: .2em; -$shadow-ref: .13em; -@mixin shadow($props) { - -moz-box-shadow: $props; - -webkit-box-shadow: $props; - box-shadow: $props; -} -@mixin drop-shadow($size: $shadow-md, $inset: false) { - $intensity: $size / $shadow-ref; - $y: 8px * $intensity; - $blur-radius: 3px + 7px * $intensity; - $spread-radius: 2px + 1px * $intensity; - $color: rgba(0, 0, 0, .1); - $props: 0 $y $blur-radius $spread-radius $color; - @if $inset == true { - @include shadow($props inset); - } - @if $inset == false { - @include shadow($props); - } -} -@mixin drop-shadow-inset($size: $shadow-md) { - @include drop-shadow($size, true); -} -@mixin drop-shadow-light { - @include drop-shadow($shadow-sm); -} -@mixin drop-shadow-light-inset { - @include drop-shadow(.5, true); -} -@mixin drop-shadow-animate($begin, $end) { - @include drop-shadow($begin); - $raise: 2 * ($end - $begin); - $t: .4s; - $scale: 1 + .02 * $raise / .34em; - transition: transform $t, box-shadow $t; - &:hover { - @include drop-shadow($end); - transform: translateY(-$raise) scale($scale); - } -} -.drop-shadow-sm-md { - @include drop-shadow-animate($shadow-sm, $shadow-md); -} -.drop-shadow-sm-lg { - @include drop-shadow-animate($shadow-sm, $shadow-lg); -} -.drop-shadow-md-lg { - @include drop-shadow-animate($shadow-md, $shadow-lg); -} -.drop-shadow-sm { - @include drop-shadow($shadow-sm); -} -.drop-shadow-md { - @include drop-shadow($shadow-md); -} -.drop-shadow-lg { - @include drop-shadow($shadow-lg); -} - -@mixin badge($color) { - color: $color; - background-color: lightened($color); -} - -.badge { - @include box-spacing; - display: inline-block; - border-radius: 2em; - margin: .2em; - font-size: small; -} -.badge-lg { - @include box-spacing(1.3); - font-size: medium !important; -} -.badge-sm { - @include box-spacing(0.7); - font-size: x-small !important; -} -.badge-success { - @include style-success; - @include badge($color-success); -} -.badge-danger { - @include style-danger; - @include badge($color-danger); -} -.badge-warning { - @include style-warning; - @include badge($color-warning); -} -.badge-info { - @include style-info; - @include badge($color-info); -} -.badge-primary { - @include style-primary; - @include badge($color-primary); -} -.badge-secondary { - @include style-secondary; - @include badge($color-secondary); -} -.badge-default { - @include style-default; - @include badge($color-default); -} -ul.badge-list { - list-style-type: none; - margin: 0; - padding: 0; - display: flex; - flex-direction: row; - flex-wrap: wrap; -} - -@mixin tooltip($size, $arrow-size, $position) { - position: relative; - text-decoration: underline; - text-decoration-style: dotted; - - .tooltip-text { - visibility: hidden; - background-color: white; - color: $color-text; - text-align: center; - padding: .5em 0; - border-radius: 4px; - width: $size; - - // Position the tooltip text - position: absolute; - @if $position == 'top' { - bottom: 100%; - margin-left: -$size/2; - left: 50%; - } - @if $position == 'bottom' { - top: 100%; - margin-left: -$size/2; - left: 50% - } - @if $position == 'right' { - top: -5px; - left: 105%; - } - @if $position == 'left' { - top: -5px; - right: 105%; - } - - // Place on top - z-index: 1; - - // Tooltip arrow - &::after { - content: ' '; - position: absolute; - @if $position == 'top' { - // arrow at the bottom of the tooltip - top: 100%; - left: 50%; - margin-left: -$arrow-size; - border-color: white transparent transparent transparent; - } - @if $position == 'bottom' { - // arrow at the top of the tooltip - bottom: 100%; - left: 50%; - margin-left: -$arrow-size; - border-color: transparent transparent white transparent; - } - @if $position == 'right' { - top: 50%; - right: 100%; - margin-top: -$arrow-size; - border-color: transparent white transparent transparent; - } - @if $position == 'left' { - top: 50%; - left: 100%; - margin-top: -$arrow-size; - border-color: transparent transparent transparent white; - } - border-width: $arrow-size; - border-style: solid; - } - } - &:hover { - .tooltip-text { - visibility: visible; - } - } -} - -.tooltip { - $size: 15em; - $arrow-size: 5px; - &.top { - @include tooltip($size: $size, $arrow-size: $arrow-size, $position: 'top'); - } - &.bottom { - @include tooltip($size: $size, $arrow-size: $arrow-size, $position: 'bottom'); - } - &.right { - @include tooltip($size: $size, $arrow-size: $arrow-size, $position: 'right'); - } - &.left { - @include tooltip($size: $size, $arrow-size: $arrow-size, $position: 'left'); - } -} diff --git a/src_/sass/_palettes.scss b/src_/sass/_palettes.scss deleted file mode 100644 index e8fe0f7c4acf26537efdd52b90efc7ad01e4a396..0000000000000000000000000000000000000000 --- a/src_/sass/_palettes.scss +++ /dev/null @@ -1,98 +0,0 @@ -$accent-palette: ( - 50 : #fee7ec, - 100 : #fbc4cf, - 200 : #f99caf, - 300 : #f7748e, - 400 : #f55776, - 500 : #f3395e, - 600 : #f13356, - 700 : #ef2c4c, - 800 : #ed2442, - 900 : #ea1731, - A100 : #ffffff, - A200 : #ffe8ea, - A400 : #ffb5bc, - A700 : #ff9ca6, - contrast: ( - 50 : #000000, - 100 : #000000, - 200 : #000000, - 300 : #000000, - 400 : #000000, - 500 : #ffffff, - 600 : #ffffff, - 700 : #ffffff, - 800 : #ffffff, - 900 : #ffffff, - A100 : #000000, - A200 : #000000, - A400 : #000000, - A700 : #000000, - ) -); - -$primary-palette: ( - 50 : #e6e5f0, - 100 : #c0bed9, - 200 : #9792c0, - 300 : #6d66a6, - 400 : #4d4693, - 500 : #2e2580, - 600 : #292178, - 700 : #231b6d, - 800 : #1d1663, - 900 : #120d50, - A100 : #8d87ff, - A200 : #5d54ff, - A400 : #2c21ff, - A700 : #1408ff, - contrast: ( - 50 : #000000, - 100 : #000000, - 200 : #000000, - 300 : #ffffff, - 400 : #ffffff, - 500 : #ffffff, - 600 : #ffffff, - 700 : #ffffff, - 800 : #ffffff, - 900 : #ffffff, - A100 : #000000, - A200 : #ffffff, - A400 : #ffffff, - A700 : #ffffff, - ) -); - -$warn-palette: ( - 50 : #fde5e7, - 100 : #fbbec4, - 200 : #f8939c, - 300 : #f56874, - 400 : #f24757, - 500 : #f02739, - 600 : #ee2333, - 700 : #ec1d2c, - 800 : #e91724, - 900 : #e50e17, - A100 : #ffffff, - A200 : #ffddde, - A400 : #ffaaad, - A700 : #ff9094, - contrast: ( - 50 : #000000, - 100 : #000000, - 200 : #000000, - 300 : #000000, - 400 : #ffffff, - 500 : #ffffff, - 600 : #ffffff, - 700 : #ffffff, - 800 : #ffffff, - 900 : #ffffff, - A100 : #000000, - A200 : #000000, - A400 : #000000, - A700 : #000000, - ) -); diff --git a/src_/sass/_variables.scss b/src_/sass/_variables.scss deleted file mode 100644 index 8bfcba041604a375292e7d62d2959503310a2b62..0000000000000000000000000000000000000000 --- a/src_/sass/_variables.scss +++ /dev/null @@ -1,27 +0,0 @@ -/* Colors */ -$color-darkest-blue: rgb(32, 26, 78); -$color-dark-blue: rgb(46, 37, 128); -$color-purple: rgb(99, 92, 161); -$color-purple-light: rgb(151, 146, 192); -$color-purple-lighter: lighten($color-purple-light, 15); -$color-turquoise: rgb(43, 181, 186); -$color-light-blue: rgb(213, 250, 255); -$color-accent: #F3395E; -$color-light-gray: #f6f6f6; -$color-text: #222; -$color-muted: lighten($color-text, 30); -$color-dark-gray: #555; -$color-danger: darken(#D72638, 5); -$color-success: darken(#0CCE6B, 2); -$color-warning: darken(#F2CD35, 20); -$color-info: darken(#A0F0FF, 40); -$color-default: lighten($color-text, 30); -$color-primary: darken($color-accent, 8); -$color-secondary: lighten($color-dark-blue, 10); - -/* Fonts */ -$font-body: 'Nunito', Arial, sans-serif; -$font-title: 'Raleway', Arial, sans-serif; - -/* Spacing */ -$margin-page: 2em; diff --git a/src_/sass/media-queries.scss b/src_/sass/media-queries.scss deleted file mode 100644 index 6924b3c2675e8a96bedcb385dc1113f9b3cfc3d9..0000000000000000000000000000000000000000 --- a/src_/sass/media-queries.scss +++ /dev/null @@ -1,25 +0,0 @@ -@mixin media-xxs() { - @media (min-width: 480px) { - @content; - } -} -@mixin media-xs() { - @media (min-width: 600px) { - @content; - } -} -@mixin media-sm() { - @media (min-width: 768px) { - @content; - } -} -@mixin media-md() { - @media (min-width: 900px) { - @content; - } -} -@mixin media-lg() { - @media (min-width: 1200px) { - @content; - } -} diff --git a/src_/sass/styles.scss b/src_/sass/styles.scss deleted file mode 100644 index 9dd9f9a59eac4e9e7da41734509089addf056a7f..0000000000000000000000000000000000000000 --- a/src_/sass/styles.scss +++ /dev/null @@ -1,167 +0,0 @@ -@import '~@angular/material/theming'; -@import './variables'; -@import './mixins'; -@import './material'; -@import url('https://fonts.googleapis.com/css?family=Nunito:400,700'); -@import url('https://fonts.googleapis.com/css?family=Raleway:400,700,900'); -@include mat-core(); -@include angular-material-theme($theme); -@include angular-material-typography($typography); - -body { - margin: 0; - font-family: $font-body; - color: $color-text; -} - -h1, h2, h3, h4, h5, h6 { - font-family: $font-title; -} - -h1, h2 { - font-weight: 900; -} - -.text-center { - text-align: center; -} - -.text-success { - color: $color-success; -} - -a { - text-decoration: none; - color: $color-accent; - font-weight: bold; -} - -a.no-style { - color: inherit; - font-weight: inherit; -} - -a.no-color { - color: inherit; -} - -.link-muted { - color: inherit; - font-weight: bold; - cursor: pointer; -} - -hr { - height: 1px; - border-width: 0; - $color: lighten($color-text, 40%); - color: $color; - background-color: $color; -} -// input { -// font-size: inherit; -// font-family: inherit; -// } -// -// input:not([type="file"]) { -// @include box-spacing; -// border: 1px solid darken(lightgray, 10); -// border-radius: 3px; -// } -// -// input.form-control { -// margin: 0.5em 0; -// } - -button { - cursor: pointer; - font-size: inherit; - font-family: inherit; -} -// select { -// font-family: inherit; -// cursor: pointer; -// font-size: inherit; -// @include box-spacing; -// border: 1px solid #ccc; -// border-radius: 4px; -// background-image: none; -// -webkit-appearance: none; -// } - -.text-muted-sm { - font-size: smaller; - color: gray; -} - -.text-muted { - color: gray; -} - -.text-white { - color: white; -} - -#index-loading { - min-width: 100vw; - min-height: 100vh; - display: flex; - align-items: center; - justify-content: center; -} -// Required for emoji support -.emoji { - display: inline-block; -} -// Styling of Markdown contents -.md-content { - img { - display: block; - margin: 0 auto; - max-width: 100%; - height: auto; - @include drop-shadow($shadow-sm); - } - - p { - text-align: justify; - } -} -// textarea { -// font-size: inherit; -// font-family: inherit; -// @include box-spacing(.5); -// border: 1px solid darken(lightgray, 10); -// border-radius: 3px; -// } -// Modals -.modal { - position: fixed; - z-index: 5; - // stay on top - left: 0; - top: 0; - width: 100%; - height: 100%; - padding: 3em 1em; - box-sizing: border-box; - background-color: transparentize(black, .4); -} - -.modal-content { - // enable scroll if needed - overflow: auto; - background: white; - margin: auto; - max-width: 30em; - max-height: 80vh; - padding: 3em; -} - -.full-width { - width: 100%; -} - -.clickable { - cursor: pointer; -} diff --git a/src_/test.ts b/src_/test.ts deleted file mode 100644 index 9bf72267e9b1ada4f46ff6a7729ef5f272f7c947..0000000000000000000000000000000000000000 --- a/src_/test.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js/dist/long-stack-trace-zone'; -import 'zone.js/dist/proxy.js'; -import 'zone.js/dist/sync-test'; -import 'zone.js/dist/jasmine-patch'; -import 'zone.js/dist/async-test'; -import 'zone.js/dist/fake-async-test'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. -declare var __karma__: any; -declare var require: any; - -// Prevent Karma from running prematurely. -__karma__.loaded = function () {}; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); -// Then we find all the tests. -const context = require.context('./', true, /\.spec\.ts$/); -// And load the modules. -context.keys().map(context); -// Finally, start Karma to run the tests. -__karma__.start(); diff --git a/src_/tsconfig.app.json b/src_/tsconfig.app.json deleted file mode 100644 index 7e0f03c12294b8a8020ad16ca2470ba159fbca37..0000000000000000000000000000000000000000 --- a/src_/tsconfig.app.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": "../out-tsc/app", - "module": "es2015", - "baseUrl": "", - "types": [], - "paths": { - "@app/*": ["app/*"], - "@environments/*": ["environments/*"] - } - }, - "exclude": [ - "test.ts", - "**/*.spec.ts" - ] -} diff --git a/src_/tsconfig.spec.json b/src_/tsconfig.spec.json deleted file mode 100644 index 15458edbaa9ffd3cc0c263a079d0bc20cb2d1fc1..0000000000000000000000000000000000000000 --- a/src_/tsconfig.spec.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": "../out-tsc/spec", - "module": "commonjs", - "target": "es5", - "baseUrl": "", - "types": [ - "jasmine", - "node" - ] - }, - "files": [ - "test.ts", - "polyfills.ts" - ], - "include": [ - "**/*.spec.ts", - "**/*.d.ts" - ] -} diff --git a/src_/typings.d.ts b/src_/typings.d.ts deleted file mode 100644 index 78185cc245631cab5acab3a16baa61853c5e3103..0000000000000000000000000000000000000000 --- a/src_/typings.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* SystemJS module definition */ -declare var module: NodeModule; -interface NodeModule { - id: string; -} - -/* Enable JSON file imports as modules */ -declare module "*.json" { - const value: any; - export default value; -}