Compare commits
No commits in common. "de9504a6f34fcc9c525a143788788513959a09af" and "56a119f5491796ea8215d114b82f3bb1b62411da" have entirely different histories.
de9504a6f3
...
56a119f549
|
@ -14,9 +14,10 @@ const AppUserModel = require('../models/app-user');
|
|||
|
||||
const account = express.Router();
|
||||
|
||||
|
||||
account.route('/')
|
||||
.get((req, res, next) => {
|
||||
AppUserModel.find({}, {}, {sort: {username: 1}}).populate('squad').exec((err, items) => {
|
||||
AppUserModel.find({}).populate('squad').exec((err, items) => {
|
||||
if (err) {
|
||||
err.status = codes.servererror;
|
||||
return next(err);
|
||||
|
@ -80,8 +81,10 @@ account.route('/:id')
|
|||
routerHandling.httpMethodNotAllowed
|
||||
);
|
||||
|
||||
|
||||
// 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
|
||||
account.use(routerHandling.emptyResponse);
|
||||
|
||||
|
||||
module.exports = account;
|
||||
|
|
|
@ -22,10 +22,10 @@ overview.route('/')
|
|||
let countOpfor = 0;
|
||||
let countBlufor = 0;
|
||||
const armyOverview = {
|
||||
BLUFOR: {
|
||||
NATO: {
|
||||
squads: []
|
||||
},
|
||||
OPFOR: {
|
||||
CSAT: {
|
||||
squads: []
|
||||
}
|
||||
};
|
||||
|
@ -72,12 +72,12 @@ overview.route('/')
|
|||
s.memberCount = squadMembers.length;
|
||||
if (s.fraction === 'BLUFOR') {
|
||||
delete s.fraction;
|
||||
armyOverview.BLUFOR.squads.push(s);
|
||||
armyOverview.NATO.squads.push(s);
|
||||
countBlufor += s.members.length;
|
||||
}
|
||||
if (s.fraction === 'OPFOR') {
|
||||
delete s.fraction;
|
||||
armyOverview.OPFOR.squads.push(s);
|
||||
armyOverview.CSAT.squads.push(s);
|
||||
countOpfor += s.members.length;
|
||||
}
|
||||
callback();
|
||||
|
@ -88,8 +88,8 @@ overview.route('/')
|
|||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
armyOverview.BLUFOR.memberCount = countBlufor;
|
||||
armyOverview.OPFOR.memberCount = countOpfor;
|
||||
armyOverview.NATO.memberCount = countBlufor;
|
||||
armyOverview.CSAT.memberCount = countOpfor;
|
||||
res.locals.items = armyOverview;
|
||||
res.locals.processed = true;
|
||||
next();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "opt-cc",
|
||||
"version": "1.6.3",
|
||||
"version": "1.6.2",
|
||||
"license": "MIT",
|
||||
"author": "Florian Hartwich <hardi@noarch.de>",
|
||||
"private": true,
|
||||
|
|
|
@ -26,16 +26,19 @@
|
|||
"@swimlane/ngx-charts": "^6.1.0",
|
||||
"@swimlane/ngx-datatable": "^10.2.3",
|
||||
"bootstrap": "^3.3.7",
|
||||
"core-js": "^2.4.1",
|
||||
"d3": "^4.11.0",
|
||||
"jquery": "^3.1.0",
|
||||
"jquery-ui": "^1.12.0",
|
||||
"jquery-ui-bundle": "^1.11.4",
|
||||
"ngx-bootstrap": "^2.0.0-beta.8",
|
||||
"ngx-bootstrap": "^1.9.3",
|
||||
"ngx-clipboard": "^8.1.0",
|
||||
"ngx-cookie-service": "^1.0.9",
|
||||
"ngx-infinite-scroll": "^0.5.2",
|
||||
"ts-helpers": "^1.1.2",
|
||||
"typescript": "^2.6.1"
|
||||
"rxjs": "^5.2.0",
|
||||
"ts-helpers": "^1.1.1",
|
||||
"typescript": "^2.3.4",
|
||||
"zone.js": "^0.8.18"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jasmine": "2.5.38",
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
(change)="updateAppUser(user)">
|
||||
<option [value]="0">Ohne Fraktion/ Squad</option>
|
||||
<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>
|
||||
</select>
|
||||
</td>
|
||||
|
|
|
@ -3,7 +3,6 @@ import {AppUser, Squad} from "../models/model-interfaces";
|
|||
import {Observable} from "rxjs/Observable";
|
||||
import {AppUserService} from "../services/app-user-service/app-user.service";
|
||||
import {SquadService} from "../services/army-management/squad.service";
|
||||
import {Fraction} from "../utils/fraction.enum";
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -19,8 +18,6 @@ export class AdminComponent {
|
|||
|
||||
showSuccessLabel = false;
|
||||
|
||||
readonly fraction = Fraction;
|
||||
|
||||
constructor(private appUserService: AppUserService,
|
||||
private squadService: SquadService) {
|
||||
}
|
||||
|
|
|
@ -27,6 +27,16 @@
|
|||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.opfor {
|
||||
color: firebrick;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.blufor {
|
||||
color: blue;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.table-head {
|
||||
background: #222222;
|
||||
color: white;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="army-member-view-container">
|
||||
<div class="return-button">
|
||||
<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}}
|
||||
</h3>
|
||||
</div>
|
||||
|
|
|
@ -5,7 +5,6 @@ import {UserService} from "../services/army-management/user.service";
|
|||
import {Subscription} from "rxjs/Subscription";
|
||||
import {RouteConfig} from "../app.config";
|
||||
import {AwardingService} from "../services/army-management/awarding.service";
|
||||
import {Fraction} from "../utils/fraction.enum";
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -25,8 +24,6 @@ export class ArmyMemberComponent {
|
|||
|
||||
isCopied = false;
|
||||
|
||||
readonly fraction = Fraction;
|
||||
|
||||
constructor(private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private userService: UserService,
|
||||
|
|
|
@ -58,6 +58,14 @@ img {
|
|||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.text-opfor {
|
||||
color: firebrick;
|
||||
}
|
||||
|
||||
.text-blufor {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.army-head {
|
||||
font-weight: bolder;
|
||||
text-align: center
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<h1>Übersicht über alle Spieler, Squads und Armeen</h1>
|
||||
|
||||
<div class="pull-left" style="width: 45%;">
|
||||
<h3 class="army-head" [style.color]="fraction.COLOR_BLUFOR">{{fraction.BLUFOR}}</h3>
|
||||
<div class="squad-layout" *ngFor="let squad of army.BLUFOR.squads">
|
||||
<h3 class="text-blufor army-head">NATO</h3>
|
||||
<div class="squad-layout" *ngFor="let squad of army.NATO.squads">
|
||||
<div class="row colored-row title-row">
|
||||
<div class="squad-cell pull-left"><img
|
||||
src="resource/squad/{{squad._id}}.png"></div>
|
||||
|
@ -11,8 +11,8 @@
|
|||
</div>
|
||||
<div class="row middle-row">
|
||||
<div class="squad-cell name-cell">
|
||||
<span style="display: block"
|
||||
[style.color]="fraction.COLOR_BLUFOR"
|
||||
<span class="text-blufor"
|
||||
style="display: block"
|
||||
*ngFor="let member of squad.members">
|
||||
<span class="member-link"
|
||||
(click)="select(member._id)">
|
||||
|
@ -27,12 +27,12 @@
|
|||
</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 class="pull-right" style="width: 45%;">
|
||||
<h3 class="army-head" [style.color]="fraction.COLOR_OPFOR">{{fraction.OPFOR}}</h3>
|
||||
<div class="squad-layout" *ngFor="let squad of army.OPFOR.squads">
|
||||
<h3 class="text-opfor army-head">CSAT</h3>
|
||||
<div class="squad-layout" *ngFor="let squad of army.CSAT.squads">
|
||||
<div class="row colored-row title-row">
|
||||
<div class="squad-cell pull-left"><img
|
||||
src="resource/squad/{{squad._id}}.png"></div>
|
||||
|
@ -40,8 +40,8 @@
|
|||
</div>
|
||||
<div class="row middle-row">
|
||||
<div class="squad-cell name-cell">
|
||||
<span style="display: block"
|
||||
[style.color]="fraction.COLOR_OPFOR"
|
||||
<span class="text-opfor"
|
||||
style="display: block"
|
||||
*ngFor="let member of squad.members">
|
||||
<span class="member-link"
|
||||
(click)="select(member._id)">
|
||||
|
@ -56,7 +56,7 @@
|
|||
</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>
|
||||
|
|
|
@ -2,7 +2,6 @@ import {Component} from "@angular/core";
|
|||
import {Army} from "../models/model-interfaces";
|
||||
import {ArmyService} from "../services/army-service/army.service";
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {Fraction} from "../utils/fraction.enum";
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -12,9 +11,7 @@ import {Fraction} from "../utils/fraction.enum";
|
|||
})
|
||||
export class ArmyComponent {
|
||||
|
||||
army: Army = {BLUFOR: {squads: [], memberCount: 0}, OPFOR: {squads: [], memberCount: 0}};
|
||||
|
||||
readonly fraction = Fraction;
|
||||
army: Army = {NATO: {squads: [], memberCount: 0}, CSAT: {squads: [], memberCount: 0}};
|
||||
|
||||
constructor(private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<a>{{decoration.name}}</a>
|
||||
</span>
|
||||
<br>
|
||||
<small *ngIf="decoration.fraction == 'OPFOR'">{{fraction.OPFOR}}</small>
|
||||
<small *ngIf="decoration.fraction == 'BLUFOR'">{{fraction.BLUFOR}}</small>
|
||||
<small *ngIf="decoration.fraction == 'OPFOR'">CSAT</small>
|
||||
<small *ngIf="decoration.fraction == 'BLUFOR'">NATO</small>
|
||||
<small *ngIf="decoration.fraction == 'GLOBAL'">Global</small>
|
||||
<small> - Sortierung: {{decoration.sortingNumber}}</small>
|
||||
</div>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import {ChangeDetectionStrategy, Component, EventEmitter} from "@angular/core";
|
||||
import {Router} from "@angular/router";
|
||||
import {Decoration} from "../../models/model-interfaces";
|
||||
import {Fraction} from "../../utils/fraction.enum";
|
||||
|
||||
@Component({
|
||||
selector: 'decoration-item',
|
||||
selector: 'pjm-decoration-item',
|
||||
templateUrl: './decoration-item.component.html',
|
||||
styleUrls: ['./decoration-item.component.css', '../../style/list-entry.css'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
|
@ -20,9 +20,7 @@ export class DecorationItemComponent {
|
|||
decorationSelected = new EventEmitter();
|
||||
decorationDelete = new EventEmitter();
|
||||
|
||||
readonly fraction = Fraction;
|
||||
|
||||
constructor() {
|
||||
constructor(private router: Router) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<div class="select-list">
|
||||
<div class="input-group list-header pull-left">
|
||||
<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="OPFOR" uncheckable>{{fraction.OPFOR}}</label>
|
||||
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="GLOBAL" uncheckable>Global</label>
|
||||
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="blufor" uncheckable>NATO</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>
|
||||
</div>
|
||||
<a class="pull-right btn btn-success" (click)="openNewDecorationForm()">+</a>
|
||||
</div>
|
||||
|
@ -22,12 +22,12 @@
|
|||
</div>
|
||||
|
||||
<div>
|
||||
<decoration-item *ngFor="let decoration of decorations$ | async"
|
||||
<pjm-decoration-item *ngFor="let decoration of decorations$ | async"
|
||||
[decoration]="decoration"
|
||||
(decorationDelete)="deleteDecoration(decoration)"
|
||||
(decorationSelected)="selectDecoration($event)"
|
||||
[selected]="decoration._id == selectedDecorationId">
|
||||
</decoration-item>
|
||||
</pjm-decoration-item>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -6,7 +6,6 @@ import {ActivatedRoute, Router} from "@angular/router";
|
|||
import {Observable} from "rxjs/Observable";
|
||||
import {Decoration} from "../../models/model-interfaces";
|
||||
import {DecorationService} from "../../services/army-management/decoration.service";
|
||||
import {Fraction} from "../../utils/fraction.enum";
|
||||
|
||||
@Component({
|
||||
selector: 'decoration-list',
|
||||
|
@ -23,8 +22,6 @@ export class DecorationListComponent implements OnInit {
|
|||
|
||||
public radioModel: string;
|
||||
|
||||
readonly fraction = Fraction;
|
||||
|
||||
constructor(private decorationService: DecorationService,
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
|
@ -32,6 +29,7 @@ export class DecorationListComponent implements OnInit {
|
|||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.decorations$ = this.decorationService.decorations$;
|
||||
|
||||
const paramsStream = this.route.queryParams
|
||||
|
@ -46,6 +44,7 @@ export class DecorationListComponent implements OnInit {
|
|||
.distinctUntilChanged()
|
||||
.switchMap(query => this.decorationService.findDecorations(query, this.radioModel))
|
||||
.subscribe();
|
||||
|
||||
}
|
||||
|
||||
openNewDecorationForm() {
|
||||
|
@ -60,8 +59,8 @@ export class DecorationListComponent implements OnInit {
|
|||
|
||||
deleteDecoration(decoration) {
|
||||
let fraction = 'Global';
|
||||
if (decoration.fraction === 'BLUFOR') fraction = Fraction.BLUFOR;
|
||||
else if (decoration.fraction === 'OPFOR') fraction = Fraction.OPFOR;
|
||||
if (decoration.fraction === 'BLUFOR') fraction = 'NATO';
|
||||
else if (decoration.fraction === 'OPFOR') fraction = 'CSAT';
|
||||
|
||||
if (confirm('Soll die Auszeichnung "' + decoration.name + '" (' + fraction + ') wirklich gelöscht werden?')) {
|
||||
this.decorationService.deleteDecoration(decoration)
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
<select id="fraction" name="fraction" class="form-control btn dropdown-toggle"
|
||||
required
|
||||
[(ngModel)]="decoration.fraction">
|
||||
<option value="OPFOR">{{fraction.OPFOR}}</option>
|
||||
<option value="BLUFOR">{{fraction.BLUFOR}}</option>
|
||||
<option value="OPFOR">CSAT</option>
|
||||
<option value="BLUFOR">NATO</option>
|
||||
<option value="GLOBAL">Global</option>
|
||||
</select>
|
||||
<show-error text="Fraktion" path="fraction"></show-error>
|
||||
|
|
|
@ -4,7 +4,6 @@ import {NgForm} from "@angular/forms";
|
|||
import {Decoration} from "../../models/model-interfaces";
|
||||
import {DecorationService} from "../../services/army-management/decoration.service";
|
||||
import {Subscription} from "rxjs/Subscription";
|
||||
import {Fraction} from "../../utils/fraction.enum";
|
||||
|
||||
@Component({
|
||||
templateUrl: './edit-decoration.component.html',
|
||||
|
@ -26,8 +25,6 @@ export class EditDecorationComponent {
|
|||
|
||||
@ViewChild(NgForm) form: NgForm;
|
||||
|
||||
readonly fraction = Fraction;
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private decorationService: DecorationService) {
|
||||
|
|
|
@ -100,7 +100,7 @@ export interface Decoration {
|
|||
}
|
||||
|
||||
export interface Army {
|
||||
BLUFOR: {
|
||||
NATO: {
|
||||
squads: {
|
||||
_id,
|
||||
name,
|
||||
|
@ -113,7 +113,7 @@ export interface Army {
|
|||
}[],
|
||||
memberCount
|
||||
},
|
||||
OPFOR: {
|
||||
CSAT: {
|
||||
squads: {
|
||||
_id,
|
||||
name,
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
<select id="fraction" name="fraction" class="form-control btn dropdown-toggle"
|
||||
required
|
||||
[(ngModel)]="rank.fraction">
|
||||
<option value="OPFOR">{{fraction.OPFOR}}</option>
|
||||
<option value="BLUFOR">{{fraction.BLUFOR}}</option>
|
||||
<option value="OPFOR">CSAT</option>
|
||||
<option value="BLUFOR">NATO</option>
|
||||
</select>
|
||||
<show-error text="Fraktion" path="fraction"></show-error>
|
||||
</div>
|
||||
|
|
|
@ -4,7 +4,6 @@ import {NgForm} from "@angular/forms";
|
|||
import {Rank} from "../../models/model-interfaces";
|
||||
import {RankService} from "../../services/army-management/rank.service";
|
||||
import {Subscription} from "rxjs/Subscription";
|
||||
import {Fraction} from "../../utils/fraction.enum";
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -29,8 +28,6 @@ export class EditRankComponent {
|
|||
|
||||
@ViewChild(NgForm) form: NgForm;
|
||||
|
||||
readonly fraction = Fraction;
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private rankService: RankService) {
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<a>{{rank.name}}</a>
|
||||
</span>
|
||||
<br>
|
||||
<small *ngIf="rank.fraction == 'OPFOR'">{{fraction.OPFOR}}</small>
|
||||
<small *ngIf="rank.fraction == 'BLUFOR'">{{fraction.BLUFOR}}</small>
|
||||
<small *ngIf="rank.fraction == 'OPFOR'">CSAT</small>
|
||||
<small *ngIf="rank.fraction == 'BLUFOR'">NATO</small>
|
||||
<small> - Stufe {{rank.level}}</small>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {ChangeDetectionStrategy, Component, EventEmitter} from "@angular/core";
|
||||
import {Router} from "@angular/router";
|
||||
import {Rank} from "../../models/model-interfaces";
|
||||
import {Fraction} from "../../utils/fraction.enum";
|
||||
|
||||
@Component({
|
||||
selector: 'pjm-rank-item',
|
||||
|
@ -19,9 +19,8 @@ export class RankItemComponent {
|
|||
rankSelected = new EventEmitter();
|
||||
rankDelete = new EventEmitter();
|
||||
|
||||
readonly fraction = Fraction;
|
||||
constructor(private router: Router) {
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<div class="select-list">
|
||||
<div class="input-group list-header">
|
||||
<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="OPFOR" uncheckable>{{fraction.OPFOR}}</label>
|
||||
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="blufor" uncheckable>NATO</label>
|
||||
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="opfor" uncheckable>CSAT</label>
|
||||
</div>
|
||||
<a class="pull-right btn btn-success" (click)="openNewRankForm()">+</a>
|
||||
</div>
|
||||
|
|
|
@ -6,7 +6,6 @@ import {ActivatedRoute, Router} from "@angular/router";
|
|||
import {Observable} from "rxjs/Observable";
|
||||
import {Rank} from "../../models/model-interfaces";
|
||||
import {RankService} from "../../services/army-management/rank.service";
|
||||
import {Fraction} from "../../utils/fraction.enum";
|
||||
|
||||
@Component({
|
||||
selector: 'rank-list',
|
||||
|
@ -23,8 +22,6 @@ export class RankListComponent implements OnInit {
|
|||
|
||||
public radioModel: string;
|
||||
|
||||
readonly fraction = Fraction;
|
||||
|
||||
constructor(private rankService: RankService,
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
|
@ -65,7 +62,7 @@ export class RankListComponent implements OnInit {
|
|||
}
|
||||
|
||||
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?')) {
|
||||
this.rankService.deleteRank(rank)
|
||||
.subscribe((res) => {
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
<select id="fraction" name="fraction" class="form-control btn dropdown-toggle"
|
||||
required
|
||||
[(ngModel)]="squad.fraction">
|
||||
<option value="OPFOR">{{fraction.OPFOR}}</option>
|
||||
<option value="BLUFOR">{{fraction.BLUFOR}}</option>
|
||||
<option value="OPFOR">CSAT</option>
|
||||
<option value="BLUFOR">NATO</option>
|
||||
</select>
|
||||
<show-error text="Fraktion" path="fraction"></show-error>
|
||||
</div>
|
||||
|
|
|
@ -4,7 +4,6 @@ import {NgForm} from "@angular/forms";
|
|||
import {Squad} from "../../models/model-interfaces";
|
||||
import {SquadService} from "../../services/army-management/squad.service";
|
||||
import {Subscription} from "rxjs/Subscription";
|
||||
import {Fraction} from "../../utils/fraction.enum";
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -29,8 +28,6 @@ export class EditSquadComponent {
|
|||
|
||||
@ViewChild(NgForm) form: NgForm;
|
||||
|
||||
readonly fraction = Fraction;
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private squadService: SquadService) {
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<a>{{squad.name}}</a>
|
||||
</span>
|
||||
<br>
|
||||
<small *ngIf="squad.fraction == 'OPFOR'">{{fraction.OPFOR}}</small>
|
||||
<small *ngIf="squad.fraction == 'BLUFOR'">{{fraction.BLUFOR}}</small>
|
||||
<small *ngIf="squad.fraction == 'OPFOR'">CSAT</small>
|
||||
<small *ngIf="squad.fraction == 'BLUFOR'">NATO</small>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-4">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {ChangeDetectionStrategy, Component, EventEmitter} from "@angular/core";
|
||||
import {Router} from "@angular/router";
|
||||
import {Squad} from "../../models/model-interfaces";
|
||||
import {Fraction} from "../../utils/fraction.enum";
|
||||
|
||||
@Component({
|
||||
selector: 'pjm-squad-item',
|
||||
|
@ -20,9 +20,7 @@ export class SquadItemComponent {
|
|||
|
||||
imageSrc;
|
||||
|
||||
readonly fraction = Fraction;
|
||||
|
||||
constructor() {
|
||||
constructor(private router: Router) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<div class="select-list">
|
||||
<div class="input-group list-header pull-left">
|
||||
<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="opfor" uncheckable>{{fraction.OPFOR}}</label>
|
||||
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="blufor" uncheckable>NATO</label>
|
||||
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="opfor" uncheckable>CSAT</label>
|
||||
</div>
|
||||
<a class="pull-right btn btn-success" (click)="openNewSquadForm()">+</a>
|
||||
</div>
|
||||
|
|
|
@ -6,7 +6,6 @@ import {ActivatedRoute, Router} from "@angular/router";
|
|||
import {Observable} from "rxjs/Observable";
|
||||
import {Squad} from "../../models/model-interfaces";
|
||||
import {SquadService} from "../../services/army-management/squad.service";
|
||||
import {Fraction} from "../../utils/fraction.enum";
|
||||
|
||||
@Component({
|
||||
selector: 'squad-list',
|
||||
|
@ -23,8 +22,6 @@ export class SquadListComponent implements OnInit {
|
|||
|
||||
public radioModel: string;
|
||||
|
||||
readonly fraction = Fraction;
|
||||
|
||||
constructor(private squadService: SquadService,
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
|
@ -61,7 +58,7 @@ export class SquadListComponent implements OnInit {
|
|||
}
|
||||
|
||||
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?')) {
|
||||
this.squadService.deleteSquad(squad)
|
||||
.subscribe((res) => {
|
||||
|
|
|
@ -3,13 +3,12 @@ import {ActivatedRoute} from "@angular/router";
|
|||
import {CarouselConfig} from "ngx-bootstrap";
|
||||
import {CampaignService} from "../../services/logs/campaign.service";
|
||||
import {ChartUtils} from "../../utils/chart-utils";
|
||||
import {Fraction} from "../../utils/fraction.enum";
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'stats-overview',
|
||||
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'],
|
||||
providers: [{provide: CarouselConfig, useValue: {interval: false}}]
|
||||
})
|
||||
|
@ -25,7 +24,7 @@ export class StatisticOverviewComponent {
|
|||
activeSlideIndex;
|
||||
|
||||
colorScheme = {
|
||||
domain: [Fraction.COLOR_BLUFOR, Fraction.COLOR_OPFOR]
|
||||
domain: ['#0000FF', '#B22222']
|
||||
};
|
||||
gradient = false;
|
||||
xAxis = true;
|
||||
|
@ -69,10 +68,10 @@ export class StatisticOverviewComponent {
|
|||
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;
|
||||
// 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;
|
||||
|
@ -101,12 +100,20 @@ export class StatisticOverviewComponent {
|
|||
}
|
||||
|
||||
initChart(wars: any[]) {
|
||||
const pointsObj = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
|
||||
const pointsSumObj = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
|
||||
const playersObj = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
|
||||
let pointsObj = [
|
||||
{
|
||||
"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--) {
|
||||
const j = wars.length - i - 1;
|
||||
let j = wars.length - i - 1;
|
||||
const warDateString = ChartUtils.getShortDateString(wars[i].date);
|
||||
|
||||
pointsObj[0].series.push({
|
||||
|
@ -151,7 +158,7 @@ export class StatisticOverviewComponent {
|
|||
}
|
||||
|
||||
isActiveSlide(index) {
|
||||
return this.activeSlideIndex === index ? '#d9edf7' : 'white'
|
||||
return this.activeSlideIndex === index ? '#d9edf7':'white'
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,6 +34,14 @@
|
|||
font-weight: bold;
|
||||
}
|
||||
|
||||
.text-opfor {
|
||||
color: firebrick;
|
||||
}
|
||||
|
||||
.text-blufor {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
/* ########### TABS ########### */
|
||||
|
||||
:host /deep/ .nav-tabs {
|
||||
|
|
|
@ -5,16 +5,16 @@
|
|||
<h2>{{war.title}} - vom {{war.date | date: 'dd.MM.yyyy'}}</h2>
|
||||
<div class="pull-left head-field" style="width: 250px">
|
||||
<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.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 class="pull-left head-field " style="padding-left: 140px;">
|
||||
<h4 style="margin-bottom: 0;">Teilnehmer:</h4>
|
||||
<ngx-charts-pie-chart
|
||||
[view]="[120, 120]"
|
||||
[scheme]="{domain: [fraction.COLOR_OPFOR, fraction.COLOR_BLUFOR]}"
|
||||
[scheme]="{domain: ['#B22222', '#0000FF']}"
|
||||
[results]="playerChart"
|
||||
[legend]="false"
|
||||
[explodeSlices]="false"
|
||||
|
@ -40,13 +40,13 @@
|
|||
<input type="radio" name="fractSelect" value="BLUFOR"
|
||||
[(ngModel)]="fractionRadioSelect"
|
||||
#fractRadioBufor
|
||||
(change)="filterPlayersByFraction(fractRadioBufor.value)">{{fraction.BLUFOR}}
|
||||
(change)="filterPlayersByFraction(fractRadioBufor.value)">NATO
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="fractSelect" value="OPFOR"
|
||||
[(ngModel)]="fractionRadioSelect"
|
||||
#fractRadioOpfor
|
||||
(change)="filterPlayersByFraction(fractRadioOpfor.value)">{{fraction.OPFOR}}
|
||||
(change)="filterPlayersByFraction(fractRadioOpfor.value)">CSAT
|
||||
</label>
|
||||
<br>
|
||||
</form>
|
||||
|
@ -73,14 +73,14 @@
|
|||
<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">
|
||||
<span class="player-name"
|
||||
[style.color]="row['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR">
|
||||
[ngClass]="row['fraction'] === 'BLUFOR' ? 'text-blufor' : 'text-opfor'">
|
||||
{{value}}
|
||||
</span>
|
||||
</ng-template>
|
||||
</ngx-datatable-column>
|
||||
<ngx-datatable-column name="Fraktion" prop="fraction" [width]="100">
|
||||
<ng-template ngx-datatable-cell-template let-value="value">
|
||||
{{value === 'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}}
|
||||
{{value === 'BLUFOR' ? 'NATO' : 'CSAT'}}
|
||||
</ng-template>
|
||||
</ngx-datatable-column>
|
||||
<ngx-datatable-column [width]="90" name="Kills" prop="kill"></ngx-datatable-column>
|
||||
|
@ -98,37 +98,35 @@
|
|||
</ng-template>
|
||||
|
||||
<!--<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>-->
|
||||
<!--<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="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="{{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="{{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="{{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>
|
||||
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel" btnRadio="{{labelFlag}}">{{labelFlag}}</label>
|
||||
</div>
|
||||
|
||||
<div *ngIf="showLineChart" class="chart-container">
|
||||
|
@ -167,12 +165,6 @@
|
|||
</ngx-charts-area-chart>
|
||||
</div>
|
||||
</tab>
|
||||
|
||||
<tab>
|
||||
<ng-template tabHeading>
|
||||
<img src="../../../assets/player-stats-btn.png"> Player
|
||||
</ng-template>
|
||||
</tab>
|
||||
</tabset>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -7,7 +7,6 @@ import {LogsService} from "../../services/logs/logs.service";
|
|||
import {TabsetComponent} from "ngx-bootstrap";
|
||||
import * as d3 from "d3";
|
||||
import {ChartUtils} from "../../utils/chart-utils";
|
||||
import {Fraction} from "../../utils/fraction.enum";
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -17,20 +16,12 @@ import {Fraction} from "../../utils/fraction.enum";
|
|||
})
|
||||
export class WarDetailComponent {
|
||||
|
||||
readonly fraction = Fraction;
|
||||
|
||||
@ViewChild('overview') private overviewContainer: ElementRef;
|
||||
|
||||
@ViewChild('staticTabs') staticTabs: TabsetComponent;
|
||||
|
||||
war: War = {players: []};
|
||||
|
||||
logData: any;
|
||||
|
||||
initialized: any;
|
||||
|
||||
startDateObj: Date;
|
||||
|
||||
public chartSelectModel: string;
|
||||
|
||||
fractionRadioSelect: string;
|
||||
|
@ -60,8 +51,10 @@ export class WarDetailComponent {
|
|||
tmpStabilizeData;
|
||||
tmpFlagCaptureData;
|
||||
|
||||
initialized;
|
||||
|
||||
colorScheme = {
|
||||
domain: [Fraction.COLOR_BLUFOR, Fraction.COLOR_OPFOR]
|
||||
domain: ['#0000FF', '#B22222']
|
||||
};
|
||||
|
||||
labelPoints = 'Punkte';
|
||||
|
@ -87,6 +80,12 @@ export class WarDetailComponent {
|
|||
timeline = false;
|
||||
roundDomains = true;
|
||||
|
||||
startDateObj;
|
||||
|
||||
dataMode: string = 'Summe';
|
||||
dataInterval: number = 0;
|
||||
logData;
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private warService: WarService,
|
||||
|
@ -101,7 +100,7 @@ export class WarDetailComponent {
|
|||
.subscribe(war => {
|
||||
this.war = war;
|
||||
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 = {
|
||||
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() {
|
||||
if (this.initialized.basic) {
|
||||
return;
|
||||
|
@ -370,14 +376,14 @@ export class WarDetailComponent {
|
|||
}
|
||||
|
||||
initializeTempCollections() {
|
||||
this.tmpPointData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
|
||||
this.tmpBudgetData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
|
||||
this.tmpKillData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
|
||||
this.tmpFrienlyFireData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
|
||||
this.tmpTransportData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
|
||||
this.tmpReviveData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
|
||||
this.tmpStabilizeData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
|
||||
this.tmpFlagCaptureData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
|
||||
this.tmpPointData = ChartUtils.getMultiDataArray('NATO', 'CSAT');
|
||||
this.tmpBudgetData = ChartUtils.getMultiDataArray('NATO', 'CSAT');
|
||||
this.tmpKillData = ChartUtils.getMultiDataArray('NATO', 'CSAT');
|
||||
this.tmpFrienlyFireData = ChartUtils.getMultiDataArray('NATO', 'CSAT');
|
||||
this.tmpTransportData = ChartUtils.getMultiDataArray('NATO', 'CSAT');
|
||||
this.tmpReviveData = ChartUtils.getMultiDataArray('NATO', 'CSAT');
|
||||
this.tmpStabilizeData = ChartUtils.getMultiDataArray('NATO', 'CSAT');
|
||||
this.tmpFlagCaptureData = ChartUtils.getMultiDataArray('NATO', 'CSAT');
|
||||
|
||||
[this.tmpKillData, this.tmpFrienlyFireData, this.tmpReviveData, this.tmpStabilizeData, this.tmpTransportData].forEach(tmp => {
|
||||
[0, 1].forEach(index => {
|
||||
|
|
|
@ -13,8 +13,7 @@
|
|||
style="min-width: 200px;">
|
||||
<option [value]="0">Auswählen...</option>
|
||||
<option *ngFor="let deco of decorations" [value]="deco._id">
|
||||
{{deco.fraction == 'BLUFOR'? fraction.BLUFOR : deco.fraction == 'OPFOR'? fraction.OPFOR : 'Global'}}:
|
||||
{{deco.name}}
|
||||
{{deco.fraction == 'BLUFOR'? 'NATO' : deco.fraction == 'OPFOR'? 'CSAT' : 'Global'}}: {{deco.name}}
|
||||
</option>
|
||||
</select>
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import {Award, Decoration} from "../../models/model-interfaces";
|
|||
import {NgForm} from "@angular/forms";
|
||||
import {AwardingService} from "../../services/army-management/awarding.service";
|
||||
import {DecorationService} from "../../services/army-management/decoration.service";
|
||||
import {Fraction} from "../../utils/fraction.enum";
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -25,8 +24,6 @@ export class AwardUserComponent {
|
|||
|
||||
decoPreviewDisplay = 'none';
|
||||
|
||||
readonly fraction = Fraction;
|
||||
|
||||
constructor(private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private awardingService: AwardingService,
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
(change)="toggleRanks()">
|
||||
<option [value]="0">Ohne Fraktion/ Squad</option>
|
||||
<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>
|
||||
</select>
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ import {SquadService} from "../../services/army-management/squad.service";
|
|||
import {RankService} from "../../services/army-management/rank.service";
|
||||
import {Subscription} from "rxjs";
|
||||
import {NgForm} from "@angular/forms";
|
||||
import {Fraction} from "../../utils/fraction.enum";
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -33,8 +32,6 @@ export class EditUserComponent {
|
|||
|
||||
error: string;
|
||||
|
||||
readonly fraction = Fraction;
|
||||
|
||||
constructor(private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private userService: UserService,
|
||||
|
|
|
@ -6,9 +6,8 @@
|
|||
<a>{{user.username}}</a>
|
||||
</span>
|
||||
<br>
|
||||
<small *ngIf="user.squadId && user.squadId.fraction == 'OPFOR'">{{fraction.OPFOR}} - {{user.squadId.name}}</small>
|
||||
<small *ngIf="user.squadId && user.squadId.fraction == 'BLUFOR'">{{fraction.BLUFOR}} - {{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'">NATO - {{user.squadId.name}}</small>
|
||||
<small *ngIf="!user.squadId">ohne Squad/Fraktion</small>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {ChangeDetectionStrategy, Component, EventEmitter} from "@angular/core";
|
||||
import {Router} from "@angular/router";
|
||||
import {User} from "../../models/model-interfaces";
|
||||
import {Fraction} from "../../utils/fraction.enum";
|
||||
|
||||
@Component({
|
||||
selector: 'pjm-user-item',
|
||||
|
@ -19,9 +19,8 @@ export class UserItemComponent {
|
|||
userAward = new EventEmitter();
|
||||
userDelete = new EventEmitter();
|
||||
|
||||
readonly fraction = Fraction;
|
||||
constructor(private router: Router) {
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
select() {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<div class="select-list">
|
||||
<div class="input-group list-header pull-left">
|
||||
<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="OPFOR" uncheckable>{{fraction.OPFOR}}</label>
|
||||
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="BLUFOR" uncheckable>NATO</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>
|
||||
</div>
|
||||
<a class="pull-right btn btn-success" (click)="openNewUserForm()">+</a>
|
||||
|
|
|
@ -7,7 +7,6 @@ import {Observable} from "rxjs/Observable";
|
|||
import {UserService} from "../../services/army-management/user.service";
|
||||
import {User} from "../../models/model-interfaces";
|
||||
import {ADD, LOAD} from "../../services/stores/user.store";
|
||||
import {Fraction} from "../../utils/fraction.enum";
|
||||
|
||||
@Component({
|
||||
selector: 'squad-list',
|
||||
|
@ -31,8 +30,6 @@ export class UserListComponent implements OnInit {
|
|||
offset = 0;
|
||||
|
||||
limit = 20;
|
||||
|
||||
readonly fraction = Fraction;
|
||||
|
||||
constructor(private userService: UserService,
|
||||
private router: Router,
|
||||
|
|
|
@ -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 |
Loading…
Reference in New Issue