2018-07-17 10:07:12 +02:00
|
|
|
<form #form="ngForm" (keydown.enter)="$event.preventDefault()" class="overview">
|
2018-10-04 10:59:15 +02:00
|
|
|
<h3 *ngIf="rank._id">{{'ranks.submit.headline.edit' | translate}}</h3>
|
|
|
|
<h3 *ngIf="!rank._id">{{'ranks.submit.headline.new' | translate}}</h3>
|
2017-05-15 15:32:36 +02:00
|
|
|
|
|
|
|
<div class="form-group">
|
2018-10-04 10:59:15 +02:00
|
|
|
<label for="title">{{'ranks.submit.field.name' | translate}}</label>
|
2017-05-15 15:32:36 +02:00
|
|
|
<input type="text" class="form-control"
|
|
|
|
[(ngModel)]="rank.name"
|
|
|
|
name="title"
|
|
|
|
id="title"
|
|
|
|
required maxlength="50"/>
|
2018-10-04 10:59:15 +02:00
|
|
|
<show-error displayName="{{'ranks.submit.field.name' | translate}}" controlPath="title"></show-error>
|
2017-05-15 15:32:36 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
2018-10-04 10:59:15 +02:00
|
|
|
<label for="fraction">{{'ranks.submit.field.fraction' | translate}}</label>
|
2017-05-15 15:32:36 +02:00
|
|
|
<select id="fraction" name="fraction" class="form-control btn dropdown-toggle"
|
|
|
|
required
|
|
|
|
[(ngModel)]="rank.fraction">
|
2019-08-04 13:16:11 +02:00
|
|
|
<option value="OPFOR">{{fraction.SWORD}}</option>
|
|
|
|
<option value="BLUFOR">{{fraction.ARF}}</option>
|
2017-05-15 15:32:36 +02:00
|
|
|
</select>
|
2018-10-04 10:59:15 +02:00
|
|
|
<show-error displayName="{{'ranks.submit.field.fraction' | translate}}" controlPath="fraction"></show-error>
|
2017-05-15 15:32:36 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
2018-10-04 10:59:15 +02:00
|
|
|
<label for="level">{{'ranks.submit.field.level' | translate}}</label>
|
2017-05-15 15:32:36 +02:00
|
|
|
<input id="level" name="level" type="number" class="form-control btn dropdown-toggle"
|
|
|
|
[(ngModel)]="rank.level">
|
2018-10-04 10:59:15 +02:00
|
|
|
<show-error displayName="{{'ranks.submit.field.level' | translate}}" controlPath="level"></show-error>
|
2017-05-15 15:32:36 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
2018-10-04 10:59:15 +02:00
|
|
|
<label for="logo">{{'ranks.submit.field.image' | translate}}</label>
|
2017-05-15 15:32:36 +02:00
|
|
|
<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">
|
2018-10-04 10:59:15 +02:00
|
|
|
{{'ranks.submit.field.image.error.format' | translate}}
|
2017-05-15 15:32:36 +02:00
|
|
|
</span>
|
|
|
|
|
|
|
|
<img class="preview-image" src="{{imagePreviewSrc}}">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<button id="cancel"
|
|
|
|
(click)="cancel()"
|
|
|
|
class="btn btn-default">
|
2018-10-04 10:59:15 +02:00
|
|
|
{{'ranks.submit.button.cancel' | translate}}
|
2017-05-15 15:32:36 +02:00
|
|
|
</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">
|
2018-10-04 10:59:15 +02:00
|
|
|
{{'ranks.submit.button.submit' | translate}}
|
2017-05-15 15:32:36 +02:00
|
|
|
</button>
|
|
|
|
</form>
|