diff --git a/static/src/app/statistic/campaign-submit/campaign-submit.component.ts b/static/src/app/statistic/campaign/campaign-submit/campaign-submit.component.ts
similarity index 51%
rename from static/src/app/statistic/campaign-submit/campaign-submit.component.ts
rename to static/src/app/statistic/campaign/campaign-submit/campaign-submit.component.ts
index 34a9561..d7d38f3 100644
--- a/static/src/app/statistic/campaign-submit/campaign-submit.component.ts
+++ b/static/src/app/statistic/campaign/campaign-submit/campaign-submit.component.ts
@@ -1,14 +1,15 @@
import {Component, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {NgForm} from '@angular/forms';
-import {Campaign} from '../../models/model-interfaces';
-import {CampaignService} from '../../services/logs/campaign.service';
+import {Subscription} from 'rxjs/Subscription';
+import {Campaign} from '../../../models/model-interfaces';
+import {CampaignService} from '../../../services/logs/campaign.service';
@Component({
selector: 'campaign-submit',
templateUrl: './campaign-submit.component.html',
- styleUrls: ['./campaign-submit.component.css', '../../style/entry-form.css', '../../style/overview.css']
+ styleUrls: ['./campaign-submit.component.css', '../../../style/entry-form.css', '../../../style/overview.css']
})
export class CampaignSubmitComponent {
@@ -18,17 +19,30 @@ export class CampaignSubmitComponent {
error;
+ subscription: Subscription;
+
@ViewChild(NgForm) form: NgForm;
constructor(private route: ActivatedRoute,
private router: Router,
private campaignService: CampaignService) {
+ this.subscription = this.route.params
+ .map(params => params['id'])
+ .filter(id => id !== undefined)
+ .flatMap(id => this.campaignService.getCampaign(id))
+ .subscribe(campaign => {
+ this.campaign = campaign;
+ });
}
saveCampaign() {
this.campaignService.submitCampaign(this.campaign)
.subscribe(campaign => {
- this.router.navigate(['../overview/' + campaign._id], {relativeTo: this.route});
+ let redirectSuccessUrl = '../overview/';
+ if (this.campaign._id) {
+ redirectSuccessUrl = '../' + redirectSuccessUrl;
+ }
+ this.router.navigate([redirectSuccessUrl + campaign._id], {relativeTo: this.route});
},
error => {
this.error = error._body.error.message;
@@ -40,5 +54,4 @@ export class CampaignSubmitComponent {
this.router.navigate(['..'], {relativeTo: this.route});
return false;
}
-
}
diff --git a/static/src/app/statistic/highscore/highscore.component.css b/static/src/app/statistic/campaign/highscore/highscore.component.css
similarity index 92%
rename from static/src/app/statistic/highscore/highscore.component.css
rename to static/src/app/statistic/campaign/highscore/highscore.component.css
index 6e8508b..da5284b 100644
--- a/static/src/app/statistic/highscore/highscore.component.css
+++ b/static/src/app/statistic/campaign/highscore/highscore.component.css
@@ -57,6 +57,10 @@ ngx-datatable {
background-color: #f7f7f7;
}
+:host /deep/ .ngx-datatable.fixed-header .datatable-header .datatable-header-inner .datatable-header-cell {
+ margin: auto;
+}
+
/* Table Scrollbar BEGIN */
:host /deep/ .ngx-datatable.scroll-vertical .datatable-body::-webkit-scrollbar {
diff --git a/static/src/app/statistic/campaign/highscore/highscore.component.html b/static/src/app/statistic/campaign/highscore/highscore.component.html
new file mode 100644
index 0000000..475e567
--- /dev/null
+++ b/static/src/app/statistic/campaign/highscore/highscore.component.html
@@ -0,0 +1,56 @@
+
+
{{title}} ⟶ Highscore
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{value}}
+
+
+
+
+
+
+
+
+
+
+ {{value}}
+
+
+
+
+
+
+
+
diff --git a/static/src/app/statistic/highscore/highscore.component.ts b/static/src/app/statistic/campaign/highscore/highscore.component.ts
similarity index 71%
rename from static/src/app/statistic/highscore/highscore.component.ts
rename to static/src/app/statistic/campaign/highscore/highscore.component.ts
index 353139c..1954314 100644
--- a/static/src/app/statistic/highscore/highscore.component.ts
+++ b/static/src/app/statistic/campaign/highscore/highscore.component.ts
@@ -1,17 +1,18 @@
import {Component, Input, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
-import {PlayerService} from '../../services/logs/player.service';
-import {CampaignService} from '../../services/logs/campaign.service';
-import {Fraction} from '../../utils/fraction.enum';
+import {PlayerService} from '../../../services/logs/player.service';
+import {CampaignService} from '../../../services/logs/campaign.service';
+import {Fraction} from '../../../utils/fraction.enum';
import {FormControl} from '@angular/forms';
import {Observable} from 'rxjs/Observable';
-import {Player} from '../../models/model-interfaces';
+import {Player} from '../../../models/model-interfaces';
+import {PlayerUtils} from '../../../utils/player-utils';
@Component({
selector: 'stats-highscore',
templateUrl: './highscore.component.html',
- styleUrls: ['./highscore.component.css', '../../style/list-entry.css', '../../style/overview.css']
+ styleUrls: ['./highscore.component.css', '../../../style/list-entry.css', '../../../style/overview.css']
})
export class StatisticHighScoreComponent implements OnInit {
@@ -27,13 +28,15 @@ export class StatisticHighScoreComponent implements OnInit {
playersStored = {};
+ playerAttributeDisplayNames = PlayerUtils.attributeDisplayNames.slice(2, PlayerUtils.attributeDisplayNames.length);
+
cellHeight = 40;
numberColWidth = 60;
nameColWidth = 210;
- valueColWidth = 110;
+ valueColWidth = 55;
emptyMessage = {emptyMessage: 'Keine Einträge'};
@@ -84,17 +87,11 @@ export class StatisticHighScoreComponent implements OnInit {
if (!this.searchTerm.value || this.searchTerm.value === '') {
this.players = this.playersStored;
} else {
- this.players = {
- kill: this.filterPlayerAttribute('kill'),
- friendlyFire: this.filterPlayerAttribute('friendlyFire'),
- vehicleLight: this.filterPlayerAttribute('vehicleLight'),
- vehicleHeavy: this.filterPlayerAttribute('vehicleLight'),
- vehicleAir: this.filterPlayerAttribute('vehicleLight'),
- death: this.filterPlayerAttribute('death'),
- respawn: this.filterPlayerAttribute('respawn'),
- revive: this.filterPlayerAttribute('revive'),
- flagTouch: this.filterPlayerAttribute('flagTouch')
- };
+ this.players = {};
+ for (let i = 0; i < this.playerAttributeDisplayNames.length; i++) {
+ const attributeProperty = this.playerAttributeDisplayNames[i].prop;
+ this.players[attributeProperty] = this.filterPlayerAttribute(attributeProperty);
+ }
}
}
diff --git a/static/src/app/statistic/overview/stats-overview.component.css b/static/src/app/statistic/campaign/overview/stats-overview.component.css
similarity index 100%
rename from static/src/app/statistic/overview/stats-overview.component.css
rename to static/src/app/statistic/campaign/overview/stats-overview.component.css
diff --git a/static/src/app/statistic/overview/stats-overview.component.html b/static/src/app/statistic/campaign/overview/stats-overview.component.html
similarity index 100%
rename from static/src/app/statistic/overview/stats-overview.component.html
rename to static/src/app/statistic/campaign/overview/stats-overview.component.html
diff --git a/static/src/app/statistic/overview/stats-overview.component.ts b/static/src/app/statistic/campaign/overview/stats-overview.component.ts
similarity index 93%
rename from static/src/app/statistic/overview/stats-overview.component.ts
rename to static/src/app/statistic/campaign/overview/stats-overview.component.ts
index 0359ba1..5aec41e 100644
--- a/static/src/app/statistic/overview/stats-overview.component.ts
+++ b/static/src/app/statistic/campaign/overview/stats-overview.component.ts
@@ -1,14 +1,14 @@
import {Component, Input, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
-import {CampaignService} from '../../services/logs/campaign.service';
-import {ChartUtils} from '../../utils/chart-utils';
-import {Fraction} from '../../utils/fraction.enum';
+import {CampaignService} from '../../../services/logs/campaign.service';
+import {ChartUtils} from '../../../utils/chart-utils';
+import {Fraction} from '../../../utils/fraction.enum';
@Component({
selector: 'stats-overview',
templateUrl: './stats-overview.component.html',
- styleUrls: ['./stats-overview.component.css', '../../style/list-entry.css', '../../style/overview.css']
+ styleUrls: ['./stats-overview.component.css', '../../../style/list-entry.css', '../../../style/overview.css']
})
export class StatisticOverviewComponent implements OnInit {
diff --git a/static/src/app/statistic/highscore/highscore.component.html b/static/src/app/statistic/highscore/highscore.component.html
deleted file mode 100644
index a62c187..0000000
--- a/static/src/app/statistic/highscore/highscore.component.html
+++ /dev/null
@@ -1,208 +0,0 @@
-
-
{{title}} ⟶ Highscore
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{value}}
-
-
-
-
-
-
-
-
-
-
-
- {{value}}
-
-
-
-
-
-
-
-
-
-
-
- {{value}}
-
-
-
-
-
-
-
-
-
-
-
- {{value}}
-
-
-
-
-
-
-
-
-
-
-
- {{value}}
-
-
-
-
-
-
-
-
-
-
-
- {{value}}
-
-
-
-
-
-
-
-
-
-
-
- {{value}}
-
-
-
-
-
-
-
-
-
-
-
- {{value}}
-
-
-
-
-
-
-
-
-
-
-
- {{value}}
-
-
-
-
-
-
-
-
diff --git a/static/src/app/statistic/stats.routing.ts b/static/src/app/statistic/stats.routing.ts
index 6e39806..b2f7302 100644
--- a/static/src/app/statistic/stats.routing.ts
+++ b/static/src/app/statistic/stats.routing.ts
@@ -1,16 +1,18 @@
import {RouterModule, Routes} from '@angular/router';
import {StatisticComponent} from './stats.component';
-import {WarListComponent} from './war-list/war-list.component';
-import {StatisticOverviewComponent} from './overview/stats-overview.component';
-import {WarItemComponent} from './war-list/war-item.component';
+import {WarListComponent} from './war/war-list/war-list.component';
+import {StatisticOverviewComponent} from './campaign/overview/stats-overview.component';
+import {WarItemComponent} from './war/war-list/war-item.component';
import {ModuleWithProviders} from '@angular/core';
-import {CampaignSubmitComponent} from './campaign-submit/campaign-submit.component';
-import {CampaignPlayerDetailComponent} from './campaign-player-detail/campaign-player-detail.component';
-import {WarDetailComponent} from './war-detail/war-detail.component';
-import {ScoreboardComponent} from './war-detail/scoreboard/scoreboard.component';
-import {WarSubmitComponent} from './war-submit/war-submit.component';
-import {FractionStatsComponent} from './war-detail/fraction-stats/fraction-stats.component';
-import {StatisticHighScoreComponent} from './highscore/highscore.component';
+import {CampaignSubmitComponent} from './campaign/campaign-submit/campaign-submit.component';
+import {CampaignPlayerDetailComponent} from './campaign/campaign-player-detail/campaign-player-detail.component';
+import {ScoreboardComponent} from './war/scoreboard/scoreboard.component';
+import {WarSubmitComponent} from './war/war-submit/war-submit.component';
+import {FractionStatsComponent} from './war/fraction-stats/fraction-stats.component';
+import {StatisticHighScoreComponent} from './campaign/highscore/highscore.component';
+import {WarHeaderComponent} from './war/war-header/war-header.component';
+import {WarEditComponent} from './war/war-edit/war-edit.component';
+import {LoginGuardMT} from '../login';
export const statsRoutes: Routes = [{
@@ -32,30 +34,44 @@ export const statsRoutes: Routes = [{
component: StatisticHighScoreComponent,
outlet: 'right'
},
- {
- path: 'new-campaign',
- component: CampaignSubmitComponent,
- outlet: 'right'
- },
- {
- path: 'new',
- component: WarSubmitComponent,
- outlet: 'right'
- },
{
path: 'war/:id',
- component: WarDetailComponent,
+ component: WarHeaderComponent,
outlet: 'right'
},
{
path: 'campaign-player/:id/:playerName',
component: CampaignPlayerDetailComponent,
outlet: 'right'
+ },
+ {
+ path: 'campaign',
+ component: CampaignSubmitComponent,
+ outlet: 'right',
+ canActivate: [LoginGuardMT]
+ },
+ {
+ path: 'campaign/:id',
+ component: CampaignSubmitComponent,
+ outlet: 'right',
+ canActivate: [LoginGuardMT]
+ },
+ {
+ path: 'submit-war',
+ component: WarSubmitComponent,
+ outlet: 'right',
+ canActivate: [LoginGuardMT]
+ },
+ {
+ path: 'submit-war/:id',
+ component: WarEditComponent,
+ outlet: 'right',
+ canActivate: [LoginGuardMT]
}];
export const statsRouterModule: ModuleWithProviders = RouterModule.forChild(statsRoutes);
export const statsRoutingComponents = [StatisticComponent, StatisticOverviewComponent, StatisticHighScoreComponent,
- CampaignSubmitComponent, WarListComponent, WarSubmitComponent, WarDetailComponent, ScoreboardComponent,
- FractionStatsComponent, CampaignPlayerDetailComponent, WarItemComponent];
+ CampaignSubmitComponent, WarListComponent, WarSubmitComponent, WarEditComponent, WarHeaderComponent,
+ ScoreboardComponent, FractionStatsComponent, CampaignPlayerDetailComponent, WarItemComponent];
diff --git a/static/src/app/statistic/war-detail/scoreboard/scoreboard.component.html b/static/src/app/statistic/war-detail/scoreboard/scoreboard.component.html
deleted file mode 100644
index 061f789..0000000
--- a/static/src/app/statistic/war-detail/scoreboard/scoreboard.component.html
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
- {{value}}
-
-
-
-
-
- {{value === 'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gesamt
-
-
-
-
-
diff --git a/static/src/app/statistic/war-detail/fraction-stats/fraction-stats.component.css b/static/src/app/statistic/war/fraction-stats/fraction-stats.component.css
similarity index 100%
rename from static/src/app/statistic/war-detail/fraction-stats/fraction-stats.component.css
rename to static/src/app/statistic/war/fraction-stats/fraction-stats.component.css
diff --git a/static/src/app/statistic/war-detail/fraction-stats/fraction-stats.component.html b/static/src/app/statistic/war/fraction-stats/fraction-stats.component.html
similarity index 100%
rename from static/src/app/statistic/war-detail/fraction-stats/fraction-stats.component.html
rename to static/src/app/statistic/war/fraction-stats/fraction-stats.component.html
diff --git a/static/src/app/statistic/war-detail/fraction-stats/fraction-stats.component.ts b/static/src/app/statistic/war/fraction-stats/fraction-stats.component.ts
similarity index 99%
rename from static/src/app/statistic/war-detail/fraction-stats/fraction-stats.component.ts
rename to static/src/app/statistic/war/fraction-stats/fraction-stats.component.ts
index cfb8cf5..3aa902f 100644
--- a/static/src/app/statistic/war-detail/fraction-stats/fraction-stats.component.ts
+++ b/static/src/app/statistic/war/fraction-stats/fraction-stats.component.ts
@@ -45,9 +45,9 @@ export class FractionStatsComponent implements OnInit, OnChanges {
labelPoints = 'Punkte';
labelBudget = 'Budget';
- labelKill = 'Kills';
- labelFriendlyFire = 'FriendlyFire';
- labelVehicle = 'Fahrzeug-Kills';
+ labelKill = 'Abschüsse';
+ labelFriendlyFire = 'Friendly Fire';
+ labelVehicle = 'Fahrzeug Abschüsse';
labelTransport = 'Lufttransport';
labelRevive = 'Revive';
labelStabilize = 'Stabilisiert';
diff --git a/static/src/app/statistic/war-detail/scoreboard/scoreboard.component.css b/static/src/app/statistic/war/scoreboard/scoreboard.component.css
similarity index 90%
rename from static/src/app/statistic/war-detail/scoreboard/scoreboard.component.css
rename to static/src/app/statistic/war/scoreboard/scoreboard.component.css
index 741bd71..c06a7a6 100644
--- a/static/src/app/statistic/war-detail/scoreboard/scoreboard.component.css
+++ b/static/src/app/statistic/war/scoreboard/scoreboard.component.css
@@ -5,7 +5,7 @@
/* ########### DATATABLE ########### */
ngx-datatable {
- width: 1040px;
+ width: 940px;
margin: auto;
height: 68vh;
}
@@ -43,6 +43,10 @@ ngx-datatable {
background-color: #f7f7f7;
}
+:host /deep/ .ngx-datatable.fixed-header .datatable-header .datatable-header-inner .datatable-header-cell {
+ margin: auto;
+}
+
/* Table Scrollbar BEGIN */
:host /deep/ .ngx-datatable.scroll-vertical .datatable-body::-webkit-scrollbar {
width: 12px;
diff --git a/static/src/app/statistic/war/scoreboard/scoreboard.component.html b/static/src/app/statistic/war/scoreboard/scoreboard.component.html
new file mode 100644
index 0000000..e2559ea
--- /dev/null
+++ b/static/src/app/statistic/war/scoreboard/scoreboard.component.html
@@ -0,0 +1,47 @@
+
+
+
+
+
+ {{value}}
+
+
+
+
+
+ {{value === 'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gesamt
+
+
+
+
+
diff --git a/static/src/app/statistic/war-detail/scoreboard/scoreboard.component.ts b/static/src/app/statistic/war/scoreboard/scoreboard.component.ts
similarity index 95%
rename from static/src/app/statistic/war-detail/scoreboard/scoreboard.component.ts
rename to static/src/app/statistic/war/scoreboard/scoreboard.component.ts
index a1dbfa6..ac2b5b3 100644
--- a/static/src/app/statistic/war-detail/scoreboard/scoreboard.component.ts
+++ b/static/src/app/statistic/war/scoreboard/scoreboard.component.ts
@@ -19,13 +19,14 @@ export class ScoreboardComponent implements OnChanges {
@Output() playerTabSwitch = new EventEmitter();
- tableHead = ['Spieler', 'Fraktion', 'Kills', 'FF', 'Fzg(L)', 'Fzg(H)', 'Fzg(A)',
- 'Revive', 'Flagge', 'Tod', 'Respawn'];
+ tableHead = PlayerUtils.attributeDisplayNames;
isSteamUUID = PlayerUtils.isSteamUUID;
cellHeight = 40;
+ columnWidth = 65;
+
rows = [];
reorderable = false;
diff --git a/static/src/app/statistic/war-list/war-item.component.css b/static/src/app/statistic/war/war-edit/war-edit.component.css
similarity index 100%
rename from static/src/app/statistic/war-list/war-item.component.css
rename to static/src/app/statistic/war/war-edit/war-edit.component.css
diff --git a/static/src/app/statistic/war/war-edit/war-edit.component.html b/static/src/app/statistic/war/war-edit/war-edit.component.html
new file mode 100644
index 0000000..ff08c34
--- /dev/null
+++ b/static/src/app/statistic/war/war-edit/war-edit.component.html
@@ -0,0 +1,85 @@
+
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
new file mode 100644
index 0000000..e84e42b
--- /dev/null
+++ b/static/src/app/statistic/war/war-edit/war-edit.component.ts
@@ -0,0 +1,56 @@
+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';
+
+
+@Component({
+ selector: 'war-edit',
+ templateUrl: './war-edit.component.html',
+ styleUrls: ['./war-edit.component.css', '../../../style/load-indicator.css',
+ '../../../style/entry-form.css', '../../../style/overview.css']
+})
+export class WarEditComponent {
+
+ war: War = {players: []};
+
+ subscription: Subscription;
+
+ showErrorLabel = false;
+
+ error;
+
+ @ViewChild(NgForm) form: NgForm;
+
+ constructor(private route: ActivatedRoute,
+ private router: Router,
+ private warService: WarService,
+ 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.router.navigate(['../../war/' + war._id], {relativeTo: this.route});
+ },
+ error => {
+ this.error = error._body.error.message;
+ this.showErrorLabel = true;
+ });
+ }
+
+ cancel() {
+ this.router.navigate(['..'], {relativeTo: this.route});
+ return false;
+ }
+}
diff --git a/static/src/app/statistic/war-detail/war-detail.component.css b/static/src/app/statistic/war/war-header/war-header.component.css
similarity index 97%
rename from static/src/app/statistic/war-detail/war-detail.component.css
rename to static/src/app/statistic/war/war-header/war-header.component.css
index c656ac1..9f7a896 100644
--- a/static/src/app/statistic/war-detail/war-detail.component.css
+++ b/static/src/app/statistic/war/war-header/war-header.component.css
@@ -28,7 +28,7 @@ span.tab-control {
}
.nav-tabs {
- width: 980px;
+ width: 920px;
margin: auto;
clear: both;
border-bottom: 0;
diff --git a/static/src/app/statistic/war-detail/war-detail.component.html b/static/src/app/statistic/war/war-header/war-header.component.html
similarity index 100%
rename from static/src/app/statistic/war-detail/war-detail.component.html
rename to static/src/app/statistic/war/war-header/war-header.component.html
diff --git a/static/src/app/statistic/war-detail/war-detail.component.ts b/static/src/app/statistic/war/war-header/war-header.component.ts
similarity index 76%
rename from static/src/app/statistic/war-detail/war-detail.component.ts
rename to static/src/app/statistic/war/war-header/war-header.component.ts
index 688a2a6..d4cd8db 100644
--- a/static/src/app/statistic/war-detail/war-detail.component.ts
+++ b/static/src/app/statistic/war/war-header/war-header.component.ts
@@ -1,19 +1,19 @@
import {Component, OnInit, ViewChild} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
-import {WarService} from '../../services/logs/war.service';
-import {War} from '../../models/model-interfaces';
-import {ChartUtils} from '../../utils/chart-utils';
-import {Fraction} from '../../utils/fraction.enum';
-import {LogsService} from '../../services/logs/logs.service';
-import {ScoreboardComponent} from './scoreboard/scoreboard.component';
+import {WarService} from '../../../services/logs/war.service';
+import {War} from '../../../models/model-interfaces';
+import {ChartUtils} from '../../../utils/chart-utils';
+import {Fraction} from '../../../utils/fraction.enum';
+import {LogsService} from '../../../services/logs/logs.service';
+import {ScoreboardComponent} from '../scoreboard/scoreboard.component';
@Component({
selector: 'war-detail',
- templateUrl: './war-detail.component.html',
- styleUrls: ['./war-detail.component.css', '../../style/list-entry.css', '../../style/hide-scrollbar.css']
+ templateUrl: './war-header.component.html',
+ styleUrls: ['./war-header.component.css', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css']
})
-export class WarDetailComponent implements OnInit {
+export class WarHeaderComponent implements OnInit {
readonly fraction = Fraction;
diff --git a/static/src/app/statistic/war-submit/war-submit.component.css b/static/src/app/statistic/war/war-list/war-item.component.css
similarity index 100%
rename from static/src/app/statistic/war-submit/war-submit.component.css
rename to static/src/app/statistic/war/war-list/war-item.component.css
diff --git a/static/src/app/statistic/war-list/war-item.component.html b/static/src/app/statistic/war/war-list/war-item.component.html
similarity index 76%
rename from static/src/app/statistic/war-list/war-item.component.html
rename to static/src/app/statistic/war/war-list/war-item.component.html
index 0545d74..1672969 100644
--- a/static/src/app/statistic/war-list/war-item.component.html
+++ b/static/src/app/statistic/war/war-list/war-item.component.html
@@ -13,6 +13,10 @@
+
diff --git a/static/src/app/statistic/war-list/war-item.component.ts b/static/src/app/statistic/war/war-list/war-item.component.ts
similarity index 67%
rename from static/src/app/statistic/war-list/war-item.component.ts
rename to static/src/app/statistic/war/war-list/war-item.component.ts
index 84890c9..dcc33d0 100644
--- a/static/src/app/statistic/war-list/war-item.component.ts
+++ b/static/src/app/statistic/war/war-list/war-item.component.ts
@@ -1,11 +1,11 @@
import {ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
-import {War} from '../../models/model-interfaces';
-import {LoginService} from '../../services/app-user-service/login-service';
+import {War} from '../../../models/model-interfaces';
+import {LoginService} from '../../../services/app-user-service/login-service';
@Component({
selector: 'pjm-war-item',
templateUrl: './war-item.component.html',
- styleUrls: ['./war-item.component.css', '../../style/list-entry.css'],
+ styleUrls: ['./war-item.component.css', '../../../style/list-entry.css'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class WarItemComponent implements OnInit {
@@ -16,6 +16,8 @@ export class WarItemComponent implements OnInit {
@Output() warSelected = new EventEmitter();
+ @Output() warEdit = new EventEmitter();
+
@Output() warDelete = new EventEmitter();
constructor(public loginService: LoginService) {
@@ -28,6 +30,10 @@ export class WarItemComponent implements OnInit {
this.warSelected.emit(this.war._id);
}
+ edit() {
+ this.warEdit.emit(this.war._id);
+ }
+
delete() {
this.warDelete.emit(this.war);
}
diff --git a/static/src/app/statistic/war-list/war-list.component.css b/static/src/app/statistic/war/war-list/war-list.component.css
similarity index 100%
rename from static/src/app/statistic/war-list/war-list.component.css
rename to static/src/app/statistic/war/war-list/war-list.component.css
diff --git a/static/src/app/statistic/war-list/war-list.component.html b/static/src/app/statistic/war/war-list/war-list.component.html
similarity index 83%
rename from static/src/app/statistic/war-list/war-list.component.html
rename to static/src/app/statistic/war/war-list/war-list.component.html
index 721ef16..8d604ad 100644
--- a/static/src/app/statistic/war-list/war-list.component.html
+++ b/static/src/app/statistic/war/war-list/war-list.component.html
@@ -11,13 +11,18 @@