opt-cc/static/src/app/squads/edit-squad/edit-squad.component.html

67 lines
2.0 KiB
HTML
Raw Normal View History

2017-05-10 11:04:06 +02:00
<form #form="ngForm" class="overview">
<h3 *ngIf="squad._id">Squad editieren</h3>
<h3 *ngIf="!squad._id">Neues Squad hinzufügen</h3>
2017-05-10 11:04:06 +02:00
<div class="form-group">
<label for="title">Name</label>
<input type="text" class="form-control"
[(ngModel)]="squad.name"
name="title"
id="title"
required maxlength="50"/>
<show-error text="Name" path="title"></show-error>
</div>
<div class="form-group">
<label for="fraction">Fraktion</label>
<select id="fraction" name="fraction" class="form-control btn dropdown-toggle"
required
[(ngModel)]="squad.fraction">
2017-11-08 19:35:34 +01:00
<option value="OPFOR">{{fraction.OPFOR}}</option>
<option value="BLUFOR">{{fraction.BLUFOR}}</option>
2017-05-10 11:04:06 +02:00
</select>
<show-error text="Fraktion" path="fraction"></show-error>
</div>
<div class="form-group">
<label for="sort">Sortierung</label>
<input id="sort" name="sort" type="number" class="form-control btn dropdown-toggle"
[(ngModel)]="squad.sortingNumber">
<show-error text="Sortierung" path="sort"></show-error>
</div>
<div class="form-group">
<label for="logo">Logo</label>
<input id="logo" name="logo" class="ui-button form-control" type="file"
#fileInput
2017-05-10 11:04:06 +02:00
accept="image/png"
(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}}">
2017-05-10 11:04:06 +02:00
</div>
<button id="cancel"
(click)="cancel()"
class="btn btn-default">
Abbrechen
</button>
2017-05-10 11:04:06 +02:00
<button id="save"
(click)="saveSquad(fileInput)"
2017-05-10 11:04:06 +02:00
class="btn btn-default"
[disabled]="!form.valid">
Bestätigen
2017-05-10 11:04:06 +02:00
</button>
<span *ngIf="showSuccessLabel"
class="label label-success label-small"
style="margin-left: inherit">
Erfolgreich gespeichert
</span>
2017-05-10 11:04:06 +02:00
</form>