mirror of
https://github.com/TomasiDeveloping/PlayerManagement.git
synced 2026-04-16 09:12:20 +00:00
69 lines
2.8 KiB
HTML
69 lines
2.8 KiB
HTML
@if (userForm) {
|
|
<div class="modal-header" xmlns="http://www.w3.org/1999/html">
|
|
<h4 class="modal-title">Update User</h4>
|
|
<button type="button" class="btn-close" aria-label="Close" (click)="activeModal.dismiss()"></button>
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
<form [formGroup]="userForm">
|
|
<div class="form-floating mb-3 is-invalid">
|
|
<input [ngClass]="{
|
|
'is-invalid': f['playerName'].invalid && (f['playerName'].dirty || !f['playerName'].untouched),
|
|
'is-valid': f['playerName'].valid}"
|
|
type="text" maxlength="251" class="form-control" id="playerName" placeholder="Player" formControlName="playerName">
|
|
<label for="playerName">Player name</label>
|
|
@if (f['playerName'].invalid && (f['playerName'].dirty || !f['playerName'].untouched)) {
|
|
<div class="invalid-feedback">
|
|
@if (f['playerName'].hasError('required')) {
|
|
<p>Player name is required</p>
|
|
}
|
|
@if (f['playerName'].hasError('maxlength')) {
|
|
<p>Maximum 250 characters allowed</p>
|
|
}
|
|
</div>
|
|
}
|
|
</div>
|
|
<div class="form-floating mb-3 is-invalid">
|
|
<input [ngClass]="{
|
|
'is-invalid': f['email'].invalid && (f['email'].dirty || !f['email'].untouched),
|
|
'is-valid': f['email'].valid}"
|
|
type="email" class="form-control" id="email" placeholder="email" formControlName="email">
|
|
<label for="email">Email</label>
|
|
@if (f['email'].invalid && (f['email'].dirty || !f['email'].untouched)) {
|
|
<div class="invalid-feedback">
|
|
@if (f['email'].hasError('required')) {
|
|
<p>Email is required</p>
|
|
}
|
|
@if (f['email'].hasError('email')) {
|
|
<p>Invalid email</p>
|
|
}
|
|
</div>
|
|
}
|
|
</div>
|
|
<div class="form-floating mb-3 is-invalid">
|
|
<select [ngClass]="{
|
|
'is-invalid': f['role'].invalid && (f['role'].dirty || !f['level'].untouched),
|
|
'is-valid': f['role'].valid}" class="form-select" id="role" formControlName="role">
|
|
@for (role of roles; track role) {
|
|
<option [ngValue]="role">{{role}}</option>
|
|
}
|
|
</select>
|
|
<label for="role">Role</label>
|
|
@if (f['role'].invalid && (f['role'].dirty || !f['role'].untouched)) {
|
|
<div class="invalid-feedback">
|
|
@if (f['role'].hasError('required')) {
|
|
<p>Role is required</p>
|
|
}
|
|
</div>
|
|
}
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-warning" (click)="activeModal.dismiss()">Close</button>
|
|
<button [disabled]="userForm.invalid" (click)="onSubmit()" type="submit" class=" btn btn-success">Update User</button>
|
|
</div>
|
|
}
|