2018-07-17 10:07:12 +02:00
|
|
|
<form #form="ngForm" (keydown.enter)="$event.preventDefault()" class="overview">
|
2017-05-15 15:32:36 +02:00
|
|
|
<h3 *ngIf="rank._id">Rang editieren</h3>
|
|
|
|
<h3 *ngIf="!rank._id">Neuen Rang hinzufügen</h3>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="title">Name</label>
|
|
|
|
<input type="text" class="form-control"
|
|
|
|
[(ngModel)]="rank.name"
|
|
|
|
name="title"
|
|
|
|
id="title"
|
|
|
|
required maxlength="50"/>
|
|
|
|
|
2018-03-08 10:17:10 +01:00
|
|
|
<show-error displayName="Name" controlPath="title"></show-error>
|
2017-05-15 15:32:36 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="fraction">Fraktion</label>
|
|
|
|
<select id="fraction" name="fraction" class="form-control btn dropdown-toggle"
|
|
|
|
required
|
|
|
|
[(ngModel)]="rank.fraction">
|
2017-11-08 19:27:24 +01:00
|
|
|
<option value="OPFOR">{{fraction.OPFOR}}</option>
|
|
|
|
<option value="BLUFOR">{{fraction.BLUFOR}}</option>
|
2017-05-15 15:32:36 +02:00
|
|
|
</select>
|
2018-03-08 10:17:10 +01:00
|
|
|
<show-error displayName="Fraktion" controlPath="fraction"></show-error>
|
2017-05-15 15:32:36 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="level">Stufe</label>
|
|
|
|
<input id="level" name="level" type="number" class="form-control btn dropdown-toggle"
|
|
|
|
[(ngModel)]="rank.level">
|
2018-03-08 10:17:10 +01:00
|
|
|
<show-error displayName="Stufe" controlPath="level"></show-error>
|
2017-05-15 15:32:36 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="logo">Bild</label>
|
|
|
|
<input id="logo" name="logo" class="ui-button form-control" type="file"
|
|
|
|
accept="image/png"
|
|
|
|
#fileInput
|
|
|
|
(change)="fileChange($event)">
|
|
|
|
<span class="label label-bg label-danger center-block" style="font-size:small" *ngIf="showImageError">
|
|
|
|
Bild muss im PNG Format vorliegen
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<img class="preview-image" src="{{imagePreviewSrc}}">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<button id="cancel"
|
|
|
|
(click)="cancel()"
|
|
|
|
class="btn btn-default">
|
|
|
|
Abbrechen
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<button id="save"
|
2018-07-17 10:07:12 +02:00
|
|
|
type="submit"
|
2017-05-15 15:32:36 +02:00
|
|
|
(click)="saveRank(fileInput)"
|
|
|
|
class="btn btn-default"
|
|
|
|
[disabled]="!form.valid">
|
2017-05-15 21:53:56 +02:00
|
|
|
Bestätigen
|
2017-05-15 15:32:36 +02:00
|
|
|
</button>
|
|
|
|
</form>
|