|
| 1 | + <div class="fixed inset-0 z-[120] overflow-y-auto" role="dialog" aria-modal="true"> |
| 2 | + <!-- Backdrop --> |
| 3 | + <div class="fixed inset-0 bg-black/70 backdrop-blur-sm transition-opacity animate-fade-in" (click)="onCancel()"></div> |
| 4 | + |
| 5 | + <div class="flex min-h-screen items-center justify-center p-4"> |
| 6 | + <div class="relative w-full max-w-3xl transform overflow-hidden rounded-2xl bg-white text-left shadow-2xl transition-all border border-gold/10 animate-slide-up"> |
| 7 | + |
| 8 | + <div class="bg-gray-50 px-6 py-4 border-b border-gray-100 flex justify-between items-center"> |
| 9 | + <h3 class="text-xl font-serif font-bold text-gray-900"> |
| 10 | + @if(!isEditMode()) { <span i18n="@@veilModalTitleNew">Add New Gown</span> } @else { <span i18n="@@veilModalTitleEdit">Edit Gown Details</span> } |
| 11 | + </h3> |
| 12 | + <button (click)="onCancel()" class="text-gray-400 hover:text-gray-500 transition-colors"> |
| 13 | + <span class="material-symbols-outlined">close</span> |
| 14 | + </button> |
| 15 | + </div> |
| 16 | + |
| 17 | + <div class="px-6 py-6 grid grid-cols-1 md:grid-cols-3 gap-x-8" [formGroup]="veilForm"> |
| 18 | + <!-- Image Uploader --> |
| 19 | + <div class="md:col-span-1 space-y-2 mb-6 md:mb-0"> |
| 20 | + <label class="block text-sm font-medium text-gray-700">Gown Image</label> |
| 21 | + <div (click)="fileInput.click()" class="aspect-square w-full rounded-xl border-2 border-dashed border-gray-300 flex flex-col items-center justify-center relative group cursor-pointer hover:border-gold transition-colors bg-gray-50"> |
| 22 | + @if (previewImage()) { |
| 23 | + <img [src]="previewImage()" alt="Gown preview" class="w-full h-full object-cover rounded-lg absolute inset-0"> |
| 24 | + <div class="absolute inset-0 bg-black/50 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-300 rounded-lg"> |
| 25 | + <div class="text-center text-white"> |
| 26 | + <span class="material-symbols-outlined text-3xl">edit</span> |
| 27 | + <p class="text-xs mt-1 font-semibold">Change Image</p> |
| 28 | + </div> |
| 29 | + </div> |
| 30 | + } @else { |
| 31 | + <div class="text-center text-gray-500"> |
| 32 | + <span class="material-symbols-outlined text-4xl">add_photo_alternate</span> |
| 33 | + <p class="text-xs mt-2 font-semibold">Click to upload</p> |
| 34 | + </div> |
| 35 | + } |
| 36 | + </div> |
| 37 | + <input #fileInput type="file" class="hidden" (change)="onFileSelected($event)" accept="image/png, image/jpeg, image/webp"> |
| 38 | + |
| 39 | + <div class="mt-4"> |
| 40 | + <label class="inline-flex items-center cursor-pointer"> |
| 41 | + <input type="checkbox" formControlName="isAvailable" class="sr-only peer"> |
| 42 | + <div class="relative w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-gold/30 rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-gold"></div> |
| 43 | + <span class="ms-3 text-sm font-medium text-gray-700">Available for Sale</span> |
| 44 | + </label> |
| 45 | + </div> |
| 46 | + </div> |
| 47 | + |
| 48 | + <!-- Form Fields --> |
| 49 | + <div class="md:col-span-2 space-y-5"> |
| 50 | + <div class="grid grid-cols-1 sm:grid-cols-2 gap-6"> |
| 51 | + <div class="space-y-2"> |
| 52 | + <label class="block text-sm font-medium text-gray-700">Name</label> |
| 53 | + <input type="text" formControlName="name" class="block w-full rounded-lg border-gray-300 bg-gray-50 text-gray-900 focus:bg-white focus:border-gold focus:ring-gold sm:text-sm p-2.5 transition-all"> |
| 54 | + </div> |
| 55 | + <div class="space-y-2"> |
| 56 | + <label class="block text-sm font-medium text-gray-700">Category</label> |
| 57 | + <select formControlName="category" class="block w-full rounded-lg border-gray-300 bg-gray-50 text-gray-900 focus:bg-white focus:border-gold focus:ring-gold sm:text-sm p-2.5 transition-all"> |
| 58 | + <option value="Bridal">Bridal</option> |
| 59 | + <option value="Evening">Evening</option> |
| 60 | + <option value="Accessories">Accessories</option> |
| 61 | + </select> |
| 62 | + </div> |
| 63 | + </div> |
| 64 | + |
| 65 | + <div class="grid grid-cols-1 sm:grid-cols-2 gap-6"> |
| 66 | + <div class="space-y-2"> |
| 67 | + <label class="block text-sm font-medium text-gray-700">Price (TJS)</label> |
| 68 | + <input type="number" formControlName="price" class="block w-full rounded-lg border-gray-300 bg-gray-50 text-gray-900 focus:bg-white focus:border-gold focus:ring-gold sm:text-sm p-2.5 transition-all"> |
| 69 | + </div> |
| 70 | + <div class="space-y-2"> |
| 71 | + <label class="block text-sm font-medium text-gray-700">Rental Price (TJS)</label> |
| 72 | + <input type="number" formControlName="rentalPrice" class="block w-full rounded-lg border-gray-300 bg-gray-50 text-gray-900 focus:bg-white focus:border-gold focus:ring-gold sm:text-sm p-2.5 transition-all"> |
| 73 | + </div> |
| 74 | + </div> |
| 75 | + |
| 76 | + <div class="grid grid-cols-1 sm:grid-cols-2 gap-6"> |
| 77 | + <div class="space-y-2"> |
| 78 | + <label class="block text-sm font-medium text-gray-700">SKU</label> |
| 79 | + <input type="text" formControlName="sku" class="block w-full rounded-lg border-gray-300 bg-gray-50 text-gray-900 focus:bg-white focus:border-gold focus:ring-gold sm:text-sm p-2.5 transition-all"> |
| 80 | + </div> |
| 81 | + <div class="space-y-2"> |
| 82 | + <label class="block text-sm font-medium text-gray-700">Stock Quantity</label> |
| 83 | + <input type="number" formControlName="stock" class="block w-full rounded-lg border-gray-300 bg-gray-50 text-gray-900 focus:bg-white focus:border-gold focus:ring-gold sm:text-sm p-2.5 transition-all"> |
| 84 | + </div> |
| 85 | + </div> |
| 86 | + |
| 87 | + <div class="grid grid-cols-1 sm:grid-cols-2 gap-6"> |
| 88 | + <div class="space-y-2"> |
| 89 | + <label class="block text-sm font-medium text-gray-700">Silhouette</label> |
| 90 | + <input type="text" formControlName="silhouette" class="block w-full rounded-lg border-gray-300 bg-gray-50 text-gray-900 focus:bg-white focus:border-gold focus:ring-gold sm:text-sm p-2.5 transition-all"> |
| 91 | + </div> |
| 92 | + <div class="space-y-2"> |
| 93 | + <label class="block text-sm font-medium text-gray-700">Neckline</label> |
| 94 | + <input type="text" formControlName="neckline" class="block w-full rounded-lg border-gray-300 bg-gray-50 text-gray-900 focus:bg-white focus:border-gold focus:ring-gold sm:text-sm p-2.5 transition-all"> |
| 95 | + </div> |
| 96 | + </div> |
| 97 | + |
| 98 | + <div class="grid grid-cols-1 sm:grid-cols-2 gap-6"> |
| 99 | + <div class="space-y-2"> |
| 100 | + <label class="block text-sm font-medium text-gray-700">Fabric</label> |
| 101 | + <input type="text" formControlName="fabric" class="block w-full rounded-lg border-gray-300 bg-gray-50 text-gray-900 focus:bg-white focus:border-gold focus:ring-gold sm:text-sm p-2.5 transition-all"> |
| 102 | + </div> |
| 103 | + <div class="space-y-2"> |
| 104 | + <label class="block text-sm font-medium text-gray-700">Train Length</label> |
| 105 | + <input type="text" formControlName="trainLength" class="block w-full rounded-lg border-gray-300 bg-gray-50 text-gray-900 focus:bg-white focus:border-gold focus:ring-gold sm:text-sm p-2.5 transition-all"> |
| 106 | + </div> |
| 107 | + </div> |
| 108 | + |
| 109 | + <div class="space-y-2"> |
| 110 | + <label class="block text-sm font-medium text-gray-700">Description</label> |
| 111 | + <textarea formControlName="description" rows="3" class="block w-full rounded-lg border-gray-300 bg-gray-50 text-gray-900 focus:bg-white focus:border-gold focus:ring-gold sm:text-sm p-2.5 transition-all"></textarea> |
| 112 | + </div> |
| 113 | + </div> |
| 114 | + </div> |
| 115 | + |
| 116 | + <div class="bg-gray-50 px-6 py-4 flex flex-row-reverse border-t border-gray-100 gap-3"> |
| 117 | + <button (click)="onSubmit()" type="button" [disabled]="veilForm.invalid" class="inline-flex justify-center rounded-lg bg-gold px-4 py-2 text-sm font-semibold text-white shadow-lg shadow-gold/30 hover:bg-gold-dark hover:shadow-gold/50 transition-all transform active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed"> |
| 118 | + @if(!isEditMode()) { <span i18n="@@veilBtnCreate">Create Gown</span> } @else { <span i18n="@@veilBtnSave">Save Changes</span> } |
| 119 | + </button> |
| 120 | + <button (click)="onCancel()" type="button" class="inline-flex justify-center rounded-lg bg-white px-4 py-2 text-sm font-semibold text-gray-700 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 transition-all"> |
| 121 | + Cancel |
| 122 | + </button> |
| 123 | + </div> |
| 124 | + </div> |
| 125 | + </div> |
| 126 | + </div> |
0 commit comments