2024-11-26 08:48:07 +01:00
|
|
|
<p>Create Hotel</p>
|
|
|
|
|
|
|
|
<form [formGroup]="hotelForm">
|
2025-01-14 08:47:21 +01:00
|
|
|
<div class="text-red-500" *ngIf="errorMessages['form']">{{ errorMessages['form'] }}</div>
|
|
|
|
|
2024-11-26 08:48:07 +01:00
|
|
|
<label for="name">Name</label>
|
2025-01-07 09:59:47 +01:00
|
|
|
<div class="text-red-500" *ngIf="errorMessages['name']">{{ errorMessages['name'] }}</div>
|
2025-01-14 10:05:15 +01:00
|
|
|
<input type="text" class="border-red-500"
|
|
|
|
[class.border-8]='hotelForm.get("name")?.invalid && hotelForm.get("name")?.touched' id="name"
|
|
|
|
formControlName="name">
|
2024-11-26 08:48:07 +01:00
|
|
|
<label for="description">Description</label>
|
2025-01-07 09:59:47 +01:00
|
|
|
<div class="text-red-500" *ngIf="errorMessages['description']">{{ errorMessages['description'] }}</div>
|
2025-01-14 10:05:15 +01:00
|
|
|
<input type="text" class="border-red-500"
|
|
|
|
[class.border-8]='hotelForm.get("description")?.invalid && hotelForm.get("description")?.touched' id="description"
|
|
|
|
formControlName="description">
|
2024-11-26 08:48:07 +01:00
|
|
|
<label for="imageUrl">Image</label>
|
2025-01-07 09:59:47 +01:00
|
|
|
<div class="text-red-500" *ngIf="errorMessages['imageUrl']">{{ errorMessages['imageUrl'] }}</div>
|
2025-01-14 10:05:15 +01:00
|
|
|
<input type="url" class="border-red-500"
|
|
|
|
[class.border-8]='hotelForm.get("imageUel")?.invalid && hotelForm.get("imageUrl")?.touched' id="imageUrl"
|
|
|
|
formControlName="imageUrl">
|
2024-11-26 08:48:07 +01:00
|
|
|
<label for="price">Price</label>
|
2025-01-07 09:59:47 +01:00
|
|
|
<div class="text-red-500" *ngIf="errorMessages['price']">{{ errorMessages['price'] }}</div>
|
2025-01-14 10:05:15 +01:00
|
|
|
<input type="number" class="border-red-500" [class.border-8]='hotelForm.get("price")?.invalid' id="price"
|
|
|
|
formControlName="price">
|
2024-11-26 08:48:07 +01:00
|
|
|
<label for="rating">Rating</label>
|
2025-01-07 09:59:47 +01:00
|
|
|
<div class="text-red-500" *ngIf="errorMessages['rating']">{{ errorMessages['rating'] }}</div>
|
2025-01-14 10:05:15 +01:00
|
|
|
<input type="rating" class="border-red-500" [class.border-8]='hotelForm.get("rating")?.invalid' id="rating"
|
|
|
|
formControlName="rating">
|
2025-01-07 09:59:47 +01:00
|
|
|
<button class="submit-button" (click)="addTag()">Add Tag</button>
|
2025-01-14 08:22:21 +01:00
|
|
|
@for (tag of getTags().controls; track tag) {
|
2025-01-14 10:05:15 +01:00
|
|
|
<input type="tag" class="border-red-500" [class.border-8]='hotelForm.get("tag")?.invalid' id="tag"
|
|
|
|
formControlName="tag">
|
|
|
|
<button (click)="deleteTag(tag)" class="delete-button">delete</button>
|
2025-01-07 08:40:44 +01:00
|
|
|
}
|
2025-01-14 10:05:15 +01:00
|
|
|
|
|
|
|
<input type="radio" value='None' formControlName="contactType">None
|
|
|
|
<input type="radio" value='Email' formControlName="contactType">Email
|
|
|
|
<input type="radio" value='SMS' formControlName="contactType">SMS
|
|
|
|
|
|
|
|
@if (hotelForm.get("contactType")?.value == "Email") {
|
|
|
|
<div class="mt-3">
|
|
|
|
<label for="email">Email</label>
|
|
|
|
<input type="email" formControlName="email" id="email">
|
|
|
|
<label for="emailConfirmation">Email Confirmation</label>
|
|
|
|
<input type="email" formControlName="emailConfirmation" id="emailConfirmation">
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
@if (hotelForm.get("contactType")?.value == "SMS") {
|
|
|
|
<div class="mt-3">
|
|
|
|
<label for="phone">Phone Number</label>
|
|
|
|
<input type="tel" formControlName="phone" id="phone">
|
|
|
|
<label for="phoneConfirmation">Phone Number Confirmation</label>
|
|
|
|
<input type="tel" formControlName="phoneConfirmation" id="phoneConfirmation">
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
|
2025-01-07 09:59:47 +01:00
|
|
|
<button class="submit-button" (click)="submit()" [disabled]="!hotelForm.valid" type="submit">Submit</button>
|
|
|
|
<a routerLink="/" class="delete-button">Cancel</a>
|
2024-11-26 08:48:07 +01:00
|
|
|
</form>
|