Ajout de la traduction sur la page d'accueil
This commit is contained in:
@@ -7,33 +7,33 @@
|
||||
<mat-sidenav #snav mode="over" style="padding: 0 20px 0 10px;">
|
||||
<mat-nav-list>
|
||||
<mat-icon aria-hidden="false" aria-label="Summary">timeline</mat-icon>
|
||||
<a routerLink="/summary" routerLinkActive="active" (click)="snav.toggle()" skipLocationChange>Summary</a>
|
||||
<a routerLink="/summary" routerLinkActive="active" (click)="snav.toggle()" skipLocationChange>{{ 'App_Nav_Summary' | translate }}</a>
|
||||
<hr class="splitter">
|
||||
</mat-nav-list>
|
||||
<mat-nav-list>
|
||||
<mat-icon aria-hidden="false" aria-label="List of jumps">list_alt</mat-icon>
|
||||
<a routerLink="/jumps" routerLinkActive="active" (click)="snav.toggle()" skipLocationChange>List of jumps</a>
|
||||
<a routerLink="/jumps" routerLinkActive="active" (click)="snav.toggle()" skipLocationChange>{{ 'App_Nav_Jumps' | translate }}</a>
|
||||
</mat-nav-list>
|
||||
<mat-nav-list>
|
||||
<mat-icon aria-hidden="false" aria-label="Add jumps">add_circle</mat-icon>
|
||||
<a routerLink="/newjump" routerLinkActive="active" (click)="snav.toggle()" skipLocationChange>Add a new jump</a>
|
||||
<a routerLink="/newjump" routerLinkActive="active" (click)="snav.toggle()" skipLocationChange>{{ 'App_Nav_NewJump' | translate }}</a>
|
||||
<hr class="splitter">
|
||||
</mat-nav-list>
|
||||
<mat-nav-list>
|
||||
<mat-icon aria-hidden="false" aria-label="Dropzones">store</mat-icon>
|
||||
<a routerLink="/dzs" routerLinkActive="active" (click)="snav.toggle()" skipLocationChange>List of DZs</a>
|
||||
<a routerLink="/dzs" routerLinkActive="active" (click)="snav.toggle()" skipLocationChange>{{ 'App_Nav_Dzs' | translate }}</a>
|
||||
</mat-nav-list>
|
||||
<mat-nav-list>
|
||||
<mat-icon aria-hidden="false" aria-label="Aircrafts">airplanemode_active</mat-icon>
|
||||
<a routerLink="/aircrafts" routerLinkActive="active" (click)="snav.toggle()" skipLocationChange>List of aircrafts</a>
|
||||
<a routerLink="/aircrafts" routerLinkActive="active" (click)="snav.toggle()" skipLocationChange>{{ 'App_Nav_Aircrafts' | translate }}</a>
|
||||
</mat-nav-list>
|
||||
<mat-nav-list>
|
||||
<mat-icon aria-hidden="false" aria-label="List of jump types">flight_land</mat-icon>
|
||||
<a routerLink="/jumpTypes" routerLinkActive="active" (click)="snav.toggle()" skipLocationChange>List of jump types</a>
|
||||
<a routerLink="/jumpTypes" routerLinkActive="active" (click)="snav.toggle()" skipLocationChange>{{ 'App_Nav_JumpTypes' | translate }}</a>
|
||||
</mat-nav-list>
|
||||
<mat-nav-list>
|
||||
<mat-icon aria-hidden="false" aria-label="List of gears">settings_input_antenna</mat-icon>
|
||||
<a routerLink="/gears" routerLinkActive="active" (click)="snav.toggle()" skipLocationChange>List of gears</a>
|
||||
<a routerLink="/gears" routerLinkActive="active" (click)="snav.toggle()" skipLocationChange>{{ 'App_Nav_Gears' | translate }}</a>
|
||||
</mat-nav-list>
|
||||
<mat-nav-list *ngIf="currentUser">
|
||||
<hr class="splitter">
|
||||
@@ -44,12 +44,12 @@
|
||||
</mat-nav-list>
|
||||
<mat-nav-list *ngIf="currentUser">
|
||||
<mat-icon aria-hidden="false" aria-label="To logout">logout</mat-icon>
|
||||
<span (click)="snav.toggle(); logout()" style="cursor: pointer;">Logout</span>
|
||||
<span (click)="snav.toggle(); logout()" style="cursor: pointer;">sdfsdfsf {{ 'App_Nav_Logout' | translate }}</span>
|
||||
</mat-nav-list>
|
||||
</mat-sidenav>
|
||||
|
||||
<mat-sidenav-content>
|
||||
<router-outlet></router-outlet>
|
||||
<footer style="text-align: right;">Web software to log your skydive jumps - v{{ version }} - @Séb</footer>
|
||||
<footer style="text-align: right;">{{ 'App_Footer' | translate }}{{ version }} - @Séb</footer>
|
||||
</mat-sidenav-content>
|
||||
</mat-sidenav-container>
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { Router } from "@angular/router";
|
||||
import { TranslateService } from "@ngx-translate/core";
|
||||
|
||||
import { User } from "../models/user";
|
||||
import { CacheApiKey } from "../models/cache-api-key.enum";
|
||||
@@ -22,9 +23,13 @@ export class AppComponent implements OnInit {
|
||||
constructor(private router: Router,
|
||||
private authenticationService: AuthenticationService,
|
||||
private serviceComm: ServiceComm,
|
||||
private serviceCacheApi : ServiceCacheApi)
|
||||
private serviceCacheApi : ServiceCacheApi,
|
||||
private translateService: TranslateService)
|
||||
{
|
||||
this.authenticationService.currentUser.subscribe(user => { this.currentUser = user; });
|
||||
this.authenticationService.currentUser.subscribe(user => {
|
||||
this.currentUser = user;
|
||||
this.translateService.use(user.language);
|
||||
});
|
||||
|
||||
ConfigurationHelper.settings.subscribe(settings =>
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { Router, ActivatedRoute } from "@angular/router";
|
||||
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
||||
import { TranslateService } from "@ngx-translate/core";
|
||||
|
||||
import { first } from "rxjs/operators";
|
||||
|
||||
@@ -19,12 +20,11 @@ export class CreateUserComponent implements OnInit {
|
||||
returnUrl: string;
|
||||
error = "";
|
||||
|
||||
constructor(
|
||||
private formBuilder: FormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private authenticationService: AuthenticationService
|
||||
) {
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private authenticationService: AuthenticationService,
|
||||
private translateService: TranslateService) {
|
||||
// redirect to home if already logged in
|
||||
if (this.authenticationService.currentUserValue) {
|
||||
this.router.navigate(["/"]);
|
||||
@@ -69,6 +69,7 @@ export class CreateUserComponent implements OnInit {
|
||||
createUser.firstName = this.formCtrls.firstname.value;
|
||||
createUser.lastName = this.formCtrls.lastname.value;
|
||||
createUser.email = this.formCtrls.email.value;
|
||||
createUser.language = this.translateService.currentLang;
|
||||
|
||||
this.authenticationService.create(createUser)
|
||||
.pipe(first())
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { TranslateService } from "@ngx-translate/core";
|
||||
import { AuthenticationService } from "../../services/authentication.service";
|
||||
import { ServiceComm } from "../../services/service-comm.service";
|
||||
|
||||
@@ -9,10 +10,13 @@ import { ServiceComm } from "../../services/service-comm.service";
|
||||
})
|
||||
export class DefaultComponent implements OnInit {
|
||||
constructor(private serviceComm: ServiceComm,
|
||||
private authenticationService: AuthenticationService) {}
|
||||
private authenticationService: AuthenticationService,
|
||||
private translateService: TranslateService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.UpdatedComponentTitle("Home");
|
||||
this.translateService.get("Home").subscribe(
|
||||
data => { this.serviceComm.UpdatedComponentTitle(data); }
|
||||
)
|
||||
this.authenticationService.alwaysLogin();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { MatInput } from '@angular/material/input';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
@@ -31,7 +32,8 @@ export class LoginUserComponent implements OnInit, AfterViewInit {
|
||||
private serviceApiAircraft : AircraftService,
|
||||
private serviceApiJumpType : JumpTypeService,
|
||||
private serviceApiDropzone : DropzoneService,
|
||||
private serviceApiGear : GearService) {
|
||||
private serviceApiGear : GearService,
|
||||
private translateService: TranslateService) {
|
||||
if (this.authenticationService.currentUserValue) {
|
||||
this.router.navigate(['/']);
|
||||
}
|
||||
@@ -71,7 +73,7 @@ export class LoginUserComponent implements OnInit, AfterViewInit {
|
||||
this.authenticationService.login(this.formCtrls.username.value, this.formCtrls.password.value)
|
||||
.pipe(first())
|
||||
.subscribe(
|
||||
() => {
|
||||
data => {
|
||||
this.serviceApiAircraft.getListOfAircrafts(false).subscribe();
|
||||
this.serviceApiJumpType.getListOfJumpTypes().subscribe();
|
||||
this.serviceApiDropzone.getListOfDropZones(false).subscribe();
|
||||
|
||||
Reference in New Issue
Block a user