Fix army member click area & sort campaign all overview sorting
parent
51a203861b
commit
436f6585c2
|
@ -55,7 +55,6 @@ img {
|
||||||
|
|
||||||
.member-link {
|
.member-link {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: block;
|
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,10 +11,13 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row middle-row">
|
<div class="row middle-row">
|
||||||
<div class="squad-cell name-cell">
|
<div class="squad-cell name-cell">
|
||||||
<span class="member-link text-blufor"
|
<span class="text-blufor"
|
||||||
*ngFor="let member of squad.members"
|
style="display: block"
|
||||||
(click)="select(member._id)">
|
*ngFor="let member of squad.members">
|
||||||
{{member.rank}} {{member.username}}
|
<span class="member-link"
|
||||||
|
(click)="select(member._id)">
|
||||||
|
{{member.rank}} {{member.username}}
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -37,10 +40,13 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row middle-row">
|
<div class="row middle-row">
|
||||||
<div class="squad-cell name-cell">
|
<div class="squad-cell name-cell">
|
||||||
<span class="member-link text-opfor"
|
<span class="text-opfor"
|
||||||
*ngFor="let member of squad.members"
|
style="display: block"
|
||||||
(click)="select(member._id)">
|
*ngFor="let member of squad.members">
|
||||||
{{member.rank}} {{member.username}}
|
<span class="member-link"
|
||||||
|
(click)="select(member._id)">
|
||||||
|
{{member.rank}} {{member.username}}
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
<div class="slide-chart-container" style="height: 150px;">
|
<div class="slide-chart-container" style="height: 150px;">
|
||||||
<h2 style="margin-bottom: 20px">{{title}}</h2>
|
<h2 style="margin-bottom: 20px">{{title}}</h2>
|
||||||
|
|
||||||
<div class="btn btn-default" [style.background]="isActiveSlide(0)"
|
<div class="btn btn-default" [style.background]="isActiveSlide(0)"
|
||||||
(click)="goToSlide(0)" *ngIf="id != 'all'">Gesamtpunktzahl
|
(click)="goToSlide(0)" *ngIf="id != 'all'">Gesamtpunktzahl
|
||||||
</div>
|
</div>
|
||||||
<div class="btn btn-default" [style.background]="isActiveSlide(1)"
|
<div class="btn btn-default" [style.background]="isActiveSlide(1)"
|
||||||
(click)="goToSlide(1)">Punkte je Schlacht
|
(click)="goToSlide(1)">Punkte je Schlacht
|
||||||
</div>
|
</div>
|
||||||
<div class="btn btn-default" [style.background]="isActiveSlide(2)"
|
<div class="btn btn-default" [style.background]="isActiveSlide(2)"
|
||||||
(click)="goToSlide(2)">Spielerzahlen
|
(click)="goToSlide(2)">Spielerzahlen
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="fade-in">
|
<div class="fade-in">
|
||||||
<div class="slide-chart-container">
|
<div class="slide-chart-container">
|
||||||
|
@ -25,7 +25,8 @@
|
||||||
[showYAxisLabel]="showYAxisLabel"
|
[showYAxisLabel]="showYAxisLabel"
|
||||||
[yAxisLabel]="yAxisLabel"
|
[yAxisLabel]="yAxisLabel"
|
||||||
[autoScale]="autoscale"
|
[autoScale]="autoscale"
|
||||||
[timeline]="timeline">
|
[timeline]="timeline"
|
||||||
|
[roundDomains]="roundDomains">
|
||||||
</ngx-charts-line-chart>
|
</ngx-charts-line-chart>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -38,7 +38,6 @@ export class StatisticOverviewComponent {
|
||||||
autoscale = true;
|
autoscale = true;
|
||||||
timeline = false;
|
timeline = false;
|
||||||
|
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private campaignService: CampaignService) {
|
private campaignService: CampaignService) {
|
||||||
}
|
}
|
||||||
|
@ -63,14 +62,20 @@ export class StatisticOverviewComponent {
|
||||||
let itemsProcessed = 0;
|
let itemsProcessed = 0;
|
||||||
campaigns = campaigns.filter(campaign => this.id === 'all' || campaign._id === this.id);
|
campaigns = campaigns.filter(campaign => this.id === 'all' || campaign._id === this.id);
|
||||||
campaigns.forEach(campaign => {
|
campaigns.forEach(campaign => {
|
||||||
if (this.id === 'all') {
|
|
||||||
this.title = "Gesamtübersicht";
|
|
||||||
} else {
|
|
||||||
this.title = campaign.title;
|
|
||||||
}
|
|
||||||
wars = wars.concat(campaign.wars);
|
wars = wars.concat(campaign.wars);
|
||||||
itemsProcessed++;
|
itemsProcessed++;
|
||||||
if (itemsProcessed === campaigns.length) {
|
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);
|
this.initChart(wars);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue