Release v1.9.5 #60

Merged
hardi merged 9 commits from release/v1.9.5 into master 2019-10-01 13:51:03 +02:00
38 changed files with 102 additions and 57 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "opt-cc", "name": "opt-cc",
"version": "1.9.4", "version": "1.9.5",
"author": "Florian Hartwich <hardi@noarch.de>", "author": "Florian Hartwich <hardi@noarch.de>",
"private": true, "private": true,
"scripts": { "scripts": {

View File

@ -6,6 +6,8 @@ A war as used in statistics
+ title: `Battle No.1` (string, required) - the display neme of the war + title: `Battle No.1` (string, required) - the display neme of the war
+ date: `2018-02-24T20:01:25.825Z` (string, required) - war start timestamp + date: `2018-02-24T20:01:25.825Z` (string, required) - war start timestamp
+ endDate: `2018-02-24T22:31:26.855Z` (string, required) - war end timestamp + endDate: `2018-02-24T22:31:26.855Z` (string, required) - war end timestamp
+ fractionMappingBlufor: `BLUFOR` (enum[string], required) - display name mapping for Blufor fraction
+ fractionMappingOpfor: `OPFOR` (enum[string], required) - display name mapping for Opfor fraction
+ ptBlufor: 11 (number, required) - final points fraction Blufor + ptBlufor: 11 (number, required) - final points fraction Blufor
+ ptOpfor: 12 (number, required) - final points fraction Opfor + ptOpfor: 12 (number, required) - final points fraction Opfor
+ playersBlufor: 36 (number, required) - player count of fraction Blufor + playersBlufor: 36 (number, required) - player count of fraction Blufor

View File

@ -10,7 +10,7 @@ const DecorationSchema = new Schema({
}, },
fraction: { fraction: {
type: String, type: String,
enum: ['BLUFOR', 'OPFOR', 'GLOBAL'], enum: ['BLUFOR', 'OPFOR', 'ARF', 'SWORD', 'GLOBAL'],
required: true, required: true,
}, },
description: { description: {

View File

@ -14,6 +14,16 @@ const WarSchema = new Schema({
endDate: { endDate: {
type: Date, type: Date,
}, },
fractionMappingBlufor: {
type: String,
enum: ['BLUFOR', 'OPFOR', 'ARF', 'SWORD'],
default: 'BLUFOR',
},
fractionMappingOpfor: {
type: String,
enum: ['BLUFOR', 'OPFOR', 'ARF', 'SWORD'],
default: 'OPFOR',
},
ptBlufor: { ptBlufor: {
type: Number, type: Number,
get: (v) => Math.round(v), get: (v) => Math.round(v),

View File

@ -37,7 +37,11 @@ decorationRouter.route('/')
.get((req, res, next) => { .get((req, res, next) => {
const filter = {}; const filter = {};
if (req.query.fractFilter) { if (req.query.fractFilter) {
filter.fraction = req.query.fractFilter.toUpperCase(); filter.fraction = {
'$in': req.query.fractFilter
.toUpperCase()
.split(','),
};
} }
if (req.query.q) { if (req.query.q) {
filter.name = {$regex: req.query.q, $options: 'i'}; filter.name = {$regex: req.query.q, $options: 'i'};

View File

@ -168,7 +168,6 @@ users.route('/:id')
res.locals.items = item; res.locals.items = item;
} else { } else {
err.status = codes.wrongrequest; err.status = codes.wrongrequest;
console.log(err);
err.message += ' in fields: ' + Object.getOwnPropertyNames(err.errors); err.message += ' in fields: ' + Object.getOwnPropertyNames(err.errors);
} }

View File

@ -19,8 +19,7 @@ const {exec} = require('child_process');
// cluster mode // cluster mode
const cluster = require('cluster'); const cluster = require('cluster');
const envWorkerNum = process.env.NODE_WORKER_COUNT; const envWorkerNum = process.env.NODE_WORKER_COUNT;
const cpuCount = require('os').cpus().length; const numWorkers = (envWorkerNum) ? envWorkerNum : 2;
const numWorkers = (envWorkerNum) ? envWorkerNum : cpuCount;
// own modules // own modules
const config = require('./config/config'); const config = require('./config/config');

View File

@ -72,7 +72,7 @@ const parseWarLog = (lineArray, war) => {
'Qilin (Unbewaffnet)', 'Qilin (Bewaffnet)', 'Ifrit', 'Qilin (Unbewaffnet)', 'Qilin (Bewaffnet)', 'Ifrit',
'Tempest-Transporter', 'Tempest-Transporter (abgedeckt)', 'Tempest Sanitätsfahrzeug', 'Tempest-Transporter', 'Tempest-Transporter (abgedeckt)', 'Tempest Sanitätsfahrzeug',
'Remote Designator [CSAT]', 'UBF Saif', 'Remote Designator [CSAT]', 'UBF Saif',
'Quad Bike', 'HuntIR', 'Quad Bike', 'HuntIR', 'Offroad',
]; ];
const addPlayerIfNotExists = (inputPlayer, steamUUID) => { const addPlayerIfNotExists = (inputPlayer, steamUUID) => {

View File

@ -23,7 +23,7 @@
[(ngModel)]="appUserSquadId"> [(ngModel)]="appUserSquadId">
<option [value]="null">{{'user.submit.field.squad.not.assigned' | translate}}</option> <option [value]="null">{{'user.submit.field.squad.not.assigned' | translate}}</option>
<option *ngFor="let squad of squads" [ngValue]="squad._id"> <option *ngFor="let squad of squads" [ngValue]="squad._id">
{{squad.fraction == 'BLUFOR'? fraction.BLUFOR : fraction.OPFOR}}: {{squad.name}} {{squad.fraction == 'BLUFOR'? fraction.ARF : fraction.SWORD}}: {{squad.name}}
</option> </option>
</select> </select>
<show-error displayName="{{'user.submit.field.squad' | translate}}" controlPath="squad"></show-error> <show-error displayName="{{'user.submit.field.squad' | translate}}" controlPath="squad"></show-error>

View File

@ -6,8 +6,8 @@
<a>{{appUser.username}}</a> <a>{{appUser.username}}</a>
</span> </span>
<br> <br>
<small *ngIf="appUser.squad && appUser.squad.fraction == 'OPFOR'">{{fraction.OPFOR}} - {{appUser.squad.name}}</small> <small *ngIf="appUser.squad && appUser.squad.fraction == 'OPFOR'">{{fraction.SWORD}} - {{appUser.squad.name}}</small>
<small *ngIf="appUser.squad && appUser.squad.fraction == 'BLUFOR'">{{fraction.BLUFOR}} - {{appUser.squad.name}}</small> <small *ngIf="appUser.squad && appUser.squad.fraction == 'BLUFOR'">{{fraction.ARF}} - {{appUser.squad.name}}</small>
<small *ngIf="!appUser.squad">{{'users.list.item.label.no.squad' | translate}}</small> <small *ngIf="!appUser.squad">{{'users.list.item.label.no.squad' | translate}}</small>
</div> </div>

View File

@ -8,7 +8,7 @@
</div> </div>
<h3 class="text-center" style="font-weight: 600" <h3 class="text-center" style="font-weight: 600"
[style.color]="user.squadId?.fraction === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR"> [style.color]="user.squadId?.fraction === 'BLUFOR' ? fraction.COLOR_ARF : fraction.COLOR_SWORD">
{{'public.army.member.headline' | translate:{name: user.username} }} {{'public.army.member.headline' | translate:{name: user.username} }}
</h3> </h3>

View File

@ -7,7 +7,7 @@
</div> </div>
<div class=" middle-row"> <div class=" middle-row">
<div class="name-cell"> <div class="name-cell">
<div [style.color]="squadFraction === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR" <div [style.color]="squadFraction === 'BLUFOR' ? fraction.COLOR_ARF : fraction.COLOR_SWORD"
*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)">

View File

@ -2,8 +2,8 @@
<h1>{{'public.army.headline' | translate}}</h1> <h1>{{'public.army.headline' | translate}}</h1>
<div class="pull-left army-column" *ngIf="!isSmallLayout || singleViewSelected === fraction.BLUFOR"> <div class="pull-left army-column" *ngIf="!isSmallLayout || singleViewSelected === fraction.BLUFOR">
<h3 class="army-head" [style.color]="fraction.COLOR_BLUFOR"> <h3 class="army-head" [style.color]="fraction.COLOR_ARF">
{{fraction.BLUFOR}} {{fraction.ARF}}
<button mat-icon-button class="switch-btn-blufor" <button mat-icon-button class="switch-btn-blufor"
(click)="singleViewSwitch(fraction.OPFOR)"> (click)="singleViewSwitch(fraction.OPFOR)">
<mat-icon svgIcon="chevron-right"></mat-icon> <mat-icon svgIcon="chevron-right"></mat-icon>
@ -18,12 +18,12 @@
</div> </div>
<div class="pull-right army-column" *ngIf="!isSmallLayout || singleViewSelected === fraction.OPFOR"> <div class="pull-right army-column" *ngIf="!isSmallLayout || singleViewSelected === fraction.OPFOR">
<h3 class="army-head" [style.color]="fraction.COLOR_OPFOR"> <h3 class="army-head" [style.color]="fraction.COLOR_SWORD">
<button mat-icon-button class="switch-btn-opfor" <button mat-icon-button class="switch-btn-opfor"
(click)="singleViewSwitch(fraction.BLUFOR)"> (click)="singleViewSwitch(fraction.BLUFOR)">
<mat-icon svgIcon="chevron-right"></mat-icon> <mat-icon svgIcon="chevron-right"></mat-icon>
</button> </button>
{{fraction.OPFOR}} {{fraction.SWORD}}
</h3> </h3>
<cc-army-squad *ngFor="let squad of army[1].squads" <cc-army-squad *ngFor="let squad of army[1].squads"
[squad]="squad" [squad]="squad"

View File

@ -6,6 +6,8 @@
<a>{{decoration.name}}</a> <a>{{decoration.name}}</a>
</span> </span>
<br> <br>
<small *ngIf="decoration.fraction == 'ARF'">{{fraction.ARF}}</small>
<small *ngIf="decoration.fraction == 'SWORD'">{{fraction.SWORD}}</small>
<small *ngIf="decoration.fraction == 'OPFOR'">{{fraction.OPFOR}}</small> <small *ngIf="decoration.fraction == 'OPFOR'">{{fraction.OPFOR}}</small>
<small *ngIf="decoration.fraction == 'BLUFOR'">{{fraction.BLUFOR}}</small> <small *ngIf="decoration.fraction == 'BLUFOR'">{{fraction.BLUFOR}}</small>
<small *ngIf="decoration.fraction == 'GLOBAL'">{{'decorations.list.filter.global' | translate}}</small> <small *ngIf="decoration.fraction == 'GLOBAL'">{{'decorations.list.filter.global' | translate}}</small>

View File

@ -1,6 +1,8 @@
<div class="select-list"> <div class="select-list">
<cc-list-filter <cc-list-filter
[filterButtons]="[{label: fraction.BLUFOR, value: 'BLUFOR'}, [filterButtons]="[{label: fraction.ARF, value: 'ARF'},
{label: fraction.SWORD, value: 'SWORD'},
{label: fraction.BLUFOR, value: 'BLUFOR'},
{label: fraction.OPFOR, value: 'OPFOR'}, {label: fraction.OPFOR, value: 'OPFOR'},
{label: 'decorations.list.filter.global', value: 'GLOBAL'}]" {label: 'decorations.list.filter.global', value: 'GLOBAL'}]"
[addButton]="{svgIcon: 'add', tooltip: 'decorations.list.button.add'}" [addButton]="{svgIcon: 'add', tooltip: 'decorations.list.button.add'}"

View File

@ -17,8 +17,10 @@
<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="{{fraction.ARF}}">{{fraction.ARF}}</option>
<option value="BLUFOR">{{fraction.BLUFOR}}</option> <option value="{{fraction.SWORD}}">{{fraction.SWORD}}</option>
<option value="{{fraction.OPFOR}}">{{fraction.OPFOR}}</option>
<option value="{{fraction.BLUFOR}}">{{fraction.BLUFOR}}</option>
<option value="GLOBAL">{{'decorations.submit.field.fraction.global' | translate}}</option> <option value="GLOBAL">{{'decorations.submit.field.fraction.global' | translate}}</option>
</select> </select>
<show-error displayName="{{'decorations.submit.field.fraction' | translate}}" controlPath="fraction"></show-error> <show-error displayName="{{'decorations.submit.field.fraction' | translate}}" controlPath="fraction"></show-error>

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)]="rank.fraction"> [(ngModel)]="rank.fraction">
<option value="OPFOR">{{fraction.OPFOR}}</option> <option value="OPFOR">{{fraction.SWORD}}</option>
<option value="BLUFOR">{{fraction.BLUFOR}}</option> <option value="BLUFOR">{{fraction.ARF}}</option>
</select> </select>
<show-error displayName="{{'ranks.submit.field.fraction' | translate}}" controlPath="fraction"></show-error> <show-error displayName="{{'ranks.submit.field.fraction' | translate}}" controlPath="fraction"></show-error>
</div> </div>

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'">{{fraction.SWORD}}</small>
<small *ngIf="rank.fraction == 'BLUFOR'">{{fraction.BLUFOR}}</small> <small *ngIf="rank.fraction == 'BLUFOR'">{{fraction.ARF}}</small>
<small> {{'ranks.list.item.label.level' | translate:{level: rank.level} }}</small> <small> {{'ranks.list.item.label.level' | translate:{level: rank.level} }}</small>
</div> </div>

View File

@ -1,7 +1,7 @@
<div class="select-list"> <div class="select-list">
<cc-list-filter <cc-list-filter
[filterButtons]="[{label: fraction.BLUFOR, value: 'BLUFOR'}, [filterButtons]="[{label: fraction.ARF, value: 'BLUFOR'},
{label: fraction.OPFOR, value: 'OPFOR'}]" {label: fraction.SWORD, value: 'OPFOR'}]"
[addButton]="{svgIcon: 'add', tooltip: 'ranks.list.button.add'}" [addButton]="{svgIcon: 'add', tooltip: 'ranks.list.button.add'}"
(executeSearch)="filterRanks($event)" (executeSearch)="filterRanks($event)"
(openAddFrom)="openNewRankForm()"> (openAddFrom)="openNewRankForm()">

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)]="squad.fraction"> [(ngModel)]="squad.fraction">
<option value="OPFOR">{{fraction.OPFOR}}</option> <option value="OPFOR">{{fraction.SWORD}}</option>
<option value="BLUFOR">{{fraction.BLUFOR}}</option> <option value="BLUFOR">{{fraction.ARF}}</option>
</select> </select>
<show-error displayName="{{'squad.submit.field.fraction' | translate}}" controlPath="fraction"></show-error> <show-error displayName="{{'squad.submit.field.fraction' | translate}}" controlPath="fraction"></show-error>
</div> </div>

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'">{{fraction.ARF}}</small>
<small *ngIf="squad.fraction == 'BLUFOR'">{{fraction.BLUFOR}}</small> <small *ngIf="squad.fraction == 'BLUFOR'">{{fraction.SWORD}}</small>
</div> </div>
<div class="col-xs-4"> <div class="col-xs-4">

View File

@ -1,7 +1,7 @@
<div class="select-list"> <div class="select-list">
<cc-list-filter <cc-list-filter
[filterButtons]="[{label: fraction.BLUFOR, value: 'BLUFOR'}, [filterButtons]="[{label: fraction.ARF, value: 'BLUFOR'},
{label: fraction.OPFOR, value: 'OPFOR'}]" {label: fraction.SWORD, value: 'OPFOR'}]"
[addButton]="{svgIcon: 'add', tooltip: 'squad.list.tooltip.new'}" [addButton]="{svgIcon: 'add', tooltip: 'squad.list.tooltip.new'}"
(executeSearch)="filterSquads($event)" (executeSearch)="filterSquads($event)"
(openAddFrom)="openNewSquadForm()"> (openAddFrom)="openNewSquadForm()">

View File

@ -13,7 +13,8 @@
style="min-width: 200px;"> style="min-width: 200px;">
<option [value]="0">{{'users.award.field.decoration.placeholder' | translate}}</option> <option [value]="0">{{'users.award.field.decoration.placeholder' | translate}}</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' ? fraction.BLUFOR : deco.fraction == 'OPFOR' ? fraction.OPFOR : deco.fraction ==
'ARF' ? fraction.ARF : deco.fraction == 'SWORD' ? fraction.SWORD : 'Global'}}:
{{deco.name}} {{deco.name}}
</option> </option>
</select> </select>

View File

@ -23,7 +23,7 @@
(change)="toggleRanks()"> (change)="toggleRanks()">
<option [value]="0">{{'user.submit.field.squad.not.assigned' | translate}}</option> <option [value]="0">{{'user.submit.field.squad.not.assigned' | translate}}</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'? fraction.ARF : fraction.SWORD}}: {{squad.name}}
</option> </option>
</select> </select>
<show-error displayName="{{'user.submit.field.squad' | translate}}" controlPath="squad"></show-error> <show-error displayName="{{'user.submit.field.squad' | translate}}" controlPath="squad"></show-error>

View File

@ -6,8 +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'">{{fraction.SWORD}} - {{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'">{{fraction.ARF}} - {{user.squadId.name}}
</small> </small>
<small *ngIf="!user.squadId">{{'users.list.item.label.no.squad' | translate}}</small> <small *ngIf="!user.squadId">{{'users.list.item.label.no.squad' | translate}}</small>
</div> </div>

View File

@ -1,7 +1,7 @@
<div class="select-list"> <div class="select-list">
<cc-list-filter <cc-list-filter
[filterButtons]="[{label: fraction.BLUFOR, value: 'BLUFOR'}, [filterButtons]="[{label: fraction.ARF, value: 'BLUFOR'},
{label: fraction.OPFOR, value: 'OPFOR'}, {label: fraction.SWORD, value: 'OPFOR'},
{label: 'users.list.filter.no.squad', value: 'UNASSIGNED'}]" {label: 'users.list.filter.no.squad', value: 'UNASSIGNED'}]"
[addButton]="{svgIcon: 'add-user', tooltip: 'users.list.tooltip.new'}" [addButton]="{svgIcon: 'add-user', tooltip: 'users.list.tooltip.new'}"
(executeSearch)="filterUsers(undefined, $event)" (executeSearch)="filterUsers(undefined, $event)"

View File

@ -2,6 +2,8 @@
<h1>{{'public.decorations.headline' | translate}}</h1> <h1>{{'public.decorations.headline' | translate}}</h1>
<div class="fraction-side-bar"> <div class="fraction-side-bar">
<div [ngClass]="{active: active === 'ARF'}" (click)="switchFraction('ARF')">{{fraction.ARF}}</div>
<div [ngClass]="{active: active === 'SWORD'}" (click)="switchFraction('SWORD')">{{fraction.SWORD}}</div>
<div [ngClass]="{active: active === 'BLUFOR'}" (click)="switchFraction('BLUFOR')">{{fraction.BLUFOR}}</div> <div [ngClass]="{active: active === 'BLUFOR'}" (click)="switchFraction('BLUFOR')">{{fraction.BLUFOR}}</div>
<div [ngClass]="{active: active === 'OPFOR'}" (click)="switchFraction('OPFOR')">{{fraction.OPFOR}}</div> <div [ngClass]="{active: active === 'OPFOR'}" (click)="switchFraction('OPFOR')">{{fraction.OPFOR}}</div>
<div [ngClass]="{active: active === 'GLOBAL'}" (click)="switchFraction('GLOBAL')">GLOBAL</div> <div [ngClass]="{active: active === 'GLOBAL'}" (click)="switchFraction('GLOBAL')">GLOBAL</div>

View File

@ -45,10 +45,11 @@ export class DecorationOverviewComponent implements OnInit, OnDestroy {
} }
const fract = queryParams.fraction; const fract = queryParams.fraction;
if (fract && (fract === 'BLUFOR' || fract === 'OPFOR' || fract === 'GLOBAL')) { if (fract && (fract === 'ARF' || fract === 'SWORD' ||
fract === 'BLUFOR' || fract === 'OPFOR' || fract === 'GLOBAL')) {
this.switchFraction(queryParams.fraction); this.switchFraction(queryParams.fraction);
} else { } else {
this.switchFraction('BLUFOR'); this.switchFraction('ARF');
} }
}); });
}; };

