Compare commits

..

2 Commits

10 changed files with 110 additions and 112 deletions

View File

@ -9,12 +9,12 @@ import {CampaignService} from '../services/logs/campaign.service';
import {NgxDatatableModule} from '@swimlane/ngx-datatable';
import {PlayerService} from '../services/logs/player.service';
import {LogsService} from '../services/logs/logs.service';
import {MatExpansionModule, MatFormFieldModule} from '@angular/material';
import {MatButtonToggleModule, MatExpansionModule, MatFormFieldModule} from '@angular/material';
@NgModule({
declarations: statsRoutingComponents,
imports: [CommonModule, SharedModule, statsRouterModule, NgxChartsModule, ButtonsModule.forRoot(), NgxDatatableModule,
MatExpansionModule, MatFormFieldModule],
imports: [CommonModule, SharedModule, statsRouterModule, NgxChartsModule, NgxDatatableModule, MatExpansionModule,
MatButtonToggleModule],
providers: [WarService, CampaignService, PlayerService, LogsService]
})
export class StatsModule {

View File

@ -1,16 +1,32 @@
.btn-dark {
background: #4b4b4b;
color: #f5f5f5;
border-color: #000;
.chart-select-group {
display: flex;
width: 945px;
margin: auto;
}
.btn-dark:hover {
.chart-select-group > mat-button-toggle {
background: #4b4b4b;
color: #f5f5f5;
border: 1px solid #000;
}
.chart-select-group > mat-button-toggle:hover {
background: #afafaf;
color: #f5f5f5;
}
.btn-dark.active {
background: #222222;
mat-button-toggle.mat-button-toggle-checked {
background: #222222 !important;
}
:host /deep/ label.mat-button-toggle-label {
margin: 2px 0 !important;
}
:host /deep/ div.mat-button-toggle-label-content {
line-height: 25px !important;
margin-bottom: 0 !important;
font-weight: normal !important;
}
.chart-container {
@ -21,12 +37,3 @@
padding: 15px;
float: left;
}
.chart-select-group {
width: 980px;
margin: auto;
}
/*.dropdown-menu > li > a {*/
/*cursor: pointer;*/
/*}*/

View File

@ -1,45 +1,38 @@
<!--<div class="btn-group" style="position: absolute; margin-left: 5%;" dropdown>-->
<!--<button dropdownToggle type="button" class="btn btn-default dropdown-toggle dropdown-toggle-split">-->
<!--{{dataMode}} <span class="caret"></span>-->
<!--</button>-->
<!--<ul *dropdownMenu class="dropdown-menu" role="menu">-->
<!--<li role="menuitem"><a class="dropdown-item" (click)="toggleDataMode(0, 'Summe')">Summe</a></li>-->
<!--<li class="divider dropdown-divider"></li>-->
<!--<li class="disabled" role="menuitem">-->
<!--<a class="dropdown-item" style="cursor: default!important;">Interval:</a>-->
<!--</li>-->
<!--<li role="menuitem"><a class="dropdown-item" (click)="toggleDataMode(1, '1 Minute')">1 Minute</a></li>-->
<!--<li role="menuitem"><a class="dropdown-item" (click)="toggleDataMode(5, '5 Minuten')">5 Minuten</a></li>-->
<!--<li role="menuitem"><a class="dropdown-item" (click)="toggleDataMode(10, '10 Minuten')">10 Minuten</a>-->
<!--<li role="menuitem"><a class="dropdown-item" (click)="toggleDataMode(20, '20 Minuten')">20 Minuten</a>-->
<!--<li role="menuitem"><a class="dropdown-item" (click)="toggleDataMode(40, '40 Minuten')">40 Minuten</a>-->
<!--</li>-->
<!--</ul>-->
<!--</div>-->
<div class="fade-in" xmlns="http://www.w3.org/1999/html">
<div class="chart-select-group">
<div class="btn-group" (click)="selectChart()">
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
btnRadio="{{labelPoints}}">{{labelPoints}}</label>
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
btnRadio="{{labelBudget}}">{{labelBudget}}</label>
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
btnRadio="{{labelKill}}">{{labelKill}}</label>
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
btnRadio="{{labelFriendlyFire}}">{{labelFriendlyFire}}</label>
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
btnRadio="{{labelVehicle}}">{{labelVehicle}}</label>
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
btnRadio="{{labelRevive}}">{{labelRevive}}</label>
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
btnRadio="{{labelStabilize}}">{{labelStabilize}}</label>
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
btnRadio="{{labelTransport}}">{{labelTransport}}</label>
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
btnRadio="{{labelFlag}}">{{labelFlag}}</label>
</div>
</div>
<mat-button-toggle-group class="chart-select-group"
#group="matButtonToggleGroup"
[(ngModel)]="activeChartSelect"
(change)="selectChart(group.value)">
<!--this does not work with ngFor due to deselect bug of ng-material-->
<mat-button-toggle value="{{labels.points}}">
{{labels.points}}
</mat-button-toggle>
<mat-button-toggle value="{{labels.budget}}">
{{labels.budget}}
</mat-button-toggle>
<mat-button-toggle value="{{labels.kill}}">
{{labels.kill}}
</mat-button-toggle>
<mat-button-toggle value="{{labels.friendlyFire}}">
{{labels.friendlyFire}}
</mat-button-toggle>
<mat-button-toggle value="{{labels.vehicle}}">
{{labels.vehicle}}
</mat-button-toggle>
<mat-button-toggle value="{{labels.revive}}">
{{labels.revive}}
</mat-button-toggle>
<mat-button-toggle value="{{labels.stabilize}}">
{{labels.stabilize}}
</mat-button-toggle>
<mat-button-toggle value="{{labels.transport}}">
{{labels.transport}}
</mat-button-toggle>
<mat-button-toggle value="{{labels.flag}}">
{{labels.flag}}
</mat-button-toggle>
</mat-button-toggle-group>
<div *ngIf="showLineChart" class="chart-container">
<ngx-charts-line-chart

View File

@ -24,7 +24,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
initialized: any;
public chartSelectModel: string;
public activeChartSelect: string;
lineChartData: any[] = [];
areaChartData: any[] = [];
@ -44,16 +44,19 @@ export class FractionStatsComponent implements OnInit, OnChanges {
Fraction.COLOR_BLUFOR_DARK, Fraction.COLOR_OPFOR_DARK, Fraction.COLOR_BLUFOR_GREY, Fraction.COLOR_OPFOR_GREY]
};
labelPoints = 'Punkte';
labelBudget = 'Budget';
labelKill = 'Abschüsse';
labelFriendlyFire = 'Friendly Fire';
labelVehicle = 'Fahrzeug Abschüsse';
labelTransport = 'Lufttransport';
labelRevive = 'Revive';
labelStabilize = 'Stabilisiert';
labelFlag = 'Flaggenbesitz';
lineChartLabel: string = this.labelPoints;
readonly labels = {
points: 'Punkte',
budget: 'Budget',
kill: 'Abschüsse',
friendlyFire: 'Friendly Fire',
vehicle: 'Fahrzeug Abschüsse',
transport: 'Lufttransport',
revive: 'Revive',
stabilize: 'Stabilisiert',
flag: 'Flaggenbesitz'
};
lineChartLabel: string = this.labels.points;
showLineChart = true;
stepCurve = d3.curveStepAfter;
@ -84,7 +87,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
flag: false
};
Object.assign(this, [this.lineChartData, this.areaChartData]);
this.chartSelectModel = this.labelPoints;
this.activeChartSelect = this.labels.points;
this.startDateObj = new Date(this.war.date);
this.startDateObj.setHours(0);
@ -93,39 +96,40 @@ export class FractionStatsComponent implements OnInit, OnChanges {
}
}
selectChart() {
if (this.chartSelectModel !== this.labelFlag) {
selectChart(newSelection) {
this.activeChartSelect = newSelection;
if (this.activeChartSelect !== this.labels.flag) {
this.showLineChart = true;
this.lineChartLabel = this.chartSelectModel;
switch (this.chartSelectModel) {
case this.labelPoints:
this.lineChartLabel = this.activeChartSelect;
switch (this.activeChartSelect) {
case this.labels.points:
this.lineChartData = this.tmpPointData;
break;
case this.labelBudget:
case this.labels.budget:
this.initBudgetData();
this.lineChartData = this.tmpBudgetData;
break;
case this.labelKill:
case this.labels.kill:
this.initKillData();
this.lineChartData = this.tmpKillData;
break;
case this.labelFriendlyFire:
case this.labels.friendlyFire:
this.initKillData();
this.lineChartData = this.tmpFrienlyFireData;
break;
case this.labelVehicle:
case this.labels.vehicle:
this.initVehicleData();
this.lineChartData = this.tmpVehicleData;
break;
case this.labelRevive:
case this.labels.revive:
this.initRevive();
this.lineChartData = this.tmpReviveData;
break;
case this.labelStabilize:
case this.labels.stabilize:
this.initRevive();
this.lineChartData = this.tmpStabilizeData;
break;
case this.labelTransport:
case this.labels.transport:
this.initTransportData();
this.lineChartData = this.tmpTransportData;
break;
@ -141,7 +145,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
this.initializeTempCollections();
this.initPointData();
this.showLineChart = true;
this.lineChartLabel = this.labelPoints;
this.lineChartLabel = this.labels.points;
this.lineChartData = this.tmpPointData;
}

View File

@ -3,7 +3,7 @@
<div class="row">
<div [ngClass]="[loginService.hasPermission(3) ? 'col-xs-9' : 'col-xs-11']">
<span>
<a style="font-size: 20px;">{{war.title}}</a>
<a>{{war.title}}</a>
</span>
<br>
<small>vom {{war.date | date: 'dd.MM.yyyy'}}</small>

View File

@ -3,7 +3,7 @@ import {War} from '../../../models/model-interfaces';
import {LoginService} from '../../../services/app-user-service/login-service';
@Component({
selector: 'pjm-war-item',
selector: 'cc-war-item',
templateUrl: './war-item.component.html',
styleUrls: ['./war-item.component.css', '../../../style/list-entry.css'],
changeDetection: ChangeDetectionStrategy.OnPush

View File

@ -1,5 +1,5 @@
span > a {
font-size: 20px !important;
font-weight: 600 !important;
}
mat-expansion-panel {
@ -8,7 +8,7 @@ mat-expansion-panel {
mat-panel-title {
font-size: 18px;
color: #FFFFFF;
color: #ffffff;
}
mat-expansion-panel-header {
@ -44,7 +44,7 @@ mat-expansion-panel-header.mat-expansion-panel-header:focus {
}
.war-interaction-panel > span {
color: #4b4b4b;
color: rgba(255, 255, 255, 0.64);
padding: 0 3px;
}
@ -53,9 +53,9 @@ mat-expansion-panel-header.mat-expansion-panel-header:focus {
}
.select-list > mat-accordion:first-child .mat-expansion-panel {
border-radius: 10px 10px 0 0;
border-radius: 6px 6px 0 0;
}
.select-list > mat-accordion:first-child .mat-expansion-panel-header {
border-radius: 8px 8px 0 0;
border-radius: 4px 4px 0 0;
}

View File

@ -15,12 +15,13 @@
{{campaign.title}}
</mat-panel-title>
<mat-panel-description class="war-interaction-panel" *ngIf="loginService.hasPermission(3)">
<span (click)="editCampaign(campaign); $event.stopPropagation()" title="Bearbeiten"
class="glyphicon glyphicon-edit trash">
</span>
<span (click)="deleteCampaign(campaign); $event.stopPropagation()" title="Löschen"
class="glyphicon glyphicon-trash trash">
</span>
<span (click)="editCampaign(campaign); $event.stopPropagation()" title="Bearbeiten"
class="glyphicon glyphicon-edit trash"
style="padding-right: 10px;">
</span>
</mat-panel-description>
</mat-expansion-panel-header>
<div class="top-list-entry">
@ -42,13 +43,13 @@
</div>
</div>
<div *ngFor="let war of campaign.wars">
<pjm-war-item
<cc-war-item
[war]="war"
(warEdit)="editWar($event)"
(warDelete)="deleteWar(war)"
(warSelected)="selectWar($event)"
[selected]="war._id == selectedWarId">
</pjm-war-item>
</cc-war-item>
</div>
</mat-expansion-panel>
</mat-accordion>

View File

@ -1,20 +1,13 @@
div.list-entry, a.list-entry,
div.user-list-entry, a.user-list-entry {
div.list-entry, a.list-entry {
padding: 8px;
border-radius: 2px;
border: lightgrey solid 1px;
cursor: cell;
cursor: pointer;
margin-bottom: -1px;
}
.user-list-entry a {
font-size: large;
font-weight: 600;
}
.user-list-entry small {
color: grey;
font-size: x-small;
div.list-entry:hover, a.list-entry:hover {
background-color: #f9f9f9;
}
.decoration-list-preview, .squad-list-preview {
@ -31,8 +24,8 @@ span > a, span.glyphicon, span.icon-award {
}
.list-entry a {
font-size: x-large;
font-weight: 700;
font-size: 20px;
text-decoration: none;
}
.list-entry small {

View File

@ -1,4 +1,4 @@
<div class="fade-in user-list-entry" [ngClass]="{selected : selected}" (click)="select()">
<div class="fade-in list-entry" [ngClass]="{selected : selected}" (click)="select()">
<div class="row">
<div class="col-sm-8">