Compare commits

..

No commits in common. "de9504a6f34fcc9c525a143788788513959a09af" and "56a119f5491796ea8215d114b82f3bb1b62411da" have entirely different histories.

45 changed files with 169 additions and 180 deletions

View File

@ -14,9 +14,10 @@ const AppUserModel = require('../models/app-user');
const account = express.Router(); const account = express.Router();
account.route('/') account.route('/')
.get((req, res, next) => { .get((req, res, next) => {
AppUserModel.find({}, {}, {sort: {username: 1}}).populate('squad').exec((err, items) => { AppUserModel.find({}).populate('squad').exec((err, items) => {
if (err) { if (err) {
err.status = codes.servererror; err.status = codes.servererror;
return next(err); return next(err);
@ -80,8 +81,10 @@ account.route('/:id')
routerHandling.httpMethodNotAllowed routerHandling.httpMethodNotAllowed
); );
// this middleware function can be used, if you like or remove it // this middleware function can be used, if you like or remove it
// it looks for object(s) in res.locals.items and if they exist, they are send to the client as json // it looks for object(s) in res.locals.items and if they exist, they are send to the client as json
account.use(routerHandling.emptyResponse); account.use(routerHandling.emptyResponse);
module.exports = account; module.exports = account;

View File

@ -22,10 +22,10 @@ overview.route('/')
let countOpfor = 0; let countOpfor = 0;
let countBlufor = 0; let countBlufor = 0;
const armyOverview = { const armyOverview = {
BLUFOR: { NATO: {
squads: [] squads: []
}, },
OPFOR: { CSAT: {
squads: [] squads: []
} }
}; };
@ -72,12 +72,12 @@ overview.route('/')
s.memberCount = squadMembers.length; s.memberCount = squadMembers.length;
if (s.fraction === 'BLUFOR') { if (s.fraction === 'BLUFOR') {
delete s.fraction; delete s.fraction;
armyOverview.BLUFOR.squads.push(s); armyOverview.NATO.squads.push(s);
countBlufor += s.members.length; countBlufor += s.members.length;
} }
if (s.fraction === 'OPFOR') { if (s.fraction === 'OPFOR') {
delete s.fraction; delete s.fraction;
armyOverview.OPFOR.squads.push(s); armyOverview.CSAT.squads.push(s);
countOpfor += s.members.length; countOpfor += s.members.length;
} }
callback(); callback();
@ -88,8 +88,8 @@ overview.route('/')
if (err) { if (err) {
return next(err); return next(err);
} }
armyOverview.BLUFOR.memberCount = countBlufor; armyOverview.NATO.memberCount = countBlufor;
armyOverview.OPFOR.memberCount = countOpfor; armyOverview.CSAT.memberCount = countOpfor;
res.locals.items = armyOverview; res.locals.items = armyOverview;
res.locals.processed = true; res.locals.processed = true;
next(); next();

View File

@ -1,6 +1,6 @@
{ {
"name": "opt-cc", "name": "opt-cc",
"version": "1.6.3", "version": "1.6.2",
"license": "MIT", "license": "MIT",
"author": "Florian Hartwich <hardi@noarch.de>", "author": "Florian Hartwich <hardi@noarch.de>",
"private": true, "private": true,

View File

@ -26,16 +26,19 @@
"@swimlane/ngx-charts": "^6.1.0", "@swimlane/ngx-charts": "^6.1.0",
"@swimlane/ngx-datatable": "^10.2.3", "@swimlane/ngx-datatable": "^10.2.3",
"bootstrap": "^3.3.7", "bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"d3": "^4.11.0", "d3": "^4.11.0",
"jquery": "^3.1.0", "jquery": "^3.1.0",
"jquery-ui": "^1.12.0", "jquery-ui": "^1.12.0",
"jquery-ui-bundle": "^1.11.4", "jquery-ui-bundle": "^1.11.4",
"ngx-bootstrap": "^2.0.0-beta.8", "ngx-bootstrap": "^1.9.3",
"ngx-clipboard": "^8.1.0", "ngx-clipboard": "^8.1.0",
"ngx-cookie-service": "^1.0.9", "ngx-cookie-service": "^1.0.9",
"ngx-infinite-scroll": "^0.5.2", "ngx-infinite-scroll": "^0.5.2",
"ts-helpers": "^1.1.2", "rxjs": "^5.2.0",
"typescript": "^2.6.1" "ts-helpers": "^1.1.1",
"typescript": "^2.3.4",
"zone.js": "^0.8.18"
}, },
"devDependencies": { "devDependencies": {
"@types/jasmine": "2.5.38", "@types/jasmine": "2.5.38",

View File

@ -44,7 +44,7 @@
(change)="updateAppUser(user)"> (change)="updateAppUser(user)">
<option [value]="0">Ohne Fraktion/ Squad</option> <option [value]="0">Ohne Fraktion/ Squad</option>
<option *ngFor="let squad of squads" [ngValue]="squad"> <option *ngFor="let squad of squads" [ngValue]="squad">
{{squad.fraction == 'BLUFOR'? fraction.BLUFOR : fraction.OPFOR}}: {{squad.name}} {{squad.fraction == 'BLUFOR'? 'NATO' : 'CSAT'}}: {{squad.name}}
</option> </option>
</select> </select>
</td> </td>

View File

@ -3,7 +3,6 @@ import {AppUser, Squad} from "../models/model-interfaces";
import {Observable} from "rxjs/Observable"; import {Observable} from "rxjs/Observable";
import {AppUserService} from "../services/app-user-service/app-user.service"; import {AppUserService} from "../services/app-user-service/app-user.service";
import {SquadService} from "../services/army-management/squad.service"; import {SquadService} from "../services/army-management/squad.service";
import {Fraction} from "../utils/fraction.enum";
@Component({ @Component({
@ -19,8 +18,6 @@ export class AdminComponent {
showSuccessLabel = false; showSuccessLabel = false;
readonly fraction = Fraction;
constructor(private appUserService: AppUserService, constructor(private appUserService: AppUserService,
private squadService: SquadService) { private squadService: SquadService) {
} }

View File

@ -27,6 +27,16 @@
overflow-x: auto; overflow-x: auto;
} }
.opfor {
color: firebrick;
font-weight: 600;
}
.blufor {
color: blue;
font-weight: 600;
}
.table-head { .table-head {
background: #222222; background: #222222;
color: white; color: white;

View File

@ -2,7 +2,7 @@
<div class="army-member-view-container"> <div class="army-member-view-container">
<div class="return-button"> <div class="return-button">
<span class="btn btn-default" style="position:absolute;" (click)="backToOverview()">< zurück zur Übersicht</span> <span class="btn btn-default" style="position:absolute;" (click)="backToOverview()">< zurück zur Übersicht</span>
<h3 class="text-center" style="font-weight: 600" [style.color]="user.squadId?.fraction === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR"> <h3 class="text-center" [ngClass]="user.squadId?.fraction === 'BLUFOR' ? 'blufor' : 'opfor'">
Auszeichnungen von {{user.username}} Auszeichnungen von {{user.username}}
</h3> </h3>
</div> </div>

View File

@ -5,7 +5,6 @@ import {UserService} from "../services/army-management/user.service";
import {Subscription} from "rxjs/Subscription"; import {Subscription} from "rxjs/Subscription";
import {RouteConfig} from "../app.config"; import {RouteConfig} from "../app.config";
import {AwardingService} from "../services/army-management/awarding.service"; import {AwardingService} from "../services/army-management/awarding.service";
import {Fraction} from "../utils/fraction.enum";
@Component({ @Component({
@ -25,8 +24,6 @@ export class ArmyMemberComponent {
isCopied = false; isCopied = false;
readonly fraction = Fraction;
constructor(private router: Router, constructor(private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
private userService: UserService, private userService: UserService,

View File

@ -58,6 +58,14 @@ img {
text-decoration: underline; text-decoration: underline;
} }
.text-opfor {
color: firebrick;
}
.text-blufor {
color: blue;
}
.army-head { .army-head {
font-weight: bolder; font-weight: bolder;
text-align: center text-align: center

View File

@ -2,8 +2,8 @@
<h1>Übersicht über alle Spieler, Squads und Armeen</h1> <h1>Übersicht über alle Spieler, Squads und Armeen</h1>
<div class="pull-left" style="width: 45%;"> <div class="pull-left" style="width: 45%;">
<h3 class="army-head" [style.color]="fraction.COLOR_BLUFOR">{{fraction.BLUFOR}}</h3> <h3 class="text-blufor army-head">NATO</h3>
<div class="squad-layout" *ngFor="let squad of army.BLUFOR.squads"> <div class="squad-layout" *ngFor="let squad of army.NATO.squads">
<div class="row colored-row title-row"> <div class="row colored-row title-row">
<div class="squad-cell pull-left"><img <div class="squad-cell pull-left"><img
src="resource/squad/{{squad._id}}.png"></div> src="resource/squad/{{squad._id}}.png"></div>
@ -11,8 +11,8 @@
</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 style="display: block" <span class="text-blufor"
[style.color]="fraction.COLOR_BLUFOR" style="display: block"
*ngFor="let member of squad.members"> *ngFor="let member of squad.members">
<span class="member-link" <span class="member-link"
(click)="select(member._id)"> (click)="select(member._id)">
@ -27,12 +27,12 @@
</div> </div>
</div> </div>
</div> </div>
<div style="padding: 20px; text-align: center;">Armeemitglieder: {{army.BLUFOR.memberCount}}</div> <div style="padding: 20px; text-align: center;">Armeemitglieder: {{army.NATO.memberCount}}</div>
</div> </div>
<div class="pull-right" style="width: 45%;"> <div class="pull-right" style="width: 45%;">
<h3 class="army-head" [style.color]="fraction.COLOR_OPFOR">{{fraction.OPFOR}}</h3> <h3 class="text-opfor army-head">CSAT</h3>
<div class="squad-layout" *ngFor="let squad of army.OPFOR.squads"> <div class="squad-layout" *ngFor="let squad of army.CSAT.squads">
<div class="row colored-row title-row"> <div class="row colored-row title-row">
<div class="squad-cell pull-left"><img <div class="squad-cell pull-left"><img
src="resource/squad/{{squad._id}}.png"></div> src="resource/squad/{{squad._id}}.png"></div>
@ -40,8 +40,8 @@
</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 style="display: block" <span class="text-opfor"
[style.color]="fraction.COLOR_OPFOR" style="display: block"
*ngFor="let member of squad.members"> *ngFor="let member of squad.members">
<span class="member-link" <span class="member-link"
(click)="select(member._id)"> (click)="select(member._id)">
@ -56,7 +56,7 @@
</div> </div>
</div> </div>
</div> </div>
<div style="padding: 20px; text-align: center;">Armeemitglieder: {{army.OPFOR.memberCount}}</div> <div style="padding: 20px; text-align: center;">Armeemitglieder: {{army.CSAT.memberCount}}</div>
</div> </div>
</div> </div>

View File

@ -2,7 +2,6 @@ import {Component} from "@angular/core";
import {Army} from "../models/model-interfaces"; import {Army} from "../models/model-interfaces";
import {ArmyService} from "../services/army-service/army.service"; import {ArmyService} from "../services/army-service/army.service";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {Fraction} from "../utils/fraction.enum";
@Component({ @Component({
@ -12,9 +11,7 @@ import {Fraction} from "../utils/fraction.enum";
}) })
export class ArmyComponent { export class ArmyComponent {
army: Army = {BLUFOR: {squads: [], memberCount: 0}, OPFOR: {squads: [], memberCount: 0}}; army: Army = {NATO: {squads: [], memberCount: 0}, CSAT: {squads: [], memberCount: 0}};
readonly fraction = Fraction;
constructor(private router: Router, constructor(private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,

View File

@ -6,8 +6,8 @@
<a>{{decoration.name}}</a> <a>{{decoration.name}}</a>
</span> </span>
<br> <br>
<small *ngIf="decoration.fraction == 'OPFOR'">{{fraction.OPFOR}}</small> <small *ngIf="decoration.fraction == 'OPFOR'">CSAT</small>
<small *ngIf="decoration.fraction == 'BLUFOR'">{{fraction.BLUFOR}}</small> <small *ngIf="decoration.fraction == 'BLUFOR'">NATO</small>
<small *ngIf="decoration.fraction == 'GLOBAL'">Global</small> <small *ngIf="decoration.fraction == 'GLOBAL'">Global</small>
<small> - Sortierung: {{decoration.sortingNumber}}</small> <small> - Sortierung: {{decoration.sortingNumber}}</small>
</div> </div>

View File

@ -1,9 +1,9 @@
import {ChangeDetectionStrategy, Component, EventEmitter} from "@angular/core"; import {ChangeDetectionStrategy, Component, EventEmitter} from "@angular/core";
import {Router} from "@angular/router";
import {Decoration} from "../../models/model-interfaces"; import {Decoration} from "../../models/model-interfaces";
import {Fraction} from "../../utils/fraction.enum";
@Component({ @Component({
selector: 'decoration-item', selector: 'pjm-decoration-item',
templateUrl: './decoration-item.component.html', templateUrl: './decoration-item.component.html',
styleUrls: ['./decoration-item.component.css', '../../style/list-entry.css'], styleUrls: ['./decoration-item.component.css', '../../style/list-entry.css'],
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
@ -20,9 +20,7 @@ export class DecorationItemComponent {
decorationSelected = new EventEmitter(); decorationSelected = new EventEmitter();
decorationDelete = new EventEmitter(); decorationDelete = new EventEmitter();
readonly fraction = Fraction; constructor(private router: Router) {
constructor() {
} }
ngOnInit() { ngOnInit() {

View File

@ -1,9 +1,9 @@
<div class="select-list"> <div class="select-list">
<div class="input-group list-header pull-left"> <div class="input-group list-header pull-left">
<div class="btn-group" (click)="filterDecorations()"> <div class="btn-group" (click)="filterDecorations()">
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="BLUFOR" uncheckable>{{fraction.BLUFOR}}</label> <label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="blufor" uncheckable>NATO</label>
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="OPFOR" uncheckable>{{fraction.OPFOR}}</label> <label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="opfor" uncheckable>CSAT</label>
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="GLOBAL" uncheckable>Global</label> <label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="global" uncheckable>Global</label>
</div> </div>
<a class="pull-right btn btn-success" (click)="openNewDecorationForm()">+</a> <a class="pull-right btn btn-success" (click)="openNewDecorationForm()">+</a>
</div> </div>
@ -22,12 +22,12 @@
</div> </div>
<div> <div>
<decoration-item *ngFor="let decoration of decorations$ | async" <pjm-decoration-item *ngFor="let decoration of decorations$ | async"
[decoration]="decoration" [decoration]="decoration"
(decorationDelete)="deleteDecoration(decoration)" (decorationDelete)="deleteDecoration(decoration)"
(decorationSelected)="selectDecoration($event)" (decorationSelected)="selectDecoration($event)"
[selected]="decoration._id == selectedDecorationId"> [selected]="decoration._id == selectedDecorationId">
</decoration-item> </pjm-decoration-item>
</div> </div>
</div> </div>

View File

@ -6,7 +6,6 @@ import {ActivatedRoute, Router} from "@angular/router";
import {Observable} from "rxjs/Observable"; import {Observable} from "rxjs/Observable";
import {Decoration} from "../../models/model-interfaces"; import {Decoration} from "../../models/model-interfaces";
import {DecorationService} from "../../services/army-management/decoration.service"; import {DecorationService} from "../../services/army-management/decoration.service";
import {Fraction} from "../../utils/fraction.enum";
@Component({ @Component({
selector: 'decoration-list', selector: 'decoration-list',
@ -23,8 +22,6 @@ export class DecorationListComponent implements OnInit {
public radioModel: string; public radioModel: string;
readonly fraction = Fraction;
constructor(private decorationService: DecorationService, constructor(private decorationService: DecorationService,
private router: Router, private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
@ -32,6 +29,7 @@ export class DecorationListComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.decorations$ = this.decorationService.decorations$; this.decorations$ = this.decorationService.decorations$;
const paramsStream = this.route.queryParams const paramsStream = this.route.queryParams
@ -46,6 +44,7 @@ export class DecorationListComponent implements OnInit {
.distinctUntilChanged() .distinctUntilChanged()
.switchMap(query => this.decorationService.findDecorations(query, this.radioModel)) .switchMap(query => this.decorationService.findDecorations(query, this.radioModel))
.subscribe(); .subscribe();
} }
openNewDecorationForm() { openNewDecorationForm() {
@ -60,8 +59,8 @@ export class DecorationListComponent implements OnInit {
deleteDecoration(decoration) { deleteDecoration(decoration) {
let fraction = 'Global'; let fraction = 'Global';
if (decoration.fraction === 'BLUFOR') fraction = Fraction.BLUFOR; if (decoration.fraction === 'BLUFOR') fraction = 'NATO';
else if (decoration.fraction === 'OPFOR') fraction = Fraction.OPFOR; else if (decoration.fraction === 'OPFOR') fraction = 'CSAT';
if (confirm('Soll die Auszeichnung "' + decoration.name + '" (' + fraction + ') wirklich gelöscht werden?')) { if (confirm('Soll die Auszeichnung "' + decoration.name + '" (' + fraction + ') wirklich gelöscht werden?')) {
this.decorationService.deleteDecoration(decoration) this.decorationService.deleteDecoration(decoration)

View File

@ -17,8 +17,8 @@
<select id="fraction" name="fraction" class="form-control btn dropdown-toggle" <select id="fraction" name="fraction" class="form-control btn dropdown-toggle"
required required
[(ngModel)]="decoration.fraction"> [(ngModel)]="decoration.fraction">
<option value="OPFOR">{{fraction.OPFOR}}</option> <option value="OPFOR">CSAT</option>
<option value="BLUFOR">{{fraction.BLUFOR}}</option> <option value="BLUFOR">NATO</option>
<option value="GLOBAL">Global</option> <option value="GLOBAL">Global</option>
</select> </select>
<show-error text="Fraktion" path="fraction"></show-error> <show-error text="Fraktion" path="fraction"></show-error>

View File

@ -4,7 +4,6 @@ import {NgForm} from "@angular/forms";
import {Decoration} from "../../models/model-interfaces"; import {Decoration} from "../../models/model-interfaces";
import {DecorationService} from "../../services/army-management/decoration.service"; import {DecorationService} from "../../services/army-management/decoration.service";
import {Subscription} from "rxjs/Subscription"; import {Subscription} from "rxjs/Subscription";
import {Fraction} from "../../utils/fraction.enum";
@Component({ @Component({
templateUrl: './edit-decoration.component.html', templateUrl: './edit-decoration.component.html',
@ -26,8 +25,6 @@ export class EditDecorationComponent {
@ViewChild(NgForm) form: NgForm; @ViewChild(NgForm) form: NgForm;
readonly fraction = Fraction;
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private router: Router, private router: Router,
private decorationService: DecorationService) { private decorationService: DecorationService) {

View File

@ -100,7 +100,7 @@ export interface Decoration {
} }
export interface Army { export interface Army {
BLUFOR: { NATO: {
squads: { squads: {
_id, _id,
name, name,
@ -113,7 +113,7 @@ export interface Army {
}[], }[],
memberCount memberCount
}, },
OPFOR: { CSAT: {
squads: { squads: {
_id, _id,
name, name,

View File

@ -18,8 +18,8 @@
<select id="fraction" name="fraction" class="form-control btn dropdown-toggle" <select id="fraction" name="fraction" class="form-control btn dropdown-toggle"
required required
[(ngModel)]="rank.fraction"> [(ngModel)]="rank.fraction">
<option value="OPFOR">{{fraction.OPFOR}}</option> <option value="OPFOR">CSAT</option>
<option value="BLUFOR">{{fraction.BLUFOR}}</option> <option value="BLUFOR">NATO</option>
</select> </select>
<show-error text="Fraktion" path="fraction"></show-error> <show-error text="Fraktion" path="fraction"></show-error>
</div> </div>

View File

@ -4,7 +4,6 @@ import {NgForm} from "@angular/forms";
import {Rank} from "../../models/model-interfaces"; import {Rank} from "../../models/model-interfaces";
import {RankService} from "../../services/army-management/rank.service"; import {RankService} from "../../services/army-management/rank.service";
import {Subscription} from "rxjs/Subscription"; import {Subscription} from "rxjs/Subscription";
import {Fraction} from "../../utils/fraction.enum";
@Component({ @Component({
@ -29,8 +28,6 @@ export class EditRankComponent {
@ViewChild(NgForm) form: NgForm; @ViewChild(NgForm) form: NgForm;
readonly fraction = Fraction;
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private router: Router, private router: Router,
private rankService: RankService) { private rankService: RankService) {

View File

@ -6,8 +6,8 @@
<a>{{rank.name}}</a> <a>{{rank.name}}</a>
</span> </span>
<br> <br>
<small *ngIf="rank.fraction == 'OPFOR'">{{fraction.OPFOR}}</small> <small *ngIf="rank.fraction == 'OPFOR'">CSAT</small>
<small *ngIf="rank.fraction == 'BLUFOR'">{{fraction.BLUFOR}}</small> <small *ngIf="rank.fraction == 'BLUFOR'">NATO</small>
<small> - Stufe {{rank.level}}</small> <small> - Stufe {{rank.level}}</small>
</div> </div>

View File

@ -1,6 +1,6 @@
import {ChangeDetectionStrategy, Component, EventEmitter} from "@angular/core"; import {ChangeDetectionStrategy, Component, EventEmitter} from "@angular/core";
import {Router} from "@angular/router";
import {Rank} from "../../models/model-interfaces"; import {Rank} from "../../models/model-interfaces";
import {Fraction} from "../../utils/fraction.enum";
@Component({ @Component({
selector: 'pjm-rank-item', selector: 'pjm-rank-item',
@ -19,9 +19,8 @@ export class RankItemComponent {
rankSelected = new EventEmitter(); rankSelected = new EventEmitter();
rankDelete = new EventEmitter(); rankDelete = new EventEmitter();
readonly fraction = Fraction; constructor(private router: Router) {
constructor() {
} }
ngOnInit() { ngOnInit() {

View File

@ -1,8 +1,8 @@
<div class="select-list"> <div class="select-list">
<div class="input-group list-header"> <div class="input-group list-header">
<div class="btn-group" (click)="filterRanks()"> <div class="btn-group" (click)="filterRanks()">
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="BLUFOR" uncheckable>{{fraction.BLUFOR}}</label> <label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="blufor" uncheckable>NATO</label>
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="OPFOR" uncheckable>{{fraction.OPFOR}}</label> <label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="opfor" uncheckable>CSAT</label>
</div> </div>
<a class="pull-right btn btn-success" (click)="openNewRankForm()">+</a> <a class="pull-right btn btn-success" (click)="openNewRankForm()">+</a>
</div> </div>

View File

@ -6,7 +6,6 @@ import {ActivatedRoute, Router} from "@angular/router";
import {Observable} from "rxjs/Observable"; import {Observable} from "rxjs/Observable";
import {Rank} from "../../models/model-interfaces"; import {Rank} from "../../models/model-interfaces";
import {RankService} from "../../services/army-management/rank.service"; import {RankService} from "../../services/army-management/rank.service";
import {Fraction} from "../../utils/fraction.enum";
@Component({ @Component({
selector: 'rank-list', selector: 'rank-list',
@ -23,8 +22,6 @@ export class RankListComponent implements OnInit {
public radioModel: string; public radioModel: string;
readonly fraction = Fraction;
constructor(private rankService: RankService, constructor(private rankService: RankService,
private router: Router, private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
@ -65,7 +62,7 @@ export class RankListComponent implements OnInit {
} }
deleteRank(rank) { deleteRank(rank) {
const fraction = rank.fraction === 'OPFOR' ? Fraction.OPFOR : Fraction.BLUFOR; const fraction = rank.fraction === 'OPFOR' ? 'CSAT' : 'NATO';
if (confirm('Soll der Rang ' + rank.name + ' (' + fraction + ') wirklich gelöscht werden?')) { if (confirm('Soll der Rang ' + rank.name + ' (' + fraction + ') wirklich gelöscht werden?')) {
this.rankService.deleteRank(rank) this.rankService.deleteRank(rank)
.subscribe((res) => { .subscribe((res) => {

View File

@ -18,8 +18,8 @@
<select id="fraction" name="fraction" class="form-control btn dropdown-toggle" <select id="fraction" name="fraction" class="form-control btn dropdown-toggle"
required required
[(ngModel)]="squad.fraction"> [(ngModel)]="squad.fraction">
<option value="OPFOR">{{fraction.OPFOR}}</option> <option value="OPFOR">CSAT</option>
<option value="BLUFOR">{{fraction.BLUFOR}}</option> <option value="BLUFOR">NATO</option>
</select> </select>
<show-error text="Fraktion" path="fraction"></show-error> <show-error text="Fraktion" path="fraction"></show-error>
</div> </div>

View File

@ -4,7 +4,6 @@ import {NgForm} from "@angular/forms";
import {Squad} from "../../models/model-interfaces"; import {Squad} from "../../models/model-interfaces";
import {SquadService} from "../../services/army-management/squad.service"; import {SquadService} from "../../services/army-management/squad.service";
import {Subscription} from "rxjs/Subscription"; import {Subscription} from "rxjs/Subscription";
import {Fraction} from "../../utils/fraction.enum";
@Component({ @Component({
@ -29,8 +28,6 @@ export class EditSquadComponent {
@ViewChild(NgForm) form: NgForm; @ViewChild(NgForm) form: NgForm;
readonly fraction = Fraction;
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private router: Router, private router: Router,
private squadService: SquadService) { private squadService: SquadService) {

View File

@ -6,8 +6,8 @@
<a>{{squad.name}}</a> <a>{{squad.name}}</a>
</span> </span>
<br> <br>
<small *ngIf="squad.fraction == 'OPFOR'">{{fraction.OPFOR}}</small> <small *ngIf="squad.fraction == 'OPFOR'">CSAT</small>
<small *ngIf="squad.fraction == 'BLUFOR'">{{fraction.BLUFOR}}</small> <small *ngIf="squad.fraction == 'BLUFOR'">NATO</small>
</div> </div>
<div class="col-xs-4"> <div class="col-xs-4">

View File

@ -1,6 +1,6 @@
import {ChangeDetectionStrategy, Component, EventEmitter} from "@angular/core"; import {ChangeDetectionStrategy, Component, EventEmitter} from "@angular/core";
import {Router} from "@angular/router";
import {Squad} from "../../models/model-interfaces"; import {Squad} from "../../models/model-interfaces";
import {Fraction} from "../../utils/fraction.enum";
@Component({ @Component({
selector: 'pjm-squad-item', selector: 'pjm-squad-item',
@ -20,9 +20,7 @@ export class SquadItemComponent {
imageSrc; imageSrc;
readonly fraction = Fraction; constructor(private router: Router) {
constructor() {
} }
ngOnInit() { ngOnInit() {

View File

@ -1,8 +1,8 @@
<div class="select-list"> <div class="select-list">
<div class="input-group list-header pull-left"> <div class="input-group list-header pull-left">
<div class="btn-group" (click)="filterSquads()"> <div class="btn-group" (click)="filterSquads()">
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="blufor" uncheckable>{{fraction.BLUFOR}}</label> <label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="blufor" uncheckable>NATO</label>
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="opfor" uncheckable>{{fraction.OPFOR}}</label> <label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="opfor" uncheckable>CSAT</label>
</div> </div>
<a class="pull-right btn btn-success" (click)="openNewSquadForm()">+</a> <a class="pull-right btn btn-success" (click)="openNewSquadForm()">+</a>
</div> </div>

View File

@ -6,7 +6,6 @@ import {ActivatedRoute, Router} from "@angular/router";
import {Observable} from "rxjs/Observable"; import {Observable} from "rxjs/Observable";
import {Squad} from "../../models/model-interfaces"; import {Squad} from "../../models/model-interfaces";
import {SquadService} from "../../services/army-management/squad.service"; import {SquadService} from "../../services/army-management/squad.service";
import {Fraction} from "../../utils/fraction.enum";
@Component({ @Component({
selector: 'squad-list', selector: 'squad-list',
@ -23,8 +22,6 @@ export class SquadListComponent implements OnInit {
public radioModel: string; public radioModel: string;
readonly fraction = Fraction;
constructor(private squadService: SquadService, constructor(private squadService: SquadService,
private router: Router, private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
@ -61,7 +58,7 @@ export class SquadListComponent implements OnInit {
} }
deleteSquad(squad) { deleteSquad(squad) {
const fraction = squad.fraction === 'OPFOR' ? Fraction.OPFOR : Fraction.BLUFOR; const fraction = squad.fraction === 'OPFOR' ? 'CSAT' : 'NATO';
if (confirm('Soll das Squad "' + squad.name + '" (' + fraction + ') wirklich gelöscht werden?')) { if (confirm('Soll das Squad "' + squad.name + '" (' + fraction + ') wirklich gelöscht werden?')) {
this.squadService.deleteSquad(squad) this.squadService.deleteSquad(squad)
.subscribe((res) => { .subscribe((res) => {

View File

@ -3,13 +3,12 @@ import {ActivatedRoute} from "@angular/router";
import {CarouselConfig} from "ngx-bootstrap"; import {CarouselConfig} from "ngx-bootstrap";
import {CampaignService} from "../../services/logs/campaign.service"; import {CampaignService} from "../../services/logs/campaign.service";
import {ChartUtils} from "../../utils/chart-utils"; import {ChartUtils} from "../../utils/chart-utils";
import {Fraction} from "../../utils/fraction.enum";
@Component({ @Component({
selector: 'stats-overview', selector: 'stats-overview',
templateUrl: './stats-overview.component.html', 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'],
inputs: ['campaigns'], inputs: ['campaigns'],
providers: [{provide: CarouselConfig, useValue: {interval: false}}] providers: [{provide: CarouselConfig, useValue: {interval: false}}]
}) })
@ -25,7 +24,7 @@ export class StatisticOverviewComponent {
activeSlideIndex; activeSlideIndex;
colorScheme = { colorScheme = {
domain: [Fraction.COLOR_BLUFOR, Fraction.COLOR_OPFOR] domain: ['#0000FF', '#B22222']
}; };
gradient = false; gradient = false;
xAxis = true; xAxis = true;
@ -69,10 +68,10 @@ export class StatisticOverviewComponent {
if (this.id === 'all') { if (this.id === 'all') {
this.title = "Gesamtübersicht"; this.title = "Gesamtübersicht";
wars.sort((a, b) => { wars.sort((a, b) => {
// sort by dates, because older campaign can contain newer war // sort by dates, because older campaign can contain newer war
if (a['date'] > (b['date'])) return -1; if (a['date'] > (b['date'])) return -1;
if (a['date'] < (b['date'])) return 1; if (a['date'] < (b['date'])) return 1;
return 0; return 0;
}) })
} else { } else {
this.title = campaign.title; this.title = campaign.title;
@ -101,12 +100,20 @@ export class StatisticOverviewComponent {
} }
initChart(wars: any[]) { initChart(wars: any[]) {
const pointsObj = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); let pointsObj = [
const pointsSumObj = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); {
const playersObj = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); "name": "NATO",
"series": []
},
{
"name": "CSAT",
"series": []
}];
let pointsSumObj = JSON.parse(JSON.stringify(pointsObj));
let playersObj = JSON.parse(JSON.stringify(pointsObj));
for (let i = wars.length - 1; i >= 0; i--) { for (let i = wars.length - 1; i >= 0; i--) {
const j = wars.length - i - 1; let j = wars.length - i - 1;
const warDateString = ChartUtils.getShortDateString(wars[i].date); const warDateString = ChartUtils.getShortDateString(wars[i].date);
pointsObj[0].series.push({ pointsObj[0].series.push({
@ -151,7 +158,7 @@ export class StatisticOverviewComponent {
} }
isActiveSlide(index) { isActiveSlide(index) {
return this.activeSlideIndex === index ? '#d9edf7' : 'white' return this.activeSlideIndex === index ? '#d9edf7':'white'
} }
} }

View File

@ -34,6 +34,14 @@
font-weight: bold; font-weight: bold;
} }
.text-opfor {
color: firebrick;
}
.text-blufor {
color: blue;
}
/* ########### TABS ########### */ /* ########### TABS ########### */
:host /deep/ .nav-tabs { :host /deep/ .nav-tabs {

View File

@ -5,16 +5,16 @@
<h2>{{war.title}} - vom {{war.date | date: 'dd.MM.yyyy'}}</h2> <h2>{{war.title}} - vom {{war.date | date: 'dd.MM.yyyy'}}</h2>
<div class="pull-left head-field" style="width: 250px"> <div class="pull-left head-field" style="width: 250px">
<h4>Endpunktestand:</h4> <h4>Endpunktestand:</h4>
<span [style.color]="fraction.COLOR_BLUFOR" style="font-weight: bold; margin-right: 10px">{{fraction.BLUFOR}} {{war.ptBlufor}}</span> <span class="text-blufor" style="font-weight: bold; margin-right: 10px">NATO {{war.ptBlufor}}</span>
<span style="font-size: x-large">|</span> <span style="font-size: x-large">|</span>
<span [style.color]="fraction.COLOR_OPFOR" style="font-weight: bold; margin-left: 10px;">{{war.ptOpfor}} {{fraction.OPFOR}}</span> <span class="text-opfor" style="font-weight: bold; margin-left: 10px;">{{war.ptOpfor}} CSAT</span>
</div> </div>
<div class="pull-left head-field " style="padding-left: 140px;"> <div class="pull-left head-field " style="padding-left: 140px;">
<h4 style="margin-bottom: 0;">Teilnehmer:</h4> <h4 style="margin-bottom: 0;">Teilnehmer:</h4>
<ngx-charts-pie-chart <ngx-charts-pie-chart
[view]="[120, 120]" [view]="[120, 120]"
[scheme]="{domain: [fraction.COLOR_OPFOR, fraction.COLOR_BLUFOR]}" [scheme]="{domain: ['#B22222', '#0000FF']}"
[results]="playerChart" [results]="playerChart"
[legend]="false" [legend]="false"
[explodeSlices]="false" [explodeSlices]="false"
@ -40,13 +40,13 @@
<input type="radio" name="fractSelect" value="BLUFOR" <input type="radio" name="fractSelect" value="BLUFOR"
[(ngModel)]="fractionRadioSelect" [(ngModel)]="fractionRadioSelect"
#fractRadioBufor #fractRadioBufor
(change)="filterPlayersByFraction(fractRadioBufor.value)">{{fraction.BLUFOR}} (change)="filterPlayersByFraction(fractRadioBufor.value)">NATO
</label> </label>
<label class="radio-inline"> <label class="radio-inline">
<input type="radio" name="fractSelect" value="OPFOR" <input type="radio" name="fractSelect" value="OPFOR"
[(ngModel)]="fractionRadioSelect" [(ngModel)]="fractionRadioSelect"
#fractRadioOpfor #fractRadioOpfor
(change)="filterPlayersByFraction(fractRadioOpfor.value)">{{fraction.OPFOR}} (change)="filterPlayersByFraction(fractRadioOpfor.value)">CSAT
</label> </label>
<br> <br>
</form> </form>
@ -73,14 +73,14 @@
<ngx-datatable-column name="Spieler" prop="name" [width]="210" style="padding-left:10px"> <ngx-datatable-column name="Spieler" prop="name" [width]="210" style="padding-left:10px">
<ng-template ngx-datatable-cell-template let-row="row" let-value="value"> <ng-template ngx-datatable-cell-template let-row="row" let-value="value">
<span class="player-name" <span class="player-name"
[style.color]="row['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR"> [ngClass]="row['fraction'] === 'BLUFOR' ? 'text-blufor' : 'text-opfor'">
{{value}} {{value}}
</span> </span>
</ng-template> </ng-template>
</ngx-datatable-column> </ngx-datatable-column>
<ngx-datatable-column name="Fraktion" prop="fraction" [width]="100"> <ngx-datatable-column name="Fraktion" prop="fraction" [width]="100">
<ng-template ngx-datatable-cell-template let-value="value"> <ng-template ngx-datatable-cell-template let-value="value">
{{value === 'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}} {{value === 'BLUFOR' ? 'NATO' : 'CSAT'}}
</ng-template> </ng-template>
</ngx-datatable-column> </ngx-datatable-column>
<ngx-datatable-column [width]="90" name="Kills" prop="kill"></ngx-datatable-column> <ngx-datatable-column [width]="90" name="Kills" prop="kill"></ngx-datatable-column>
@ -98,37 +98,35 @@
</ng-template> </ng-template>
<!--<div class="btn-group" style="position: absolute; margin-left: 5%;" dropdown>--> <!--<div class="btn-group" style="position: absolute; margin-left: 5%;" dropdown>-->
<!--<button dropdownToggle type="button" class="btn btn-default dropdown-toggle dropdown-toggle-split">--> <!--<button dropdownToggle type="button" class="btn btn-default dropdown-toggle dropdown-toggle-split">-->
<!--{{dataMode}} <span class="caret"></span>--> <!--{{dataMode}} <span class="caret"></span>-->
<!--</button>--> <!--</button>-->
<!--<ul *dropdownMenu class="dropdown-menu" role="menu">--> <!--<ul *dropdownMenu class="dropdown-menu" role="menu">-->
<!--<li role="menuitem"><a class="dropdown-item" (click)="toggleDataMode(0, 'Summe')">Summe</a></li>--> <!--<li role="menuitem"><a class="dropdown-item" (click)="toggleDataMode(0, 'Summe')">Summe</a></li>-->
<!--<li class="divider dropdown-divider"></li>--> <!--<li class="divider dropdown-divider"></li>-->
<!--<li class="disabled" role="menuitem">--> <!--<li class="disabled" role="menuitem">-->
<!--<a class="dropdown-item" style="cursor: default!important;">Interval:</a>--> <!--<a class="dropdown-item" style="cursor: default!important;">Interval:</a>-->
<!--</li>--> <!--</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(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(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(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(20, '20 Minuten')">20 Minuten</a>-->
<!--<li role="menuitem"><a class="dropdown-item" (click)="toggleDataMode(40, '40 Minuten')">40 Minuten</a>--> <!--<li role="menuitem"><a class="dropdown-item" (click)="toggleDataMode(40, '40 Minuten')">40 Minuten</a>-->
<!--</li>--> <!--</li>-->
<!--</ul>--> <!--</ul>-->
<!--</div>--> <!--</div>-->
<div class="chart-select-group btn-group" (click)="selectChart()"> <div class="chart-select-group 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="{{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="{{labelBudget}}">{{labelBudget}}</label>
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel" <label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel" btnRadio="{{labelKill}}">{{labelKill}}</label>
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="{{labelFriendlyFire}}">{{labelFriendlyFire}}</label>
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel" btnRadio="{{labelRevive}}">{{labelRevive}}</label> <label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel" btnRadio="{{labelRevive}}">{{labelRevive}}</label>
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel" <label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
btnRadio="{{labelStabilize}}">{{labelStabilize}}</label> btnRadio="{{labelStabilize}}">{{labelStabilize}}</label>
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel" <label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
btnRadio="{{labelTransport}}">{{labelTransport}}</label> btnRadio="{{labelTransport}}">{{labelTransport}}</label>
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel" <label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel" btnRadio="{{labelFlag}}">{{labelFlag}}</label>
btnRadio="{{labelFlag}}">{{labelFlag}}</label>
</div> </div>
<div *ngIf="showLineChart" class="chart-container"> <div *ngIf="showLineChart" class="chart-container">
@ -167,12 +165,6 @@
</ngx-charts-area-chart> </ngx-charts-area-chart>
</div> </div>
</tab> </tab>
<tab>
<ng-template tabHeading>
<img src="../../../assets/player-stats-btn.png"> Player
</ng-template>
</tab>
</tabset> </tabset>
</div> </div>

View File

@ -7,7 +7,6 @@ import {LogsService} from "../../services/logs/logs.service";
import {TabsetComponent} from "ngx-bootstrap"; import {TabsetComponent} from "ngx-bootstrap";
import * as d3 from "d3"; import * as d3 from "d3";
import {ChartUtils} from "../../utils/chart-utils"; import {ChartUtils} from "../../utils/chart-utils";
import {Fraction} from "../../utils/fraction.enum";
@Component({ @Component({
@ -17,20 +16,12 @@ import {Fraction} from "../../utils/fraction.enum";
}) })
export class WarDetailComponent { export class WarDetailComponent {
readonly fraction = Fraction;
@ViewChild('overview') private overviewContainer: ElementRef; @ViewChild('overview') private overviewContainer: ElementRef;
@ViewChild('staticTabs') staticTabs: TabsetComponent; @ViewChild('staticTabs') staticTabs: TabsetComponent;
war: War = {players: []}; war: War = {players: []};
logData: any;
initialized: any;
startDateObj: Date;
public chartSelectModel: string; public chartSelectModel: string;
fractionRadioSelect: string; fractionRadioSelect: string;
@ -60,8 +51,10 @@ export class WarDetailComponent {
tmpStabilizeData; tmpStabilizeData;
tmpFlagCaptureData; tmpFlagCaptureData;
initialized;
colorScheme = { colorScheme = {
domain: [Fraction.COLOR_BLUFOR, Fraction.COLOR_OPFOR] domain: ['#0000FF', '#B22222']
}; };
labelPoints = 'Punkte'; labelPoints = 'Punkte';
@ -87,6 +80,12 @@ export class WarDetailComponent {
timeline = false; timeline = false;
roundDomains = true; roundDomains = true;
startDateObj;
dataMode: string = 'Summe';
dataInterval: number = 0;
logData;
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private router: Router, private router: Router,
private warService: WarService, private warService: WarService,
@ -101,7 +100,7 @@ export class WarDetailComponent {
.subscribe(war => { .subscribe(war => {
this.war = war; this.war = war;
this.rows = war.players; this.rows = war.players;
this.playerChart = ChartUtils.getSingleDataArray(Fraction.OPFOR, war.playersOpfor, Fraction.BLUFOR, war.playersBlufor); this.playerChart = ChartUtils.getSingleDataArray('CSAT', war.playersOpfor, 'NATO', war.playersBlufor);
this.initialized = { this.initialized = {
basic: false, basic: false,
@ -188,6 +187,13 @@ export class WarDetailComponent {
} }
} }
toggleDataMode(interval, entryString) {
this.dataInterval = interval;
this.dataMode = entryString;
this.initTransportData();
this.lineChartData = this.tmpTransportData;
}
loadFractionData() { loadFractionData() {
if (this.initialized.basic) { if (this.initialized.basic) {
return; return;
@ -370,14 +376,14 @@ export class WarDetailComponent {
} }
initializeTempCollections() { initializeTempCollections() {
this.tmpPointData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpPointData = ChartUtils.getMultiDataArray('NATO', 'CSAT');
this.tmpBudgetData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpBudgetData = ChartUtils.getMultiDataArray('NATO', 'CSAT');
this.tmpKillData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpKillData = ChartUtils.getMultiDataArray('NATO', 'CSAT');
this.tmpFrienlyFireData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpFrienlyFireData = ChartUtils.getMultiDataArray('NATO', 'CSAT');
this.tmpTransportData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpTransportData = ChartUtils.getMultiDataArray('NATO', 'CSAT');
this.tmpReviveData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpReviveData = ChartUtils.getMultiDataArray('NATO', 'CSAT');
this.tmpStabilizeData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpStabilizeData = ChartUtils.getMultiDataArray('NATO', 'CSAT');
this.tmpFlagCaptureData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpFlagCaptureData = ChartUtils.getMultiDataArray('NATO', 'CSAT');
[this.tmpKillData, this.tmpFrienlyFireData, this.tmpReviveData, this.tmpStabilizeData, this.tmpTransportData].forEach(tmp => { [this.tmpKillData, this.tmpFrienlyFireData, this.tmpReviveData, this.tmpStabilizeData, this.tmpTransportData].forEach(tmp => {
[0, 1].forEach(index => { [0, 1].forEach(index => {

View File

@ -13,8 +13,7 @@
style="min-width: 200px;"> style="min-width: 200px;">
<option [value]="0">Auswählen...</option> <option [value]="0">Auswählen...</option>
<option *ngFor="let deco of decorations" [value]="deco._id"> <option *ngFor="let deco of decorations" [value]="deco._id">
{{deco.fraction == 'BLUFOR'? fraction.BLUFOR : deco.fraction == 'OPFOR'? fraction.OPFOR : 'Global'}}: {{deco.fraction == 'BLUFOR'? 'NATO' : deco.fraction == 'OPFOR'? 'CSAT' : 'Global'}}: {{deco.name}}
{{deco.name}}
</option> </option>
</select> </select>

View File

@ -4,7 +4,6 @@ import {Award, Decoration} from "../../models/model-interfaces";
import {NgForm} from "@angular/forms"; import {NgForm} from "@angular/forms";
import {AwardingService} from "../../services/army-management/awarding.service"; import {AwardingService} from "../../services/army-management/awarding.service";
import {DecorationService} from "../../services/army-management/decoration.service"; import {DecorationService} from "../../services/army-management/decoration.service";
import {Fraction} from "../../utils/fraction.enum";
@Component({ @Component({
@ -25,8 +24,6 @@ export class AwardUserComponent {
decoPreviewDisplay = 'none'; decoPreviewDisplay = 'none';
readonly fraction = Fraction;
constructor(private router: Router, constructor(private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
private awardingService: AwardingService, private awardingService: AwardingService,

View File

@ -24,7 +24,7 @@
(change)="toggleRanks()"> (change)="toggleRanks()">
<option [value]="0">Ohne Fraktion/ Squad</option> <option [value]="0">Ohne Fraktion/ Squad</option>
<option *ngFor="let squad of squads" [ngValue]="squad"> <option *ngFor="let squad of squads" [ngValue]="squad">
{{squad.fraction == 'BLUFOR'? fraction.BLUFOR : fraction.OPFOR}}: {{squad.name}} {{squad.fraction == 'BLUFOR'? 'NATO' : 'CSAT'}}: {{squad.name}}
</option> </option>
</select> </select>

View File

@ -6,7 +6,6 @@ import {SquadService} from "../../services/army-management/squad.service";
import {RankService} from "../../services/army-management/rank.service"; import {RankService} from "../../services/army-management/rank.service";
import {Subscription} from "rxjs"; import {Subscription} from "rxjs";
import {NgForm} from "@angular/forms"; import {NgForm} from "@angular/forms";
import {Fraction} from "../../utils/fraction.enum";
@Component({ @Component({
@ -33,8 +32,6 @@ export class EditUserComponent {
error: string; error: string;
readonly fraction = Fraction;
constructor(private router: Router, constructor(private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
private userService: UserService, private userService: UserService,

View File

@ -6,9 +6,8 @@
<a>{{user.username}}</a> <a>{{user.username}}</a>
</span> </span>
<br> <br>
<small *ngIf="user.squadId && user.squadId.fraction == 'OPFOR'">{{fraction.OPFOR}} - {{user.squadId.name}}</small> <small *ngIf="user.squadId && user.squadId.fraction == 'OPFOR'">CSAT - {{user.squadId.name}}</small>
<small *ngIf="user.squadId && user.squadId.fraction == 'BLUFOR'">{{fraction.BLUFOR}} - {{user.squadId.name}} <small *ngIf="user.squadId && user.squadId.fraction == 'BLUFOR'">NATO - {{user.squadId.name}}</small>
</small>
<small *ngIf="!user.squadId">ohne Squad/Fraktion</small> <small *ngIf="!user.squadId">ohne Squad/Fraktion</small>
</div> </div>

View File

@ -1,6 +1,6 @@
import {ChangeDetectionStrategy, Component, EventEmitter} from "@angular/core"; import {ChangeDetectionStrategy, Component, EventEmitter} from "@angular/core";
import {Router} from "@angular/router";
import {User} from "../../models/model-interfaces"; import {User} from "../../models/model-interfaces";
import {Fraction} from "../../utils/fraction.enum";
@Component({ @Component({
selector: 'pjm-user-item', selector: 'pjm-user-item',
@ -19,9 +19,8 @@ export class UserItemComponent {
userAward = new EventEmitter(); userAward = new EventEmitter();
userDelete = new EventEmitter(); userDelete = new EventEmitter();
readonly fraction = Fraction; constructor(private router: Router) {
constructor() {
} }
select() { select() {

View File

@ -1,8 +1,8 @@
<div class="select-list"> <div class="select-list">
<div class="input-group list-header pull-left"> <div class="input-group list-header pull-left">
<div class="btn-group" (click)="filterUsers()"> <div class="btn-group" (click)="filterUsers()">
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="BLUFOR" uncheckable>{{fraction.BLUFOR}}</label> <label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="BLUFOR" uncheckable>NATO</label>
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="OPFOR" uncheckable>{{fraction.OPFOR}}</label> <label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="OPFOR" uncheckable>CSAT</label>
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="UNASSIGNED" uncheckable>Ohne Squad</label> <label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="UNASSIGNED" uncheckable>Ohne Squad</label>
</div> </div>
<a class="pull-right btn btn-success" (click)="openNewUserForm()">+</a> <a class="pull-right btn btn-success" (click)="openNewUserForm()">+</a>

View File

@ -7,7 +7,6 @@ import {Observable} from "rxjs/Observable";
import {UserService} from "../../services/army-management/user.service"; import {UserService} from "../../services/army-management/user.service";
import {User} from "../../models/model-interfaces"; import {User} from "../../models/model-interfaces";
import {ADD, LOAD} from "../../services/stores/user.store"; import {ADD, LOAD} from "../../services/stores/user.store";
import {Fraction} from "../../utils/fraction.enum";
@Component({ @Component({
selector: 'squad-list', selector: 'squad-list',
@ -31,8 +30,6 @@ export class UserListComponent implements OnInit {
offset = 0; offset = 0;
limit = 20; limit = 20;
readonly fraction = Fraction;
constructor(private userService: UserService, constructor(private userService: UserService,
private router: Router, private router: Router,

View File

@ -1,6 +0,0 @@
export enum Fraction {
BLUFOR = 'NATO',
OPFOR = 'CSAT',
COLOR_BLUFOR = '#0000FF',
COLOR_OPFOR = '#B22222'
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 623 B