Internationnalisation de la page de

récap.
This commit is contained in:
Sébastien André
2021-06-09 14:21:54 +02:00
parent 44ce86c676
commit 63c971ed1b
5 changed files with 56 additions and 20 deletions

View File

@@ -23,10 +23,10 @@
padding-top: 25px;
}
.left130 {
.left160 {
clear: both;
float: left;
width: 130px;
width: 160px;
}
.paragraph {

View File

@@ -1,32 +1,32 @@
<div class="content">
<div class="paragraph">
<label class="left130">Total jumps</label>
<label class="left160">{{ 'Summary_TotalJumps' | translate }}</label>
<span>: {{ totalJumps }}</span>
</div>
<div class="paragraph">
<label class="left130">Total cutaways</label>
<label class="left160">{{ 'Summary_TotalCutaways' | translate }}</label>
<span>: {{ totalCutaways }}</span>
</div>
<div class="paragraph">
<label class="left130">Last jump</label>
<label class="left160">{{ 'Summary_LastJump' | translate }}</label>
<span>: {{ lastJump }}</span>
</div>
<div class="paragraph" style="margin-top: 20px;">
<label class="left130">Refresh</label>
<label class="left160">{{ 'Summary_Refresh' | translate }}</label>
<mat-icon aria-hidden="false" aria-label="Force the refresh of the stats" style="cursor: pointer;"
(click)='refreshStats()'>cached</mat-icon>
</div>
<mat-tab-group mat-align-tabs="left" animationDuration="0ms"
(selectedIndex)="0" (selectedTabChange)="onTabChanged($event);">
<mat-tab label="Jumps in the last month">
<mat-tab label="{{ 'Summary_LastMonth_Title' | translate }}">
<ng-template matTabContent>
<div class="containerFlex">
<fieldset class="contentFlex">
<legend>By DZ</legend>
<legend>{{ 'Summary_LastMonth_ByDz' | translate }}</legend>
<table mat-table [dataSource]="dsJumpForLastMonthByDz">
<ng-container matColumnDef="label">
<td mat-cell *matCellDef="let element">{{element.label}}</td>
@@ -38,7 +38,7 @@
</table>
</fieldset>
<fieldset class="contentFlex">
<legend>By jump type</legend>
<legend>{{ 'Summary_LastMonth_ByJumpType' | translate }}</legend>
<table mat-table [dataSource]="dsJumpForLastMonthByJumpType">
<ng-container matColumnDef="label">
<td mat-cell *matCellDef="let element">{{element.label}}</td>
@@ -53,11 +53,11 @@
</ng-template>
</mat-tab>
<mat-tab label="Jumps in the last year">
<mat-tab label="{{ 'Summary_LastYear_Title' | translate }}">
<ng-template matTabContent>
<div class="containerFlex">
<fieldset class="contentFlex">
<legend>By DZ</legend>
<legend>{{ 'Summary_LastYear_ByDz' | translate }}</legend>
<table mat-table [dataSource]="dsJumpForLastYearByDz">
<ng-container matColumnDef="label">
<td mat-cell *matCellDef="let element">{{element.label}}</td>
@@ -69,7 +69,7 @@
</table>
</fieldset>
<fieldset class="contentFlex">
<legend>By jump type</legend>
<legend>{{ 'Summary_LastYear_ByJumpType' | translate }}</legend>
<table mat-table [dataSource]="dsJumpForLastYearByJumpType">
<ng-container matColumnDef="label">
<td mat-cell *matCellDef="let element">{{element.label}}</td>
@@ -84,7 +84,7 @@
</ng-template>
</mat-tab>
<mat-tab label="By DZ">
<mat-tab label="{{ 'Summary_ByDz_Title' | translate }}">
<ng-template matTabContent>
<table mat-table [dataSource]="dsNbJumpByDz">
<ng-container matColumnDef="label">
@@ -98,7 +98,7 @@
</ng-template>
</mat-tab>
<mat-tab label="By aircraft">
<mat-tab label="{{ 'Summary_ByAircraft_Title' | translate }}">
<ng-template matTabContent>
<table mat-table [dataSource]="dsNbJumpByAircraft">
<ng-container matColumnDef="label">
@@ -112,7 +112,7 @@
</ng-template>
</mat-tab>
<mat-tab label="By gear">
<mat-tab label="{{ 'Summary_ByGear_Title' | translate }}">
<ng-template matTabContent>
<table mat-table [dataSource]="dsNbJumpByGear">
<ng-container matColumnDef="label">
@@ -126,7 +126,7 @@
</ng-template>
</mat-tab>
<mat-tab label="By jump type">
<mat-tab label="{{ 'Summary_ByJumpType_Title' | translate }}">
<ng-template matTabContent>
<table mat-table [dataSource]="dsNbJumpByType">
<ng-container matColumnDef="label">
@@ -140,7 +140,7 @@
</ng-template>
</mat-tab>
<mat-tab label="By year">
<mat-tab label="{{ 'Summary_ByYear_Title' | translate }}">
<ng-template matTabContent>
<table mat-table [dataSource]="dsNbJumpByYear">
<ng-container matColumnDef="label">

View File

@@ -2,6 +2,7 @@ import { Component, OnInit, ViewChild } from '@angular/core';
import { MatTableDataSource } from '@angular/material/table';
import { MatTabChangeEvent, MatTabGroup } from '@angular/material/tabs';
import { TranslateService } from '@ngx-translate/core';
import { DatePipe } from '@angular/common';
import { ServiceComm } from '../../services/service-comm.service';
import { StatsService } from '../../services/stats.service';
@@ -48,7 +49,10 @@ export class SummaryComponent implements OnInit {
.subscribe(data => {
this.totalJumps = data.totalJumps;
this.totalCutaways = data.totalCutaways;
this.lastJump = data.lastJump.jumpDate + ' (' + data.lastJump.dropZone.name + ')';
const datepipe: DatePipe = new DatePipe('en-US')
let formattedDate = datepipe.transform(data.lastJump.jumpDate, 'EEEE dd MMMM YYYY')
this.lastJump = formattedDate + ' (' + data.lastJump.dropZone.name + ')';
});
this.serviceApi.getStatsOfLastMonth()