|
@@ -80,29 +80,30 @@
|
|
|
|
|
|
|
|
<!-- Add/Edit Modal -->
|
|
<!-- Add/Edit Modal -->
|
|
|
<div v-if="showAddModal" class="fixed inset-0 z-[10000] flex items-center justify-center p-4">
|
|
<div v-if="showAddModal" class="fixed inset-0 z-[10000] flex items-center justify-center p-4">
|
|
|
- <div class="absolute inset-0 bg-background/90 backdrop-blur-md" @click="closeModal" />
|
|
|
|
|
|
|
+ <div class="absolute inset-0 bg-background/95 backdrop-blur-xl" @click="closeModal" />
|
|
|
<div class="relative w-full max-w-md bg-card border border-primary/20 rounded-3xl p-8 shadow-2xl">
|
|
<div class="relative w-full max-w-md bg-card border border-primary/20 rounded-3xl p-8 shadow-2xl">
|
|
|
<h3 class="text-xl font-black font-display text-gradient mb-6">
|
|
<h3 class="text-xl font-black font-display text-gradient mb-6">
|
|
|
- {{ editingId ? t('admin.modals.editMaterial') : t('admin.actions.add') }}
|
|
|
|
|
|
|
+ {{ editingId ? t('admin.modals.editStock') : t('admin.modals.addStock') }}
|
|
|
</h3>
|
|
</h3>
|
|
|
|
|
|
|
|
- <form @submit.prevent="handleSubmit" class="space-y-4">
|
|
|
|
|
|
|
+ <form v-if="materials && materials.length > 0" @submit.prevent="handleSubmit" class="space-y-4">
|
|
|
<div class="space-y-1">
|
|
<div class="space-y-1">
|
|
|
- <label class="text-[10px] font-bold uppercase text-muted-foreground ml-1">{{ t('admin.fields.material') }}</label>
|
|
|
|
|
- <select v-model="form.material_id" required class="w-full bg-background border border-border/50 rounded-xl px-4 py-3 text-sm focus:ring-2 ring-primary/20 outline-none">
|
|
|
|
|
- <option v-for="m in materials" :key="m.id" :value="m.id">{{ m.name_en }}</option>
|
|
|
|
|
|
|
+ <label class="text-[10px] font-black uppercase text-muted-foreground ml-1 tracking-widest">{{ t('admin.fields.material') }}</label>
|
|
|
|
|
+ <select v-model="form.material_id" required class="w-full bg-background border border-border/50 rounded-xl px-4 py-3 text-sm focus:ring-2 ring-primary/20 outline-none appearance-none">
|
|
|
|
|
+ <option value="0" disabled>{{ t('admin.actions.select') || 'Select material...' }}</option>
|
|
|
|
|
+ <option v-for="m in materials" :key="m.id" :value="m.id">{{ m.name_en || m.name_ru }}</option>
|
|
|
</select>
|
|
</select>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="space-y-1">
|
|
<div class="space-y-1">
|
|
|
- <label class="text-[10px] font-bold uppercase text-muted-foreground ml-1">{{ t('admin.fields.colors') }}</label>
|
|
|
|
|
- <input v-model="form.color_name" required placeholder="Ex: Black, Emerald, Red..." class="w-full bg-background border border-border/50 rounded-xl px-4 py-3 text-sm focus:ring-2 ring-primary/20 outline-none" />
|
|
|
|
|
|
|
+ <label class="text-[10px] font-black uppercase text-muted-foreground ml-1 tracking-widest">{{ t('admin.fields.color') }}</label>
|
|
|
|
|
+ <input v-model="form.color_name" required placeholder="Ex: Black, Red, Gold..." class="w-full bg-background border border-border/50 rounded-xl px-4 py-3 text-sm focus:ring-2 ring-primary/20 outline-none" />
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="grid grid-cols-2 gap-4">
|
|
<div class="grid grid-cols-2 gap-4">
|
|
|
<div class="space-y-1">
|
|
<div class="space-y-1">
|
|
|
- <label class="text-[10px] font-bold uppercase text-muted-foreground ml-1">{{ t('admin.fields.quantity') }}</label>
|
|
|
|
|
- <input v-model.number="form.quantity" type="number" step="0.1" class="w-full bg-background border border-border/50 rounded-xl px-4 py-3 text-sm focus:ring-2 ring-primary/20 outline-none" />
|
|
|
|
|
|
|
+ <label class="text-[10px] font-black uppercase text-muted-foreground ml-1 tracking-widest">{{ t('admin.fields.quantity') }}</label>
|
|
|
|
|
+ <input v-model.number="form.quantity" type="number" step="0.1" required class="w-full bg-background border border-border/50 rounded-xl px-4 py-3 text-sm focus:ring-2 ring-primary/20 outline-none" />
|
|
|
</div>
|
|
</div>
|
|
|
<div class="space-y-1 flex flex-col justify-end pb-2">
|
|
<div class="space-y-1 flex flex-col justify-end pb-2">
|
|
|
<label class="flex items-center gap-2 cursor-pointer group">
|
|
<label class="flex items-center gap-2 cursor-pointer group">
|
|
@@ -110,18 +111,27 @@
|
|
|
<div class="w-5 h-5 rounded border border-border/50 flex items-center justify-center group-hover:border-primary transition-colors" :class="form.is_active ? 'bg-primary border-primary' : ''">
|
|
<div class="w-5 h-5 rounded border border-border/50 flex items-center justify-center group-hover:border-primary transition-colors" :class="form.is_active ? 'bg-primary border-primary' : ''">
|
|
|
<Check v-if="form.is_active" class="w-3 h-3 text-white" />
|
|
<Check v-if="form.is_active" class="w-3 h-3 text-white" />
|
|
|
</div>
|
|
</div>
|
|
|
- <span class="text-xs font-bold uppercase">{{ t('admin.fields.publishImmediately') }}</span>
|
|
|
|
|
|
|
+ <span class="text-[10px] font-black uppercase tracking-wider text-muted-foreground">{{ t('admin.fields.active') || 'Active' }}</span>
|
|
|
</label>
|
|
</label>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="flex gap-4 pt-4">
|
|
<div class="flex gap-4 pt-4">
|
|
|
- <button type="button" @click="closeModal" class="flex-1 px-4 py-3 rounded-xl border border-border/50 hover:bg-white/5 transition-colors text-xs font-bold">{{ t('admin.actions.cancel') }}</button>
|
|
|
|
|
- <button type="submit" class="flex-2 bg-primary text-white px-8 py-3 rounded-xl text-xs font-bold hover:shadow-glow transition-all">
|
|
|
|
|
- {{ editingId ? t('admin.actions.save') : t('admin.actions.add') }}
|
|
|
|
|
|
|
+ <button type="button" @click="closeModal" class="flex-1 px-4 py-3 rounded-xl border border-border/50 hover:bg-white/5 transition-colors text-xs font-black uppercase tracking-widest">
|
|
|
|
|
+ {{ t('common.actions.cancel') || 'Cancel' }}
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button type="submit" class="flex-2 bg-primary text-white px-8 py-3 rounded-xl text-xs font-black uppercase tracking-widest hover:shadow-glow transition-all">
|
|
|
|
|
+ {{ editingId ? t('common.actions.save') : t('admin.actions.add') }}
|
|
|
</button>
|
|
</button>
|
|
|
</div>
|
|
</div>
|
|
|
</form>
|
|
</form>
|
|
|
|
|
+ <div v-else class="text-center py-10">
|
|
|
|
|
+ <PackageOpen class="w-12 h-12 text-muted-foreground/20 mx-auto mb-4" />
|
|
|
|
|
+ <p class="text-xs text-muted-foreground uppercase font-black tracking-widest mb-6">No materials found in catalog</p>
|
|
|
|
|
+ <button @click="closeModal" class="px-6 py-2 bg-primary text-white rounded-xl text-[10px] font-black uppercase tracking-widest">
|
|
|
|
|
+ {{ t('common.actions.close') || 'Close' }}
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|