From 436f6585c25da20c037b77d3f634d3e02ba18b67 Mon Sep 17 00:00:00 2001 From: Florian Hartwich Date: Sat, 7 Oct 2017 13:05:10 +0200 Subject: [PATCH] Fix army member click area & sort campaign all overview sorting --- static/src/app/army/army.component.css | 1 - static/src/app/army/army.component.html | 22 ++++++++++++------- .../overview/stats-overview.component.html | 21 +++++++++--------- .../overview/stats-overview.component.ts | 17 +++++++++----- 4 files changed, 36 insertions(+), 25 deletions(-) diff --git a/static/src/app/army/army.component.css b/static/src/app/army/army.component.css index 16ead7f..cbbe5fe 100644 --- a/static/src/app/army/army.component.css +++ b/static/src/app/army/army.component.css @@ -55,7 +55,6 @@ img { .member-link { cursor: pointer; - display: block; text-decoration: underline; } diff --git a/static/src/app/army/army.component.html b/static/src/app/army/army.component.html index 43a117b..243cd27 100644 --- a/static/src/app/army/army.component.html +++ b/static/src/app/army/army.component.html @@ -11,10 +11,13 @@
- - {{member.rank}} {{member.username}} + + + {{member.rank}} {{member.username}} +
@@ -37,10 +40,13 @@
- - {{member.rank}} {{member.username}} + + + {{member.rank}} {{member.username}} +
diff --git a/static/src/app/statistic/overview/stats-overview.component.html b/static/src/app/statistic/overview/stats-overview.component.html index 9c9430f..2cea8db 100644 --- a/static/src/app/statistic/overview/stats-overview.component.html +++ b/static/src/app/statistic/overview/stats-overview.component.html @@ -1,15 +1,15 @@

{{title}}

-
Gesamtpunktzahl -
-
Punkte je Schlacht -
-
Spielerzahlen -
+
Gesamtpunktzahl +
+
Punkte je Schlacht +
+
Spielerzahlen +
@@ -25,7 +25,8 @@ [showYAxisLabel]="showYAxisLabel" [yAxisLabel]="yAxisLabel" [autoScale]="autoscale" - [timeline]="timeline"> + [timeline]="timeline" + [roundDomains]="roundDomains">
diff --git a/static/src/app/statistic/overview/stats-overview.component.ts b/static/src/app/statistic/overview/stats-overview.component.ts index 12f7ec9..2e90f03 100644 --- a/static/src/app/statistic/overview/stats-overview.component.ts +++ b/static/src/app/statistic/overview/stats-overview.component.ts @@ -38,7 +38,6 @@ export class StatisticOverviewComponent { autoscale = true; timeline = false; - constructor(private route: ActivatedRoute, private campaignService: CampaignService) { } @@ -63,14 +62,20 @@ export class StatisticOverviewComponent { let itemsProcessed = 0; campaigns = campaigns.filter(campaign => this.id === 'all' || campaign._id === this.id); campaigns.forEach(campaign => { - if (this.id === 'all') { - this.title = "Gesamtübersicht"; - } else { - this.title = campaign.title; - } wars = wars.concat(campaign.wars); itemsProcessed++; if (itemsProcessed === campaigns.length) { + if (this.id === 'all') { + this.title = "Gesamtübersicht"; + wars.sort((a, b) => { + // sort by dates, because older campaign can contain newer war + if (a['date'] > (b['date'])) return -1; + if (a['date'] < (b['date'])) return 1; + return 0; + }) + } else { + this.title = campaign.title; + } this.initChart(wars); } })