View File

@ -5,8 +5,7 @@
[class]="decoration.isMedal ? 'img-medal' : 'img-ribbon'"> [class]="decoration.isMedal ? 'img-medal' : 'img-ribbon'">
</div> </div>
<mat-card-content> <mat-card-content>
<div [style.background]="decoration.fraction === 'BLUFOR' ? <div [style.background]="getColor(decoration.fraction)">
fraction.COLOR_BLUFOR : decoration.fraction === 'OPFOR' ? fraction.COLOR_OPFOR : '#666666'">
{{decoration.name}} {{decoration.name}}
</div> </div>
<div class="decoration-description"> <div class="decoration-description">

View File

@ -17,6 +17,21 @@ export class DecorationPanelComponent {
readonly fraction = Fraction; readonly fraction = Fraction;
getColor(fractionKey) {
switch (fractionKey) {
case 'ARF':
return this.fraction.COLOR_ARF;
case 'SWORD':
return this.fraction.COLOR_SWORD;
case 'BLUFOR':
return this.fraction.COLOR_BLUFOR;
case 'OPFOR':
return this.fraction.COLOR_OPFOR;
default:
return this.fraction.COLOR_NEUTRAL;
}
}
selectDecoration() { selectDecoration() {
this.select.emit(this.decoration); this.select.emit(this.decoration);
} }

View File

@ -2,7 +2,7 @@
<h1>{{'public.ranks.headline' | translate}}</h1> <h1>{{'public.ranks.headline' | translate}}</h1>
<div class="column-container pull-left"> <div class="column-container pull-left">
<h3 [style.color]="fraction.COLOR_BLUFOR">{{fraction.BLUFOR}}</h3> <h3 [style.color]="fraction.COLOR_ARF">{{fraction.ARF}}</h3>
<table mat-table [dataSource]="ranksBlufor" class="mat-elevation-z8"> <table mat-table [dataSource]="ranksBlufor" class="mat-elevation-z8">
@ -19,7 +19,7 @@
</div> </div>
<div class="column-container pull-right"> <div class="column-container pull-right">
<h3 [style.color]="fraction.COLOR_OPFOR">{{fraction.OPFOR}}</h3> <h3 [style.color]="fraction.COLOR_SWORD">{{fraction.SWORD}}</h3>
<table mat-table [dataSource]="ranksOpfor" class="pull-right mat-elevation-z8"> <table mat-table [dataSource]="ranksOpfor" class="pull-right mat-elevation-z8">

View File

@ -13,8 +13,6 @@ export class RankPanelComponent {
@Output() select = new EventEmitter(); @Output() select = new EventEmitter();
readonly fraction = Fraction;
selectRank() { selectRank() {
this.select.emit(this.rank); this.select.emit(this.rank);
} }

View File

@ -24,8 +24,8 @@
<span mat-line> <span mat-line>
{{user.username}} {{user.username}}
</span> </span>
<span mat-line [style.color]="user.squadId.fraction === 'BLUFOR' ? fraction.COLOR_BLUFOR :fraction.COLOR_OPFOR"> <span mat-line [style.color]="user.squadId.fraction === 'BLUFOR' ? fraction.COLOR_ARF :fraction.COLOR_SWORD">
{{user.squadId.fraction === 'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}} - {{user.squadId.name}} {{user.squadId.fraction === 'BLUFOR' ? fraction.ARF : fraction.SWORD}} - {{user.squadId.name}}
</span> </span>
</a> </a>
</mat-nav-list> </mat-nav-list>

View File

@ -35,12 +35,10 @@
</div> </div>
<div class="div-table-row" [style.display]="decoPreviewDisplay" style="margin-top: 5px; margin-bottom:10px"> <div class="div-table-row" [style.display]="decoPreviewDisplay" style="margin-top: 5px; margin-bottom:10px">
<div class="col-sm-1 decoration-preview"> <div class="decoration-preview">
<img class="center-block" #decoPreview> <img class="center-block" #decoPreview>
</div> </div>
<div class="col-sm-2" <div style="border-radius: 0px 15px 15px 0px; font-style: oblique; padding: 0 10px" #decoDescription>
style="border-radius: 0px 15px 15px 0px; font-style: oblique" #decoDescription>
&nbsp;
</div> </div>
</div> </div>

View File

@ -7,6 +7,7 @@ import {DecorationService} from '../../services/army-management/decoration.servi
import {UserService} from '../../services/army-management/user.service'; import {UserService} from '../../services/army-management/user.service';
import {LoginService} from '../../services/app-user-service/login-service'; import {LoginService} from '../../services/app-user-service/login-service';
import {SnackBarService} from '../../services/user-interface/snack-bar/snack-bar.service'; import {SnackBarService} from '../../services/user-interface/snack-bar/snack-bar.service';
import {Fraction} from '../../utils/fraction.enum';
@Component({ @Component({
@ -47,7 +48,13 @@ export class RequestAwardComponent implements OnInit {
this.userService.findUsers({squadId: currentUser.squad._id}).subscribe(users => { this.userService.findUsers({squadId: currentUser.squad._id}).subscribe(users => {
this.users = users; this.users = users;
}); });
this.decorationService.findDecorations('', currentUser.squad.fraction).subscribe(decorations => {
const selectableFractions = [
(currentUser.squad.fraction === Fraction.BLUFOR) ? Fraction.ARF : Fraction.SWORD,
currentUser.squad.fraction
];
this.decorationService.findDecorations('', selectableFractions).subscribe(decorations => {
this.decorations = decorations; this.decorations = decorations;
}); });
} }

View File

@ -16,8 +16,7 @@
<ng-container matColumnDef="{{tableHead[1].prop}}"> <ng-container matColumnDef="{{tableHead[1].prop}}">
<mat-header-cell *matHeaderCellDef <mat-header-cell *matHeaderCellDef
mat-sort-header="{{tableHead[1].prop}}">{{tableHead[1].head | translate}}</mat-header-cell> mat-sort-header="{{tableHead[1].prop}}">{{tableHead[1].head | translate}}</mat-header-cell>
<mat-cell *matCellDef="let element">{{element.fraction === <mat-cell *matCellDef="let element">{{element.fraction === 'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}}</mat-cell>
'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}}</mat-cell>
</ng-container> </ng-container>
<ng-container *ngFor="let column of tableHead.slice(2, tableHead.length)" matColumnDef="{{column.prop}}"> <ng-container *ngFor="let column of tableHead.slice(2, tableHead.length)" matColumnDef="{{column.prop}}">

View File

@ -1,4 +1,8 @@
export enum Fraction { export enum Fraction {
ARF = 'ARF',
COLOR_ARF = '#336699',
SWORD = 'SWORD',
COLOR_SWORD = '#8b8b8b',
BLUFOR = 'NATO', BLUFOR = 'NATO',
OPFOR = 'CSAT', OPFOR = 'CSAT',
COLOR_BLUFOR = '#3c5fa1', COLOR_BLUFOR = '#3c5fa1',
@ -8,5 +12,6 @@ export enum Fraction {
COLOR_OPFOR = '#a90100', COLOR_OPFOR = '#a90100',
COLOR_OPFOR_DARK = '#890F0F', COLOR_OPFOR_DARK = '#890F0F',
COLOR_OPFOR_LIGHT = '#fb5555', COLOR_OPFOR_LIGHT = '#fb5555',
COLOR_OPFOR_GREY = '#955c5f' COLOR_OPFOR_GREY = '#955c5f',
COLOR_NEUTRAL = '#222222',
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 809 KiB

After

Width:  |  Height:  |  Size: 832 KiB