51 lines
1.8 KiB
Smarty
51 lines
1.8 KiB
Smarty
<!-- dvbooking-cli/src/templates/angular/form.component.html.tpl -->
|
|
|
|
<!-- Generated by the CLI -->
|
|
<div class="p-4 md:p-8">
|
|
<div class="card bg-base-100 shadow-xl max-w-2xl mx-auto">
|
|
<div class="card-body">
|
|
<h2 class="card-title text-3xl">
|
|
{{ isEditMode ? 'Edit' : 'Create' }} {{title}}
|
|
</h2>
|
|
|
|
<form [formGroup]="form" (ngSubmit)="onSubmit()" class="space-y-4 mt-4">
|
|
|
|
<!-- Name Field -->
|
|
<div class="form-control">
|
|
<label class="label">
|
|
<span class="label-text">Name</span>
|
|
</label>
|
|
<input type="text" formControlName="name" class="input input-bordered w-full" />
|
|
<div *ngIf="form.get('name')?.invalid && form.get('name')?.touched" class="text-error text-sm mt-1">
|
|
Name is required.
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Price Field -->
|
|
<div class="form-control">
|
|
<label class="label">
|
|
<span class="label-text">Price</span>
|
|
</label>
|
|
<input type="number" formControlName="price" class="input input-bordered w-full" />
|
|
</div>
|
|
|
|
<!-- Is Available Checkbox -->
|
|
<div class="form-control">
|
|
<label class="label cursor-pointer justify-start gap-4">
|
|
<span class="label-text">Is Available?</span>
|
|
<input type="checkbox" formControlName="is_available" class="checkbox" />
|
|
</label>
|
|
</div>
|
|
|
|
<!-- Add other form fields here -->
|
|
|
|
<div class="card-actions justify-end mt-6">
|
|
<a routerLink="/{{plural}}" class="btn btn-ghost">Cancel</a>
|
|
<button type="submit" class="btn btn-primary" [disabled]="form.invalid">
|
|
{{ isEditMode ? 'Update' : 'Create' }}
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div> |