diff --git a/static/src/app/app.component.html b/static/src/app/app.component.html index 1e2ba6e..45872ed 100644 --- a/static/src/app/app.component.html +++ b/static/src/app/app.component.html @@ -105,20 +105,18 @@
- - - - - - - - - -
- + + +
+
+ + +
-
+
Ewige Übersicht
+ [ngClass]="{active : campaign._id === selectedCampaignId}" + (click)="select(campaign)"> {{campaign.title}}
diff --git a/static/src/app/statistic/campaign/campaign-navigation/campaign-navigation.component.ts b/static/src/app/statistic/campaign/campaign-navigation/campaign-navigation.component.ts index a8f9c78..aec1481 100644 --- a/static/src/app/statistic/campaign/campaign-navigation/campaign-navigation.component.ts +++ b/static/src/app/statistic/campaign/campaign-navigation/campaign-navigation.component.ts @@ -1,16 +1,18 @@ -import {Component, ElementRef, ViewChild} from '@angular/core'; -import {CampaignService} from '../../../services/logs/campaign.service'; +import {Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core'; import {Campaign} from '../../../models/model-interfaces'; -import {ActivatedRoute, Router} from '@angular/router'; @Component({ selector: 'campaign-navigation', templateUrl: './campaign-navigation.component.html', styleUrls: ['./campaign-navigation.component.css'] }) -export class CampaignNavigationComponent { +export class CampaignNavigationComponent implements OnInit { - campaigns: Campaign[]; + @Input() campaigns: Campaign[]; + + @Input() selectedCampaignId; + + @Output() campaignSelect = new EventEmitter(); @ViewChild('horizontalList', {read: ElementRef}) public panel: ElementRef; @@ -20,16 +22,13 @@ export class CampaignNavigationComponent { repeater; - constructor(private campaignService: CampaignService, - private route: ActivatedRoute, - private router: Router) { + ngOnInit() { + this.isRightScrollVisible = this.campaigns.length > 4; } - ngOnInit() { - this.campaignService.getAllCampaigns().subscribe((campaigns) => { - this.campaigns = campaigns; - this.isRightScrollVisible = campaigns.length > 4; - }) + select(campaign) { + this.selectedCampaignId = campaign._id; + this.campaignSelect.emit(campaign); } public scrollList(scrollValue: number): void { @@ -53,7 +52,6 @@ export class CampaignNavigationComponent { this.isLeftScrollVisible = false; this.clearRepeater(); } - } setRepeater(value: number) { @@ -63,9 +61,4 @@ export class CampaignNavigationComponent { clearRepeater() { clearInterval(this.repeater) } - - selectCampaign(campaignId) { - console.log(campaignId) - this.router.navigate([{outlets: {'primary': ['/campaign', campaignId]}}], {relativeTo: this.route}); - } } diff --git a/static/src/app/statistic/campaign/campaign-player-detail/campaign-player-detail.component.html b/static/src/app/statistic/campaign/campaign-player-detail/campaign-player-detail.component.html index 0d579ca..028d9f1 100644 --- a/static/src/app/statistic/campaign/campaign-player-detail/campaign-player-detail.component.html +++ b/static/src/app/statistic/campaign/campaign-player-detail/campaign-player-detail.component.html @@ -1,9 +1,9 @@

Kampagnendetails - {{campaignPlayer.name}}

-

{{campaignPlayer.campaign.title}} Kampagne

diff --git a/static/src/app/statistic/campaign/highscore/highscore.component.css b/static/src/app/statistic/campaign/highscore/highscore.component.css index ddd70e2..2f8a387 100644 --- a/static/src/app/statistic/campaign/highscore/highscore.component.css +++ b/static/src/app/statistic/campaign/highscore/highscore.component.css @@ -7,8 +7,8 @@ h2 { } .search-field { - width: 30%; - margin: 20px 0 0 10%; + width: 40%; + margin: 32px 0 0 8%; } .highscore-table-container { @@ -19,7 +19,7 @@ h2 { overflow-x: hidden; overflow-y: auto; border: solid #dfdfdf 1px; - box-shadow: 3px 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12); + box-shadow: 3px 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12); } .highscore-table { diff --git a/static/src/app/statistic/campaign/highscore/highscore.component.html b/static/src/app/statistic/campaign/highscore/highscore.component.html index 5829dd6..5b0b146 100644 --- a/static/src/app/statistic/campaign/highscore/highscore.component.html +++ b/static/src/app/statistic/campaign/highscore/highscore.component.html @@ -1,6 +1,4 @@
-

{{title}} ⟶ Highscore

-
-

{{title}}

- +
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 @@
-

{{war.title}} - vom {{war.date | date: 'dd.MM.yyyy'}}

Endpunktestand:

{{fraction.BLUFOR}} {{war.ptBlufor}} diff --git a/static/src/app/statistic/war/war-list/war-item.component.css b/static/src/app/statistic/war/war-list/war-item.component.css index e69de29..aaec2d6 100644 --- a/static/src/app/statistic/war/war-list/war-item.component.css +++ b/static/src/app/statistic/war/war-list/war-item.component.css @@ -0,0 +1,42 @@ +.war-item { + cursor: pointer; + border-right: 1px solid #dadada; +} + +.war-item-box { + padding-top: 15px; +} + +.war-title { + font-size: 16px; + color: #333333; +} + +.war-detail { + font-size: 12px; + text-indent: 20px; + color: #666666; +} + +.select-indicator-battle { + display: none; + width: 30px; + height: 30px; + position: absolute; + left: calc(100% - 14px); + background: -moz-linear-gradient(45deg, white 50%, transparent 50%); + background: -webkit-linear-gradient(45deg, white 50%, transparent 50%); + background: linear-gradient(45deg, white 50%, transparent 50%); + cursor: default; + border-left: 1px solid #dadada; + border-bottom: 1px solid #dadada; + -webkit-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -o-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); +} + +.selected div.select-indicator-battle { + display: block !important; +} diff --git a/static/src/app/statistic/war/war-list/war-item.component.html b/static/src/app/statistic/war/war-list/war-item.component.html index 16e16b4..6654d9f 100644 --- a/static/src/app/statistic/war/war-list/war-item.component.html +++ b/static/src/app/statistic/war/war-list/war-item.component.html @@ -1,28 +1,27 @@ -
- -
-
- - {{war.title}} +
+
+
+
+
+ + ◦ {{war.title}} -
- vom {{war.date | date: 'dd.MM.yyyy'}} -
+
vom {{war.date | date: 'dd.MM.yyyy'}}
+
-
- - -
+
+ +
diff --git a/static/src/app/statistic/war/war-list/war-item.component.ts b/static/src/app/statistic/war/war-list/war-item.component.ts index 763e9e0..ee2b96e 100644 --- a/static/src/app/statistic/war/war-list/war-item.component.ts +++ b/static/src/app/statistic/war/war-list/war-item.component.ts @@ -5,7 +5,7 @@ import {LoginService} from '../../../services/app-user-service/login-service'; @Component({ selector: 'cc-war-item', templateUrl: './war-item.component.html', - styleUrls: ['./war-item.component.css', '../../../style/list-entry.css'], + styleUrls: ['./war-item.component.css'], changeDetection: ChangeDetectionStrategy.OnPush }) export class WarItemComponent implements OnInit { diff --git a/static/src/app/statistic/war/war-list/war-list.component.css b/static/src/app/statistic/war/war-list/war-list.component.css index c881da2..0fcc5d5 100644 --- a/static/src/app/statistic/war/war-list/war-list.component.css +++ b/static/src/app/statistic/war/war-list/war-list.component.css @@ -1,71 +1,58 @@ -.select-list { - min-height: calc(100vh - 50px); +.list-header { + border-bottom: 1px solid #dadada; + border-right: 1px solid #dadada; + padding: 25px; + font-size: 16px; + text-transform: uppercase; + color: #333333; + cursor: pointer; +} + +.mat-icon { + color: #666666; + vertical-align: middle; + margin-right: 5px; +} + +.select-indicator { + display: none; + width: 30px; + height: 30px; + position: absolute; + left: calc(20% - 15px); + background: -moz-linear-gradient(45deg, white 50%, transparent 50%); + background: -webkit-linear-gradient(45deg, white 50%, transparent 50%); + background: linear-gradient(45deg, white 50%, transparent 50%); + cursor: default; + border-left: 1px solid #dadada; + border-bottom: 1px solid #dadada; + -webkit-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -o-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); +} + +.battle-list { + max-height: calc(100vh - 353px); + padding-left: 5px; + margin-left: 10%; + overflow-y: auto; + overflow-x: hidden; + direction: rtl; +} + +.battle-list * { + direction: ltr; +} + +.selected > div.select-indicator { + display: block !important; } .war-list-header { margin: auto; -} - -span > a { - font-weight: 600 !important; -} - -mat-expansion-panel { - border: 1px solid #7d7d7d; -} - -mat-panel-title { - font-size: 18px; - color: #ffffff; -} - -mat-expansion-panel-header { - height: auto; - padding: 30px 15px; - background-color: #4e4e4e; -} - -mat-expansion-panel-header.mat-expansion-panel-header:hover { - background: #222222 !important; -} - -mat-expansion-panel-header.mat-expansion-panel-header:focus { - background-color: #4e4e4e; -} - -.select-list > div:last-child { - margin: 20px 0; -} - -.top-list-entry { - display: flex; - margin: 0 0 6px 0; -} - -.top-list-entry > div { - width: 50%; - float: left; -} - -.war-interaction-panel { - display: contents; -} - -.war-interaction-panel > span { - color: rgba(255, 255, 255, 0.64); - padding: 0 3px; -} - -:host /deep/ .mat-expansion-indicator::after { - color: rgba(255, 255, 255, 0.64); -} - -.select-list > mat-accordion:first-child .mat-expansion-panel { - border-radius: 6px 6px 0 0; -} - -.select-list > mat-accordion:first-child .mat-expansion-panel-header { - border-radius: 4px 4px 0 0; + border-right: 1px solid #dadada; } .stats-add-btn { @@ -75,3 +62,26 @@ mat-expansion-panel-header.mat-expansion-panel-header:focus { margin: 0 10px 10px 10px; width: 95%; } + +.fill-vertical-border { + width: 20%; + position: fixed; + border-right: 1px solid #dadada; + height: 100vh; +} + +/* Table Scrollbar BEGIN */ + +.battle-list::-webkit-scrollbar { + width: 12px; +} + +.battle-list::-webkit-scrollbar-track { + border-left: 1px solid #f1f1f1; +} + +.battle-list::-webkit-scrollbar-thumb { + background: rgb(234, 234, 234); +} + +/* Table Scrollbar END */ diff --git a/static/src/app/statistic/war/war-list/war-list.component.html b/static/src/app/statistic/war/war-list/war-list.component.html index fbb4303..4200a54 100644 --- a/static/src/app/statistic/war/war-list/war-list.component.html +++ b/static/src/app/statistic/war/war-list/war-list.component.html @@ -1,74 +1,42 @@ -
-
- - -
- - - - - - {{campaign.title}} - - - - - - -
-
-
- - Übersicht - -
-
-
-
- - Highscore - -
-
-
-
- - -
-
-
- -
-
- -
-
- +
+ +
+ + +
+
+ + Übersicht +
+ +
+
+ + Highscore +
+ +
+ + Schlachten +
+ +
+
+ + +
+
+ +
diff --git a/static/src/app/statistic/war/war-list/war-list.component.ts b/static/src/app/statistic/war/war-list/war-list.component.ts index 637a7ca..a5f953a 100644 --- a/static/src/app/statistic/war/war-list/war-list.component.ts +++ b/static/src/app/statistic/war/war-list/war-list.component.ts @@ -1,4 +1,4 @@ -import {Component, OnInit} from '@angular/core'; +import {Component, Input, OnChanges, OnInit, SimpleChanges} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; import {Campaign, War} from '../../../models/model-interfaces'; import {WarService} from '../../../services/logs/war.service'; @@ -9,9 +9,11 @@ import {RouteConfig} from '../../../app.config'; @Component({ selector: 'war-list', templateUrl: './war-list.component.html', - styleUrls: ['./war-list.component.css', '../../../style/list-entry.css', '../../../style/select-list.css'] + styleUrls: ['./war-list.component.css'] }) -export class WarListComponent implements OnInit { +export class WarListComponent implements OnInit, OnChanges { + + @Input() campaign: Campaign; selectedWarId: string | number; @@ -26,6 +28,10 @@ export class WarListComponent implements OnInit { private route: ActivatedRoute) { } + ngOnChanges(changes: SimpleChanges) { + this.selectedWarId = this.campaign._id; + } + ngOnInit() { this.campaignService.getAllCampaignsWithWars().subscribe((items) => { const subPathWar = 'war/'; @@ -35,7 +41,7 @@ export class WarListComponent implements OnInit { const url = this.router.url; if (url.endsWith(RouteConfig.statsPath)) { - this.selectOverview(this.campaigns[0]._id); + this.selectOverview(this.campaign._id); } else if (url.indexOf(subPathWar) !== -1) { this.selectedWarId = url.substring(url.lastIndexOf(subPathWar) + subPathWar.length, url.lastIndexOf(')')); } else if (url.indexOf(subPathOverview) !== -1) { @@ -59,6 +65,9 @@ export class WarListComponent implements OnInit { selectOverview(campaignId) { if (this.selectedWarId !== campaignId) { this.selectedWarId = campaignId; + setTimeout(_ => { + window.dispatchEvent(new Event('resize')); + }); this.router.navigate([{outlets: {'right': ['overview', campaignId]}}], {relativeTo: this.route}); } } diff --git a/static/src/assets/icon/stats/award.svg b/static/src/assets/icon/stats/award.svg new file mode 100644 index 0000000..83ed1e0 --- /dev/null +++ b/static/src/assets/icon/stats/award.svg @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/static/src/assets/icon/stats/battle.svg b/static/src/assets/icon/stats/battle.svg new file mode 100644 index 0000000..1d16d66 --- /dev/null +++ b/static/src/assets/icon/stats/battle.svg @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/static/src/assets/icon/stats/flagTouch.svg b/static/src/assets/icon/stats/flagTouch.svg new file mode 100644 index 0000000..e73e0b2 --- /dev/null +++ b/static/src/assets/icon/stats/flagTouch.svg @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + F + + F + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/src/assets/icon/stats/friendlyFire.svg b/static/src/assets/icon/stats/friendlyFire.svg new file mode 100644 index 0000000..0a9d201 --- /dev/null +++ b/static/src/assets/icon/stats/friendlyFire.svg @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + F + + F + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/src/assets/icon/stats/highscore.svg b/static/src/assets/icon/stats/highscore.svg new file mode 100644 index 0000000..9ac9253 --- /dev/null +++ b/static/src/assets/icon/stats/highscore.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + diff --git a/static/src/assets/icon/stats/kill.svg b/static/src/assets/icon/stats/kill.svg new file mode 100644 index 0000000..44c90ff --- /dev/null +++ b/static/src/assets/icon/stats/kill.svg @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + F + + F + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/src/assets/icon/stats/respawn.svg b/static/src/assets/icon/stats/respawn.svg new file mode 100644 index 0000000..cb50c5e --- /dev/null +++ b/static/src/assets/icon/stats/respawn.svg @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + F + + F + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/src/assets/icon/stats/revive.svg b/static/src/assets/icon/stats/revive.svg new file mode 100644 index 0000000..e29fba7 --- /dev/null +++ b/static/src/assets/icon/stats/revive.svg @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + F + + F + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/src/assets/icon/stats/statsChart.svg b/static/src/assets/icon/stats/statsChart.svg new file mode 100644 index 0000000..d8aaa7d --- /dev/null +++ b/static/src/assets/icon/stats/statsChart.svg @@ -0,0 +1,14 @@ + + + + + + + + + +