Compare commits

..

No commits in common. "0adb9b7cf90042279e6129dfd5b7deeb1e7b2525" and "37eab6f33d36bdbce6387d81244f6b90d653d094" have entirely different histories.

16 changed files with 203 additions and 145 deletions

View File

@ -1,5 +1,5 @@
<div class="fade-in player-campaign-detail-container" xmlns="http://www.w3.org/1999/html"> <div class="fade-in player-campaign-detail-container" xmlns="http://www.w3.org/1999/html">
<h2 class="pull-left">{{'stats.player.detail.headline' | translate:{name: campaignPlayer.name} }}</h2> <h2 class="pull-left">{{'stats.player.detail.headline' | translate}} {{campaignPlayer.name}}</h2>
<button class="btn-back" mat-raised-button (click)="navigateBack()"> <button class="btn-back" mat-raised-button (click)="navigateBack()">
<mat-icon svgIcon="chevron-left"></mat-icon> <mat-icon svgIcon="chevron-left"></mat-icon>

View File

@ -20,7 +20,7 @@ export class CampaignPlayerDetailComponent implements OnInit {
@Output() switchTab = new EventEmitter(); @Output() switchTab = new EventEmitter();
campaignPlayer: CampaignPlayer = {name: '', campaign: {}, players: []}; campaignPlayer: CampaignPlayer = {campaign: {}, players: []};
graphData: any[] = []; graphData: any[] = [];
sumData: any[] = []; sumData: any[] = [];
@ -74,9 +74,7 @@ export class CampaignPlayerDetailComponent implements OnInit {
for (let i = 0; i < this.playerAttributeNameMap.length; i++) { for (let i = 0; i < this.playerAttributeNameMap.length; i++) {
const attr = this.playerAttributeNameMap[i]; const attr = this.playerAttributeNameMap[i];
this.translate.get(attr.head).subscribe((translated) => { this.graphData.push({key: attr.prop, label: attr.head});
this.graphData.push({key: attr.prop, label: translated});
});
} }
this.initDataArray(); this.initDataArray();

View File

@ -1,21 +1,22 @@
<form #form="ngForm" (keydown.enter)="$event.preventDefault()" class="overview"> <form #form="ngForm" (keydown.enter)="$event.preventDefault()" class="overview">
<h3 *ngIf="campaign._id">{{'stats.campaign.submit.headline.edit' | translate}}</h3> <h3 *ngIf="campaign._id">Kampagne editieren</h3>
<h3 *ngIf="!campaign._id">{{'stats.campaign.submit.headline.new' | translate}}</h3> <h3 *ngIf="!campaign._id">Neue Kampagne hinzufügen</h3>
<div class="form-group"> <div class="form-group">
<label for="title">{{'stats.campaign.submit.title' | translate}}</label> <label for="title">Titel</label>
<input type="text" class="form-control" <input type="text" class="form-control"
[(ngModel)]="campaign.title" [(ngModel)]="campaign.title"
name="title" name="title"
id="title" id="title"
required maxlength="50"/> required maxlength="50"/>
<show-error displayName="{{'stats.campaign.submit.title' | translate}}" controlPath="title"></show-error>
<show-error displayName="Name" controlPath="title"></show-error>
</div> </div>
<button id="cancel" <button id="cancel"
(click)="cancel()" (click)="cancel()"
class="btn btn-default"> class="btn btn-default">
{{'stats.campaign.submit.button.cancel' | translate}} Abbrechen
</button> </button>
<button id="save" <button id="save"
@ -23,6 +24,6 @@
(click)="saveCampaign()" (click)="saveCampaign()"
class="btn btn-default" class="btn btn-default"
[disabled]="!form.valid"> [disabled]="!form.valid">
{{'stats.campaign.submit.button.submit' | translate}} Bestätigen
</button> </button>
</form> </form>

View File

@ -2,14 +2,14 @@
<div class="input-group search-field"> <div class="input-group search-field">
<input id="search-tasks" <input id="search-tasks"
markForCheck markForCheck
placeholder="{{'stats.highscore.filter.placholder' | translate}}" placeholder="Spielername (mehrere mit '&' trennen)"
type="text" #query class="form-control" type="text" #query class="form-control"
(keyup.enter)="filterPlayers()" (keyup.enter)="filterPlayers()"
[formControl]="searchTerm"> [formControl]="searchTerm">
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default" type="button" <button class="btn btn-default" type="button"
(click)="filterPlayers()"> (click)="filterPlayers()">
{{'stats.highscore.filter.button' | translate}} Filter
</button> </button>
</span> </span>
</div> </div>
@ -26,7 +26,7 @@
</ng-container> </ng-container>
<ng-container matColumnDef="name"> <ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>{{'stats.highscore.header.name' | translate}}</th> <th mat-header-cell *matHeaderCellDef>Name</th>
<td mat-cell *matCellDef="let element" <td mat-cell *matCellDef="let element"
[style.color]="element['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR"> [style.color]="element['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR">
{{element.name}} {{element.name}}
@ -36,7 +36,7 @@
<ng-container matColumnDef="{{attributeMap.prop}}"> <ng-container matColumnDef="{{attributeMap.prop}}">
<th mat-header-cell *matHeaderCellDef> <th mat-header-cell *matHeaderCellDef>
<mat-icon svgIcon="{{attributeMap.prop}}" <mat-icon svgIcon="{{attributeMap.prop}}"
matTooltip="{{attributeMap.head | translate}}"> matTooltip="{{attributeMap.head}}">
</mat-icon> </mat-icon>
</th> </th>
<td mat-cell *matCellDef="let element"> {{element[attributeMap.prop]}}</td> <td mat-cell *matCellDef="let element"> {{element[attributeMap.prop]}}</td>

View File

@ -10,6 +10,7 @@ import {WarSubmitComponent} from './war/war-submit/war-submit.component';
import {FractionStatsComponent} from './war/fraction-stats/fraction-stats.component'; import {FractionStatsComponent} from './war/fraction-stats/fraction-stats.component';
import {StatisticHighScoreComponent} from './campaign/highscore/highscore.component'; import {StatisticHighScoreComponent} from './campaign/highscore/highscore.component';
import {WarHeaderComponent} from './war/war-header/war-header.component'; import {WarHeaderComponent} from './war/war-header/war-header.component';
import {WarEditComponent} from './war/war-edit/war-edit.component';
import {LoginGuardMT} from '../login'; import {LoginGuardMT} from '../login';
import {CampaignNavigationComponent} from './campaign/campaign-navigation/campaign-navigation.component'; import {CampaignNavigationComponent} from './campaign/campaign-navigation/campaign-navigation.component';
import {StatisticOverviewComponent} from './campaign/overview/campaign-overview.component'; import {StatisticOverviewComponent} from './campaign/overview/campaign-overview.component';
@ -60,7 +61,7 @@ export const statsRoutes: Routes = [
}, },
{ {
path: 'submit-war/:id', path: 'submit-war/:id',
component: WarSubmitComponent, component: WarEditComponent,
outlet: 'right', outlet: 'right',
canActivate: [LoginGuardMT] canActivate: [LoginGuardMT]
}]; }];
@ -68,6 +69,7 @@ export const statsRoutes: Routes = [
export const statsRouterModule: ModuleWithProviders = RouterModule.forChild(statsRoutes); export const statsRouterModule: ModuleWithProviders = RouterModule.forChild(statsRoutes);
export const statsRoutingComponents = [StatisticComponent, StatisticOverviewComponent, StatisticHighScoreComponent, export const statsRoutingComponents = [StatisticComponent, StatisticOverviewComponent, StatisticHighScoreComponent,
CampaignSubmitComponent, WarListComponent, WarSubmitComponent, WarHeaderComponent, ScoreboardComponent, CampaignSubmitComponent, WarListComponent, WarSubmitComponent, WarEditComponent, WarHeaderComponent,
FractionStatsComponent, CampaignPlayerDetailComponent, WarItemComponent, CampaignNavigationComponent]; ScoreboardComponent, FractionStatsComponent, CampaignPlayerDetailComponent, WarItemComponent,
CampaignNavigationComponent];

View File

@ -7,7 +7,7 @@
class="mat-elevation-z8"> class="mat-elevation-z8">
<ng-container matColumnDef="{{tableHead[0].prop}}"> <ng-container matColumnDef="{{tableHead[0].prop}}">
<th mat-header-cell *matHeaderCellDef mat-sort-header="{{tableHead[0].prop}}">{{tableHead[0].head | translate}}</th> <th mat-header-cell *matHeaderCellDef mat-sort-header="{{tableHead[0].prop}}">{{tableHead[0].head}}</th>
<td mat-cell *matCellDef="let element" <td mat-cell *matCellDef="let element"
[style.color]="element['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR"> [style.color]="element['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR">
{{element.name}} {{element.name}}
@ -15,14 +15,14 @@
</ng-container> </ng-container>
<ng-container matColumnDef="{{tableHead[1].prop}}"> <ng-container matColumnDef="{{tableHead[1].prop}}">
<th mat-header-cell *matHeaderCellDef mat-sort-header="{{tableHead[1].prop}}">{{tableHead[1].head | translate}}</th> <th mat-header-cell *matHeaderCellDef mat-sort-header="{{tableHead[1].prop}}">{{tableHead[1].head}}</th>
<td mat-cell *matCellDef="let element">{{element.fraction === 'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}}</td> <td mat-cell *matCellDef="let element">{{element.fraction === 'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}}</td>
</ng-container> </ng-container>
<ng-container *ngFor="let column of tableHead.slice(2, tableHead.length)" matColumnDef="{{column.prop}}"> <ng-container *ngFor="let column of tableHead.slice(2, tableHead.length)" matColumnDef="{{column.prop}}">
<th mat-header-cell *matHeaderCellDef mat-sort-header="{{column.prop}}"> <th mat-header-cell *matHeaderCellDef mat-sort-header="{{column.prop}}">
<mat-icon svgIcon="{{column.prop}}" <mat-icon svgIcon="{{column.prop}}"
matTooltip="{{column.head | translate}}"> matTooltip="{{column.head}}">
</mat-icon> </mat-icon>
</th> </th>
<td mat-cell *matCellDef="let element">{{element[column.prop]}}</td> <td mat-cell *matCellDef="let element">{{element[column.prop]}}</td>
@ -32,7 +32,7 @@
<th mat-header-cell *matHeaderCellDef></th> <th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element"> <td mat-cell *matCellDef="let element">
<button mat-icon-button <button mat-icon-button
matTooltip="{{ 'stats.scoreboard.button.detail' | translate:{name: element.name} }}" matTooltip="Kampagnenstatistik für {{element.name}}"
(click)="selectPlayerDetail(1, isSteamUUID(element['steamUUID']) ? (click)="selectPlayerDetail(1, isSteamUUID(element['steamUUID']) ?
element['steamUUID'] : element['name'])"> element['steamUUID'] : element['name'])">
<mat-icon svgIcon="stats-detail"> <mat-icon svgIcon="stats-detail">

View File

@ -37,6 +37,13 @@ export class ScoreboardComponent implements OnChanges {
displayedColumns = this.tableHead.map(head => head.prop); displayedColumns = this.tableHead.map(head => head.prop);
reorderable = false;
customClasses = {
sortAscending: 'glyphicon glyphicon-triangle-top',
sortDescending: 'glyphicon glyphicon-triangle-bottom',
};
constructor(private elRef: ElementRef) { constructor(private elRef: ElementRef) {
this.displayedColumns.push('interact'); this.displayedColumns.push('interact');
} }

View File

@ -0,0 +1,3 @@
form {
margin-top: 45px;
}

View File

@ -0,0 +1,80 @@
<form #form="ngForm" (keydown.enter)="$event.preventDefault()" class="overview">
<h3>Schlacht bearbeiten</h3>
<div class="form-group">
<label for="title">Titel</label>
<input type="text" class="form-control"
[(ngModel)]="war.title"
name="title"
id="title"
required maxlength="50"/>
<show-error displayName="Name" controlPath="title"></show-error>
</div>
<div class="form-group">
<label for="campaign">Kampagne</label>
<select class="form-control"
name="campaign"
id="campaign"
[(ngModel)]="war.campaign"
required>
<option *ngFor="let campaign of campaignService.campaigns" [ngValue]="campaign._id">
{{campaign.title}}
</option>
</select>
</div>
<div class="form-group">
<label for="ptBlufor">Punkte NATO</label>
<input type="number" class="form-control"
[(ngModel)]="war.ptBlufor"
name="ptBlufor"
id="ptBlufor"
required min="0"/>
<show-error displayName="Name" controlPath="ptBlufor"></show-error>
</div>
<div class="form-group">
<label for="ptOpfor">Punkte CSAT</label>
<input type="number" class="form-control"
[(ngModel)]="war.ptOpfor"
name="ptOpfor"
id="ptOpfor"
required min="0"/>
<show-error displayName="Name" controlPath="ptOpfor"></show-error>
</div>
<div class="form-group">
<label for="endBudgetBlufor">Endbudget NATO</label>
<input type="number" class="form-control"
[(ngModel)]="war.endBudgetBlufor"
name="endBudgetBlufor"
id="endBudgetBlufor"
required/>
<show-error displayName="Name" controlPath="endBudgetBlufor"></show-error>
</div>
<div class="form-group">
<label for="endBudgetOpfor">Endbudget CSAT</label>
<input type="number" class="form-control"
[(ngModel)]="war.endBudgetOpfor"
name="endBudgetOpfor"
id="endBudgetOpfor"
required/>
<show-error displayName="Name" controlPath="endBudgetOpfor"></show-error>
</div>
<button id="cancel"
(click)="cancel()"
class="btn btn-default">
Abbrechen
</button>
<button id="save"
type="submit"
(click)="updateWar()"
class="btn btn-default"
[disabled]="!form.valid">
Bestätigen
</button>
</form>

View File

@ -0,0 +1,52 @@
import {Component, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {NgForm} from '@angular/forms';
import {WarService} from '../../../services/logs/war.service';
import {War} from '../../../models/model-interfaces';
import {CampaignService} from '../../../services/logs/campaign.service';
import {Subscription} from 'rxjs/Subscription';
import {SnackBarService} from '../../../services/user-interface/snack-bar/snack-bar.service';
import {Message} from '../../../i18n/de.messages';
@Component({
selector: 'war-edit',
templateUrl: './war-edit.component.html',
styleUrls: ['./war-edit.component.css', '../../../style/entry-form.css', '../../../style/overview.css']
})
export class WarEditComponent {
war: War = {players: []};
subscription: Subscription;
@ViewChild(NgForm) form: NgForm;
constructor(private route: ActivatedRoute,
private router: Router,
private warService: WarService,
private snackBarService: SnackBarService,
public campaignService: CampaignService) {
this.subscription = this.route.params
.map(params => params['id'])
.filter(id => id !== undefined)
.flatMap(id => this.warService.getWar(id))
.subscribe(war => {
this.war = war;
});
}
updateWar() {
this.warService.updateWar(this.war)
.subscribe(war => {
this.snackBarService.showSuccess(Message.SUCCESS_SAVE);
this.router.navigate(['../../war/' + war._id], {relativeTo: this.route});
},
error => this.snackBarService.showError(error._body.error.message, 15000));
}
cancel() {
this.router.navigate(['..'], {relativeTo: this.route});
return false;
}
}

View File

@ -1,14 +1,14 @@
<div *ngIf="war" class="war-header fade-in" xmlns="http://www.w3.org/1999/html"> <div *ngIf="war" class="war-header fade-in" xmlns="http://www.w3.org/1999/html">
<div class="war-header-container"> <div class="war-header-container">
<div class="pull-left head-field" style="width: 250px"> <div class="pull-left head-field" style="width: 250px">
<h4>{{'stats.scoreboard.standings' | translate}}</h4> <h4>Endpunktestand:</h4>
<span [style.color]="fraction.COLOR_BLUFOR" style="font-weight: bold; margin-right: 10px">{{fraction.BLUFOR}} {{war.ptBlufor}}</span> <span [style.color]="fraction.COLOR_BLUFOR" style="font-weight: bold; margin-right: 10px">{{fraction.BLUFOR}} {{war.ptBlufor}}</span>
<span style="font-size: x-large">|</span> <span style="font-size: x-large">|</span>
<span [style.color]="fraction.COLOR_OPFOR" style="font-weight: bold; margin-left: 10px;">{{war.ptOpfor}} {{fraction.OPFOR}}</span> <span [style.color]="fraction.COLOR_OPFOR" style="font-weight: bold; margin-left: 10px;">{{war.ptOpfor}} {{fraction.OPFOR}}</span>
</div> </div>
<div class="pull-left head-field " style="padding-left: 100px;"> <div class="pull-left head-field " style="padding-left: 100px;">
<h4 class="pull-left" style="margin-bottom: 0;">{{'stats.scoreboard.participants' | translate}}</h4> <h4 class="pull-left" style="margin-bottom: 0;">Teilnehmer:</h4>
<ngx-charts-pie-chart <ngx-charts-pie-chart
class="pull-left" class="pull-left"
[view]="[120, 120]" [view]="[120, 120]"
@ -24,26 +24,20 @@
<div class="pull-left " style="padding-left: 100px; padding-top:15px"> <div class="pull-left " style="padding-left: 100px; padding-top:15px">
<a class="btn btn-default" style="margin: 20px" target="_blank" href="resource/logs/{{war._id}}/clean.log"> <a class="btn btn-default" style="margin: 20px" target="_blank" href="resource/logs/{{war._id}}/clean.log">
{{'stats.scoreboard.show.logs' | translate}} Logfile anzeigen
</a> </a>
</div> </div>
</div> </div>
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="nav-item" [ngClass]="{active :tab === 0}" (click)="switchTab(0)"> <li class="nav-item" [ngClass]="{active :tab === 0}" (click)="switchTab(0)">
<a class="nav-link"><img src="../../../assets/scoreboard-btn.png"> <a class="nav-link"><img src="../../../assets/scoreboard-btn.png"> Scoreboard</a>
{{'stats.scoreboard.tab.scoreboard' | translate}}
</a>
</li> </li>
<li class="nav-item" [ngClass]="{active :tab === 1}" (click)="switchTab(1)"> <li class="nav-item" [ngClass]="{active :tab === 1}" (click)="switchTab(1)">
<a class="nav-link"><img src="../../../assets/fraction-btn.png"> <a class="nav-link"><img src="../../../assets/fraction-btn.png"> Fraktionen</a>
{{'stats.scoreboard.tab.fractions' | translate}}
</a>
</li> </li>
<li class="nav-item" [ngClass]="{active :tab === 2, deactivated :tab !== 2} "> <li class="nav-item" [ngClass]="{active :tab === 2, deactivated :tab !== 2} ">
<a class="nav-link"><img src="../../../assets/player-stats-btn.png"> <a class="nav-link"><img src="../../../assets/player-stats-btn.png"> Player</a>
{{'stats.scoreboard.tab.player' | translate}}
</a>
</li> </li>
<li> <li>
<div *ngIf="tab === 0"> <div *ngIf="tab === 0">
@ -52,26 +46,23 @@
<input type="radio" name="fractSelect" <input type="radio" name="fractSelect"
[checked]="(fractionFilterSelected == undefined) ? 'true' : 'false'" [checked]="(fractionFilterSelected == undefined) ? 'true' : 'false'"
[(ngModel)]="fractionFilterSelected" [(ngModel)]="fractionFilterSelected"
(change)="filterPlayersByFraction()"> (change)="filterPlayersByFraction()">Alle
{{'stats.scoreboard.fraction.filter.all' | translate}}
</label> </label>
<label class="radio-inline"> <label class="radio-inline">
<input type="radio" name="fractSelect" value="BLUFOR" <input type="radio" name="fractSelect" value="BLUFOR"
[(ngModel)]="fractionFilterSelected" [(ngModel)]="fractionFilterSelected"
#fractRadioBufor #fractRadioBufor
(change)="filterPlayersByFraction(fractRadioBufor.value)"> (change)="filterPlayersByFraction(fractRadioBufor.value)">{{fraction.BLUFOR}}
{{fraction.BLUFOR}}
</label> </label>
<label class="radio-inline"> <label class="radio-inline">
<input type="radio" name="fractSelect" value="OPFOR" <input type="radio" name="fractSelect" value="OPFOR"
[(ngModel)]="fractionFilterSelected" [(ngModel)]="fractionFilterSelected"
#fractRadioOpfor #fractRadioOpfor
(change)="filterPlayersByFraction(fractRadioOpfor.value)"> (change)="filterPlayersByFraction(fractRadioOpfor.value)">{{fraction.OPFOR}}
{{fraction.OPFOR}}
</label> </label>
</form> </form>
<span class="btn btn-default pull-left tab-control" (click)="scoreBoardComponent.exportCSV()"> <span class="btn btn-default pull-left tab-control" (click)="scoreBoardComponent.exportCSV()">
{{'stats.scoreboard.download.csv' | translate}} Download CSV
</span> </span>
</div> </div>
</li> </li>

View File

@ -1,9 +1,9 @@
<div class="war-list-header" *ngIf="!collapsed && loginService.hasPermission(3)"> <div class="war-list-header" *ngIf="!collapsed && loginService.hasPermission(3)">
<button mat-stroked-button (click)="selectNewCampaign()"> <button mat-stroked-button (click)="selectNewCampaign()">
{{'stats.sidebar.campaign.add' | translate}} {{'stats.campaign.manage.add' | translate}}
</button> </button>
<button mat-stroked-button (click)="selectNewWar()"> <button mat-stroked-button (click)="selectNewWar()">
{{'stats.sidebar.battle.add' | translate}} Schlacht hinzufügen
</button> </button>
</div> </div>

View File

@ -1,19 +1,19 @@
<form #form="ngForm" (keydown.enter)="$event.preventDefault()" class="overview"> <form #form="ngForm" (keydown.enter)="$event.preventDefault()" class="overview">
<h3 *ngIf="!war._id">{{'stats.war.submit.headline.new' | translate}}</h3> <h3>Neue Schlacht hinzufügen</h3>
<h3 *ngIf="war._id">{{'stats.war.submit.headline.edit' | translate}}</h3>
<div class="form-group"> <div class="form-group">
<label for="title">{{'stats.war.submit.title' | translate}}</label> <label for="title">Titel</label>
<input type="text" class="form-control" <input type="text" class="form-control"
[(ngModel)]="war.title" [(ngModel)]="war.title"
name="title" name="title"
id="title" id="title"
required maxlength="50"/> required maxlength="50"/>
<show-error displayName="{{'stats.war.submit.title' | translate}}" controlPath="title"></show-error>
<show-error displayName="Name" controlPath="title"></show-error>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="campaign">{{'stats.war.submit.campaign' | translate}}</label> <label for="campaign">Kampagne</label>
<select class="form-control" <select class="form-control"
name="campaign" name="campaign"
id="campaign" id="campaign"
@ -25,7 +25,7 @@
</select> </select>
</div> </div>
<div class="form-group" *ngIf="!war._id"> <div class="form-group">
<label for="log">Logfile</label> <label for="log">Logfile</label>
<input id="log" name="log" class="ui-button form-control" type="file" <input id="log" name="log" class="ui-button form-control" type="file"
(change)="fileChange($event)"> (change)="fileChange($event)">
@ -34,63 +34,19 @@
</span> </span>
</div> </div>
<div class="form-group" *ngIf="war._id">
<label for="ptBlufor">{{'stats.war.submit.points' | translate}} {{fraction.BLUFOR}}</label>
<input type="number" class="form-control"
[(ngModel)]="war.ptBlufor"
name="ptBlufor"
id="ptBlufor"
required min="0"/>
<show-error displayName="{{'stats.war.submit.points' | translate}} {{fraction.BLUFOR}}"
controlPath="ptBlufor"></show-error>
</div>
<div class="form-group" *ngIf="war._id">
<label for="ptOpfor">{{'stats.war.submit.points' | translate}} {{fraction.OPFOR}}</label>
<input type="number" class="form-control"
[(ngModel)]="war.ptOpfor"
name="ptOpfor"
id="ptOpfor"
required min="0"/>
<show-error displayName="{{'stats.war.submit.points' | translate}} {{fraction.OPFOR}}"
controlPath="ptOpfor"></show-error>
</div>
<div class="form-group" *ngIf="war._id">
<label for="endBudgetBlufor">{{'stats.war.submit.final.budget' | translate}} {{fraction.BLUFOR}}</label>
<input type="number" class="form-control"
[(ngModel)]="war.endBudgetBlufor"
name="endBudgetBlufor"
id="endBudgetBlufor"
required/>
<show-error displayName="{{'stats.war.submit.final.budget' | translate}} {{fraction.BLUFOR}}"
controlPath="endBudgetBlufor"></show-error>
</div>
<div class="form-group" *ngIf="war._id">
<label for="endBudgetOpfor">{{'stats.war.submit.final.budget' | translate}} {{fraction.OPFOR}}</label>
<input type="number" class="form-control"
[(ngModel)]="war.endBudgetOpfor"
name="endBudgetOpfor"
id="endBudgetOpfor"
required/>
<show-error displayName="{{'stats.war.submit.final.budget' | translate}} {{fraction.OPFOR}}"
controlPath="endBudgetOpfor"></show-error>
</div>
<button id="cancel" <button id="cancel"
*ngIf="!loading" *ngIf="!loading"
(click)="cancel()" (click)="cancel()"
class="btn btn-default"> class="btn btn-default">
{{'stats.war.submit.button.cancel' | translate}} Abbrechen
</button> </button>
<button id="save" <button id="save"
type="submit" type="submit"
*ngIf="!loading" *ngIf="!loading"
(click)="war._id ? editWar() : saveWar()" (click)="saveWar()"
class="btn btn-default" class="btn btn-default"
[disabled]="!form.valid"> [disabled]="!form.valid">
{{'stats.war.submit.button.submit' | translate}} Bestätigen
</button> </button>
</form> </form>

View File

@ -6,8 +6,6 @@ import {War} from '../../../models/model-interfaces';
import {CampaignService} from '../../../services/logs/campaign.service'; import {CampaignService} from '../../../services/logs/campaign.service';
import {SnackBarService} from '../../../services/user-interface/snack-bar/snack-bar.service'; import {SnackBarService} from '../../../services/user-interface/snack-bar/snack-bar.service';
import {SpinnerService} from '../../../services/user-interface/spinner/spinner.service'; import {SpinnerService} from '../../../services/user-interface/spinner/spinner.service';
import {Subscription} from 'rxjs';
import {Fraction} from '../../../utils/fraction.enum';
@Component({ @Component({
@ -19,14 +17,10 @@ export class WarSubmitComponent {
war: War = {players: []}; war: War = {players: []};
subscription: Subscription;
fileList: FileList; fileList: FileList;
readonly validExtensions = ['.rpt', '.log', '.txt']; readonly validExtensions = ['.rpt', '.log', '.txt'];
readonly fraction = Fraction;
showFileError = false; showFileError = false;
loading = false; loading = false;
@ -39,13 +33,6 @@ export class WarSubmitComponent {
private snackBarService: SnackBarService, private snackBarService: SnackBarService,
private spinnerService: SpinnerService, private spinnerService: SpinnerService,
public campaignService: CampaignService) { public campaignService: CampaignService) {
this.subscription = this.route.params
.map(params => params['id'])
.filter(id => id !== undefined)
.flatMap(id => this.warService.getWar(id))
.subscribe(war => {
this.war = war;
});
} }
fileChange(event) { fileChange(event) {

View File

@ -1,17 +1,17 @@
export class PlayerUtils { export class PlayerUtils {
public static readonly attributeDisplayNames = [ public static readonly attributeDisplayNames = [
{prop: 'name', head: 'stats.scoreboard.header.player'}, {prop: 'name', head: 'Spieler'},
{prop: 'fraction', head: 'stats.scoreboard.header.fraction'}, {prop: 'fraction', head: 'Fraktion'},
{prop: 'kill', head: 'stats.scoreboard.header.kill'}, {prop: 'kill', head: 'Abschüsse'},
{prop: 'friendlyFire', head: 'stats.scoreboard.header.friendly.fire'}, {prop: 'friendlyFire', head: 'Friendly Fire'},
{prop: 'revive', head: 'stats.scoreboard.header.revive'}, {prop: 'revive', head: 'Revive'},
{prop: 'flagTouch', head: 'stats.scoreboard.header.capture'}, {prop: 'flagTouch', head: 'Eroberungen'},
{prop: 'vehicleLight', head: 'stats.scoreboard.header.vehicle.light'}, {prop: 'vehicleLight', head: 'Fahrzeug (leicht)'},
{prop: 'vehicleHeavy', head: 'stats.scoreboard.header.vehicle.heavy'}, {prop: 'vehicleHeavy', head: 'Fahrzeug (schwer)'},
{prop: 'vehicleAir', head: 'stats.scoreboard.header.vehicle.air'}, {prop: 'vehicleAir', head: 'Fahrzeug (Luft)'},
{prop: 'death', head: 'stats.scoreboard.header.death'}, {prop: 'death', head: 'Tode'},
{prop: 'respawn', head: 'stats.scoreboard.header.respawn'} {prop: 'respawn', head: 'Respawn'}
]; ];
public static isSteamUUID(input: string): boolean { public static isSteamUUID(input: string): boolean {

View File

@ -1,14 +1,14 @@
{ {
"stats.campaign.manage.add": "Kampagne hinzufügen",
"stats.campaign.manage.edit": "Bearbeiten", "stats.campaign.manage.edit": "Bearbeiten",
"stats.campaign.manage.delete": "Löschen", "stats.campaign.manage.delete": "Löschen",
"stats.campaign.manage.delete.confirm": "Soll die Kampagne \"{{title}}\" wirklich gelöscht werden?", "stats.campaign.manage.delete.confirm": "Soll die Kampagne \"{{title}}\" wirklich gelöscht werden?",
"stats.campaign.title.all.time.overview": "Ewige Übersicht", "stats.campaign.title.all.time.overview": "Ewige Übersicht",
"stats.sidebar.campaign.add": "Kampagne hinzufügen",
"stats.sidebar.battle.add": "Schlacht hinzufügen",
"stats.sidebar.overview": "Übersicht", "stats.sidebar.overview": "Übersicht",
"stats.sidebar.highscore": "Highscore", "stats.sidebar.highscore": "Highscore",
"stats.sidebar.battles": "Schlachten", "stats.sidebar.battles": "Schlachten",
"stats.sidebar.battles.battle.from.date": "vom", "stats.sidebar.battles.battle.from.date": "vom",
"stats.sidebar.battle.manage.edit": "Bearbeiten", "stats.sidebar.battle.manage.edit": "Bearbeiten",
"stats.sidebar.battle.manage.delete": "Löschen", "stats.sidebar.battle.manage.delete": "Löschen",
@ -28,14 +28,14 @@
"stats.fraction.select.stabilize": "Stabilisiert", "stats.fraction.select.stabilize": "Stabilisiert",
"stats.fraction.select.flag": "Flaggenbesitz", "stats.fraction.select.flag": "Flaggenbesitz",
"stats.player.detail.headline": "Kampagnendetails - {{name}}", "stats.player.detail.headline": "Kampagnendetails -",
"stats.player.detail.button.back": "Zurück", "stats.player.detail.button.back": "Zurück",
"stats.player.detail.kill.death.ratio": "Kill/Death", "stats.player.detail.kill.death.ratio": "Kill/Death",
"stats.player.detail.respawn.death.ratio": "Respawn/Death", "stats.player.detail.respawn.death.ratio": "Respawn/Death",
"stats.player.detail.graph.average": "Durchschnitt", "stats.player.detail.graph.average": "Durchschnitt",
"stats.scoreboard.standings": "Endpunktestand:", "stats.scoreboard.standings": "Endpunktestand",
"stats.scoreboard.participants": "Teilnehmer:", "stats.scoreboard.participants": "Teilnehmer",
"stats.scoreboard.show.logs": "Logfile anzeigen", "stats.scoreboard.show.logs": "Logfile anzeigen",
"stats.scoreboard.download.csv": "Download CSV", "stats.scoreboard.download.csv": "Download CSV",
"stats.scoreboard.tab.scoreboard": "Scoreboard", "stats.scoreboard.tab.scoreboard": "Scoreboard",
@ -53,24 +53,5 @@
"stats.scoreboard.header.vehicle.air": "Fahrzeug (Luft)", "stats.scoreboard.header.vehicle.air": "Fahrzeug (Luft)",
"stats.scoreboard.header.death": "Tode", "stats.scoreboard.header.death": "Tode",
"stats.scoreboard.header.respawn": "Respawn", "stats.scoreboard.header.respawn": "Respawn",
"stats.scoreboard.button.detail": "Kampagnenstatistik für {{name}}", "stats.scoreboard.button.detail": "Kampagnenstatistik für {{name}}"
"stats.highscore.filter.placholder": "Spielername (mehrere mit '&' trennen)",
"stats.highscore.filter.button": "Filter",
"stats.highscore.header.name": "Name",
"stats.war.submit.headline.new": "Neue Schlacht hinzufügen",
"stats.war.submit.headline.edit": "Schlacht bearbeiten",
"stats.war.submit.title": "Titel",
"stats.war.submit.campaign": "Kampagne",
"stats.war.submit.points": "Punkte",
"stats.war.submit.final.budget": "Endbudget",
"stats.war.submit.button.submit": "Bestätigen",
"stats.war.submit.button.cancel": "Abbrechen",
"stats.campaign.submit.headline.new": "Neue Kampagne hinzufügen",
"stats.campaign.submit.headline.edit": "Kampagne editieren",
"stats.campaign.submit.title": "Titel",
"stats.campaign.submit.button.submit": "Bestätigen",
"stats.campaign.submit.button.cancel": "Abbrechen"
} }