Compare commits

..

No commits in common. "7b58adad601e09e05f12f4de04305a8c2282f5ab" and "ce86593c0f1c36742b2ec532e39cd8efbe15cc4d" have entirely different histories.

10 changed files with 110 additions and 108 deletions

View File

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

View File

@ -1,32 +1,16 @@
.chart-select-group { .btn-dark {
display: flex;
width: 945px;
margin: auto;
}
.chart-select-group > mat-button-toggle {
background: #4b4b4b; background: #4b4b4b;
color: #f5f5f5; color: #f5f5f5;
border: 1px solid #000; border-color: #000;
} }
.chart-select-group > mat-button-toggle:hover { .btn-dark:hover {
background: #afafaf; background: #afafaf;
color: #f5f5f5; color: #f5f5f5;
} }
mat-button-toggle.mat-button-toggle-checked { .btn-dark.active {
background: #222222 !important; background: #222222;
}
: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 { .chart-container {
@ -37,3 +21,12 @@ mat-button-toggle.mat-button-toggle-checked {
padding: 15px; padding: 15px;
float: left; float: left;
} }
.chart-select-group {
width: 980px;
margin: auto;
}
/*.dropdown-menu > li > a {*/
/*cursor: pointer;*/
/*}*/

View File

@ -1,38 +1,45 @@
<div class="fade-in" xmlns="http://www.w3.org/1999/html"> <!--<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>-->
<mat-button-toggle-group class="chart-select-group" <div class="fade-in" xmlns="http://www.w3.org/1999/html">
#group="matButtonToggleGroup" <div class="chart-select-group">
[(ngModel)]="activeChartSelect" <div class="btn-group" (click)="selectChart()">
(change)="selectChart(group.value)"> <label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
<!--this does not work with ngFor due to deselect bug of ng-material--> btnRadio="{{labelPoints}}">{{labelPoints}}</label>
<mat-button-toggle value="{{labels.points}}"> <label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
{{labels.points}} btnRadio="{{labelBudget}}">{{labelBudget}}</label>
</mat-button-toggle> <label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
<mat-button-toggle value="{{labels.budget}}"> btnRadio="{{labelKill}}">{{labelKill}}</label>
{{labels.budget}} <label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
</mat-button-toggle> btnRadio="{{labelFriendlyFire}}">{{labelFriendlyFire}}</label>
<mat-button-toggle value="{{labels.kill}}"> <label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
{{labels.kill}} btnRadio="{{labelVehicle}}">{{labelVehicle}}</label>
</mat-button-toggle> <label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
<mat-button-toggle value="{{labels.friendlyFire}}"> btnRadio="{{labelRevive}}">{{labelRevive}}</label>
{{labels.friendlyFire}} <label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
</mat-button-toggle> btnRadio="{{labelStabilize}}">{{labelStabilize}}</label>
<mat-button-toggle value="{{labels.vehicle}}"> <label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
{{labels.vehicle}} btnRadio="{{labelTransport}}">{{labelTransport}}</label>
</mat-button-toggle> <label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
<mat-button-toggle value="{{labels.revive}}"> btnRadio="{{labelFlag}}">{{labelFlag}}</label>
{{labels.revive}} </div>
</mat-button-toggle> </div>
<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"> <div *ngIf="showLineChart" class="chart-container">
<ngx-charts-line-chart <ngx-charts-line-chart

View File

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

View File

@ -3,7 +3,7 @@
<div class="row"> <div class="row">
<div [ngClass]="[loginService.hasPermission(3) ? 'col-xs-9' : 'col-xs-11']"> <div [ngClass]="[loginService.hasPermission(3) ? 'col-xs-9' : 'col-xs-11']">
<span> <span>
<a>{{war.title}}</a> <a style="font-size: 20px;">{{war.title}}</a>
</span> </span>
<br> <br>
<small>vom {{war.date | date: 'dd.MM.yyyy'}}</small> <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'; import {LoginService} from '../../../services/app-user-service/login-service';
@Component({ @Component({
selector: 'cc-war-item', selector: 'pjm-war-item',
templateUrl: './war-item.component.html', 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 changeDetection: ChangeDetectionStrategy.OnPush

View File

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

View File

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

View File

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

View File

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