2017-05-13 14:57:40 +02:00
|
|
|
<form #form="ngForm" class="overview">
|
2017-05-14 16:35:44 +02:00
|
|
|
<h3 *ngIf="user._id">Teilnehmer editieren</h3>
|
|
|
|
<h3 *ngIf="!user._id">Neuen Teilnehmer hinzufügen</h3>
|
2017-05-13 14:57:40 +02:00
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="title">Name</label>
|
2017-07-29 11:23:37 +02:00
|
|
|
<input class="form-control"
|
2017-05-13 14:57:40 +02:00
|
|
|
[(ngModel)]="user.username"
|
|
|
|
name="title"
|
|
|
|
id="title"
|
2017-05-13 23:49:17 +02:00
|
|
|
required
|
|
|
|
maxlength="50"/>
|
2017-05-13 14:57:40 +02:00
|
|
|
|
|
|
|
<show-error text="Name" path="title"></show-error>
|
|
|
|
</div>
|
2017-05-10 11:04:06 +02:00
|
|
|
|
2017-05-13 14:57:40 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="squad">Squad</label>
|
|
|
|
<select class="form-control"
|
|
|
|
name="squad"
|
|
|
|
id="squad"
|
2017-10-14 15:26:05 +02:00
|
|
|
[(ngModel)]="user.squadId"
|
2017-05-13 14:57:40 +02:00
|
|
|
[compareWith]="equals"
|
|
|
|
(change)="toggleRanks()">
|
|
|
|
<option [value]="0">Ohne Fraktion/ Squad</option>
|
|
|
|
<option *ngFor="let squad of squads" [ngValue]="squad">
|
|
|
|
{{squad.fraction == 'BLUFOR'? 'NATO' : 'CSAT'}}: {{squad.name}}
|
|
|
|
</option>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<show-error text="Squad" path="squad"></show-error>
|
|
|
|
</div>
|
2017-05-10 11:04:06 +02:00
|
|
|
|
2017-05-13 14:57:40 +02:00
|
|
|
<div class="form-group" [style.display]="ranksDisplay">
|
|
|
|
<label for="rank">Rang</label>
|
|
|
|
<select class="form-control"
|
|
|
|
name="rank"
|
2017-10-14 15:26:05 +02:00
|
|
|
id="rank" [ngModel]="user.rankLvl"
|
2017-05-13 14:57:40 +02:00
|
|
|
#rankLevel
|
|
|
|
style="min-width: 200px;">
|
|
|
|
<option *ngFor="let rank of ranks" [value]="rank.level">{{rank.name}}</option>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<show-error text="Squad" path="squad"></show-error>
|
2017-05-10 11:04:06 +02:00
|
|
|
</div>
|
2017-05-13 14:57:40 +02:00
|
|
|
|
|
|
|
<button id="cancel"
|
|
|
|
(click)="cancel()"
|
|
|
|
class="btn btn-default">
|
|
|
|
Abbrechen
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<button id="save"
|
|
|
|
(click)="saveUser(rankLevel.value)"
|
|
|
|
class="btn btn-default"
|
|
|
|
[disabled]="!form.valid">
|
|
|
|
Bestätigen
|
|
|
|
</button>
|
2017-05-13 23:49:17 +02:00
|
|
|
|
2017-09-15 21:02:43 +02:00
|
|
|
<span *ngIf="showErrorLabel"
|
|
|
|
class="center-block label label-danger" style="font-size: medium; padding: 2px; margin-top: 2px">
|
|
|
|
{{error}}
|
|
|
|
</span>
|
|
|
|
|
2017-05-13 23:49:17 +02:00
|
|
|
<span *ngIf="showSuccessLabel"
|
|
|
|
class="label label-success label-small"
|
|
|
|
style="margin-left: inherit">
|
2017-09-15 21:02:43 +02:00
|
|
|
Erfolgreich gespeichert
|
2017-05-13 23:49:17 +02:00
|
|
|
</span>
|
|
|
|
|
2017-05-13 14:57:40 +02:00
|
|
|
</form>
|