Use fraction enum in users module
parent
5f6be06516
commit
de9504a6f3
|
@ -13,7 +13,8 @@
|
|||
style="min-width: 200px;">
|
||||
<option [value]="0">Auswählen...</option>
|
||||
<option *ngFor="let deco of decorations" [value]="deco._id">
|
||||
{{deco.fraction == 'BLUFOR'? 'NATO' : deco.fraction == 'OPFOR'? 'CSAT' : 'Global'}}: {{deco.name}}
|
||||
{{deco.fraction == 'BLUFOR'? fraction.BLUFOR : deco.fraction == 'OPFOR'? fraction.OPFOR : 'Global'}}:
|
||||
{{deco.name}}
|
||||
</option>
|
||||
</select>
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ 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({
|
||||
|
@ -24,6 +25,8 @@ 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'? 'NATO' : 'CSAT'}}: {{squad.name}}
|
||||
{{squad.fraction == 'BLUFOR'? fraction.BLUFOR : fraction.OPFOR}}: {{squad.name}}
|
||||
</option>
|
||||
</select>
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ 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({
|
||||
|
@ -32,6 +33,8 @@ export class EditUserComponent {
|
|||
|
||||
error: string;
|
||||
|
||||
readonly fraction = Fraction;
|
||||
|
||||
constructor(private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private userService: UserService,
|
||||
|
|
|
@ -6,8 +6,9 @@
|
|||
<a>{{user.username}}</a>
|
||||
</span>
|
||||
<br>
|
||||
<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 && 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">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,8 +19,9 @@ export class UserItemComponent {
|
|||
userAward = new EventEmitter();
|
||||
userDelete = new EventEmitter();
|
||||
|
||||
constructor(private router: Router) {
|
||||
readonly fraction = Fraction;
|
||||
|
||||
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>NATO</label>
|
||||
<label class="btn btn-success" [(ngModel)]="radioModel" btnRadio="OPFOR" uncheckable>CSAT</label>
|
||||
<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="UNASSIGNED" uncheckable>Ohne Squad</label>
|
||||
</div>
|
||||
<a class="pull-right btn btn-success" (click)="openNewUserForm()">+</a>
|
||||
|
|
|
@ -7,6 +7,7 @@ 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',
|
||||
|
@ -30,6 +31,8 @@ export class UserListComponent implements OnInit {
|
|||
offset = 0;
|
||||
|
||||
limit = 20;
|
||||
|
||||
readonly fraction = Fraction;
|
||||
|
||||
constructor(private userService: UserService,
|
||||
private router: Router,
|
||||
|
|
Loading…
Reference in New Issue