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 de24de5..d09dc09 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,5 +1,5 @@
-

{{'stats.player.detail.headline' | translate}} {{campaignPlayer.name}}

+

{{'stats.player.detail.headline' | translate:{name: campaignPlayer.name} }}

- - - diff --git a/static/src/app/statistic/war/war-edit/war-edit.component.ts b/static/src/app/statistic/war/war-edit/war-edit.component.ts deleted file mode 100644 index 05806c9..0000000 --- a/static/src/app/statistic/war/war-edit/war-edit.component.ts +++ /dev/null @@ -1,55 +0,0 @@ -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'; -import {Fraction} from '../../../utils/fraction.enum'; - - -@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; - - readonly fraction = Fraction; - - @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; - } -} 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 a9afc61..eeef7f7 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,9 +1,9 @@
diff --git a/static/src/app/statistic/war/war-submit/war-submit.component.html b/static/src/app/statistic/war/war-submit/war-submit.component.html index b3566e4..1a577de 100644 --- a/static/src/app/statistic/war/war-submit/war-submit.component.html +++ b/static/src/app/statistic/war/war-submit/war-submit.component.html @@ -1,19 +1,19 @@
-

Neue Schlacht hinzufügen

+

{{'stats.war.submit.headline.new' | translate}}

+

{{'stats.war.submit.headline.edit' | translate}}

- + - - +
- + @@ -34,19 +34,63 @@
+
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+
diff --git a/static/src/app/statistic/war/war-submit/war-submit.component.ts b/static/src/app/statistic/war/war-submit/war-submit.component.ts index 09c4edd..96e818e 100644 --- a/static/src/app/statistic/war/war-submit/war-submit.component.ts +++ b/static/src/app/statistic/war/war-submit/war-submit.component.ts @@ -6,6 +6,8 @@ import {War} from '../../../models/model-interfaces'; import {CampaignService} from '../../../services/logs/campaign.service'; import {SnackBarService} from '../../../services/user-interface/snack-bar/snack-bar.service'; import {SpinnerService} from '../../../services/user-interface/spinner/spinner.service'; +import {Subscription} from 'rxjs'; +import {Fraction} from '../../../utils/fraction.enum'; @Component({ @@ -17,10 +19,14 @@ export class WarSubmitComponent { war: War = {players: []}; + subscription: Subscription; + fileList: FileList; readonly validExtensions = ['.rpt', '.log', '.txt']; + readonly fraction = Fraction; + showFileError = false; loading = false; @@ -33,6 +39,13 @@ export class WarSubmitComponent { private snackBarService: SnackBarService, private spinnerService: SpinnerService, 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) { diff --git a/static/src/assets/i18n/statistics/de.json b/static/src/assets/i18n/statistics/de.json index d9e914f..ff03e81 100644 --- a/static/src/assets/i18n/statistics/de.json +++ b/static/src/assets/i18n/statistics/de.json @@ -1,14 +1,14 @@ { - "stats.campaign.manage.add": "Kampagne hinzufügen", "stats.campaign.manage.edit": "Bearbeiten", "stats.campaign.manage.delete": "Löschen", "stats.campaign.manage.delete.confirm": "Soll die Kampagne \"{{title}}\" wirklich gelöscht werden?", "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.highscore": "Highscore", "stats.sidebar.battles": "Schlachten", - "stats.sidebar.battles.battle.from.date": "vom", "stats.sidebar.battle.manage.edit": "Bearbeiten", "stats.sidebar.battle.manage.delete": "Löschen", @@ -28,7 +28,7 @@ "stats.fraction.select.stabilize": "Stabilisiert", "stats.fraction.select.flag": "Flaggenbesitz", - "stats.player.detail.headline": "Kampagnendetails -", + "stats.player.detail.headline": "Kampagnendetails - {{name}}", "stats.player.detail.button.back": "Zurück", "stats.player.detail.kill.death.ratio": "Kill/Death", "stats.player.detail.respawn.death.ratio": "Respawn/Death", @@ -59,7 +59,8 @@ "stats.highscore.filter.button": "Filter", "stats.highscore.header.name": "Name", - "stats.war.submit.headline": "Schlacht bearbeiten", + "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",