Gesamtpunktzahl
diff --git a/static/src/app/statistic/stats.component.html b/static/src/app/statistic/stats.component.html
index 0680b43..b72ec53 100644
--- a/static/src/app/statistic/stats.component.html
+++ b/static/src/app/statistic/stats.component.html
@@ -1 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/static/src/app/statistic/stats.component.ts b/static/src/app/statistic/stats.component.ts
index 686b97d..c1a6bed 100644
--- a/static/src/app/statistic/stats.component.ts
+++ b/static/src/app/statistic/stats.component.ts
@@ -1,11 +1,39 @@
-import {Component} from '@angular/core';
+import {Component, OnInit} from '@angular/core';
+import {Campaign} from '../models/model-interfaces';
+import {CampaignService} from '../services/logs/campaign.service';
+import {ActivatedRoute, Router} from '@angular/router';
@Component({
selector: 'cc-stats',
templateUrl: './stats.component.html',
styleUrls: ['./stats.component.css']
})
-export class StatisticComponent {
- constructor() {
+export class StatisticComponent implements OnInit {
+
+ selectedCampaign: Campaign = {};
+
+ campaigns: Campaign[] = [];
+
+ constructor(private campaignService: CampaignService,
+ private router: Router,
+ private route: ActivatedRoute) {
+ }
+
+ ngOnInit() {
+ this.campaignService.getAllCampaignsWithWars().subscribe((campaigns) => {
+ this.campaigns = campaigns;
+ this.campaignService.campaigns = campaigns;
+ this.switchCampaign(campaigns[0])
+ });
+ }
+
+ switchCampaign(campaign) {
+ this.selectedCampaign = campaign;
+ if (campaign._id === 'all' || this.router.url.includes('/overview/all')) {
+ setTimeout(_ => {
+ window.dispatchEvent(new Event('resize'));
+ });
+ }
+ this.router.navigate([{outlets: {'right': ['overview', campaign._id]}}], {relativeTo: this.route});
}
}
diff --git a/static/src/app/statistic/stats.module.ts b/static/src/app/statistic/stats.module.ts
index f882acd..5d027cc 100644
--- a/static/src/app/statistic/stats.module.ts
+++ b/static/src/app/statistic/stats.module.ts
@@ -7,13 +7,17 @@ import {NgxChartsModule} from '@swimlane/ngx-charts';
import {CampaignService} from '../services/logs/campaign.service';
import {PlayerService} from '../services/logs/player.service';
import {LogsService} from '../services/logs/logs.service';
-import {MatButtonModule, MatButtonToggleModule, MatExpansionModule, MatTableModule, MatSortModule} from '@angular/material';
+import {
+ MatButtonToggleModule,
+ MatSortModule,
+ MatTableModule
+} from '@angular/material';
@NgModule({
declarations: statsRoutingComponents,
- imports: [CommonModule, SharedModule, statsRouterModule, NgxChartsModule, MatButtonModule, MatExpansionModule,
- MatButtonToggleModule, MatTableModule, MatSortModule],
+ imports: [CommonModule, SharedModule, NgxChartsModule, MatButtonToggleModule, MatTableModule, MatSortModule,
+ statsRouterModule],
providers: [WarService, CampaignService, PlayerService, LogsService]
})
export class StatsModule {
diff --git a/static/src/app/statistic/stats.routing.ts b/static/src/app/statistic/stats.routing.ts
index 1d69368..c8dc3a3 100644
--- a/static/src/app/statistic/stats.routing.ts
+++ b/static/src/app/statistic/stats.routing.ts
@@ -16,19 +16,10 @@ import {LoginGuardMT} from '../login';
import {CampaignNavigationComponent} from './campaign/campaign-navigation/campaign-navigation.component';
-export const statsRoutes: Routes = [{
- path: '', component: StatisticComponent,
- children: [
- {
- path: '',
- component: WarListComponent
- }
- ]
-},
+export const statsRoutes: Routes = [
{
- path: 'top',
- component: CampaignNavigationComponent,
- outlet: 'top'
+ path: '',
+ component: StatisticComponent,
},
{
path: 'overview/:id',
diff --git a/static/src/app/statistic/war/scoreboard/scoreboard.component.css b/static/src/app/statistic/war/scoreboard/scoreboard.component.css
index 419eae2..f6b1ccf 100644
--- a/static/src/app/statistic/war/scoreboard/scoreboard.component.css
+++ b/static/src/app/statistic/war/scoreboard/scoreboard.component.css
@@ -1,6 +1,6 @@
.scoreboard-table {
height: 60vh;
- width:fit-content;
+ width: fit-content;
border: 1px solid #dadada;
overflow-x: auto;
margin: 56px auto auto;
@@ -36,6 +36,7 @@ table.mat-table img {
.mat-column-name {
width: 200px;
}
+
.mat-column-fraction {
width: 90px;
}
@@ -52,6 +53,6 @@ td.mat-cell:last-child, td.mat-footer-cell:last-child, th.mat-header-cell:last-c
/* MAT ICON BUTTON */
-:host/deep/.mat-table .mat-icon {
+:host /deep/ .mat-table .mat-icon {
color: #666666;
}
diff --git a/static/src/app/statistic/war/scoreboard/scoreboard.component.ts b/static/src/app/statistic/war/scoreboard/scoreboard.component.ts
index 5bdb621..fc05452 100644
--- a/static/src/app/statistic/war/scoreboard/scoreboard.component.ts
+++ b/static/src/app/statistic/war/scoreboard/scoreboard.component.ts
@@ -3,7 +3,7 @@ import {War} from '../../../models/model-interfaces';
import {Fraction} from '../../../utils/fraction.enum';
import {PlayerUtils} from '../../../utils/player-utils';
import {saveAs} from 'file-saver/FileSaver';
-import {MatSort, Sort} from '@angular/material';
+import {MatSort} from '@angular/material';
import {SortUtils} from '../../../utils/sort-utils';
@Component({
diff --git a/static/src/app/statistic/war/war-header/war-header.component.css b/static/src/app/statistic/war/war-header/war-header.component.css
index 8508278..717723c 100644
--- a/static/src/app/statistic/war/war-header/war-header.component.css
+++ b/static/src/app/statistic/war/war-header/war-header.component.css
@@ -1,6 +1,7 @@
.war-header-container {
width: 920px;
- min-height: 168px;
+ min-height: 165px;
+ padding-top: 12px;
margin: auto;
}
diff --git a/static/src/app/statistic/war/war-header/war-header.component.html b/static/src/app/statistic/war/war-header/war-header.component.html
index 44773fc..6b18990 100644
--- a/static/src/app/statistic/war/war-header/war-header.component.html
+++ b/static/src/app/statistic/war/war-header/war-header.component.html
@@ -1,6 +1,5 @@