391 lines
13 KiB
HTML
391 lines
13 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Products Management - Sky Art Shop</title>
|
|
<link
|
|
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css"
|
|
rel="stylesheet"
|
|
/>
|
|
<link
|
|
rel="stylesheet"
|
|
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css"
|
|
/>
|
|
<!-- Quill Editor CSS -->
|
|
<link
|
|
href="https://cdn.jsdelivr.net/npm/quill@1.3.7/dist/quill.snow.css"
|
|
rel="stylesheet"
|
|
/>
|
|
<link rel="stylesheet" href="/admin/css/admin-style.css" />
|
|
</head>
|
|
<body>
|
|
<!-- Sidebar -->
|
|
<div class="sidebar" id="sidebar">
|
|
<div class="sidebar-brand">🛍️ Sky Art Shop</div>
|
|
<ul class="sidebar-menu">
|
|
<li>
|
|
<a href="/admin/dashboard.html"
|
|
><i class="bi bi-speedometer2"></i> Dashboard</a
|
|
>
|
|
</li>
|
|
<li>
|
|
<a href="/admin/homepage.html"
|
|
><i class="bi bi-house"></i> Homepage Editor</a
|
|
>
|
|
</li>
|
|
<li>
|
|
<a href="/admin/products.html" class="active"
|
|
><i class="bi bi-box"></i> Products</a
|
|
>
|
|
</li>
|
|
<li>
|
|
<a href="/admin/portfolio.html"
|
|
><i class="bi bi-easel"></i> Portfolio</a
|
|
>
|
|
</li>
|
|
<li>
|
|
<a href="/admin/blog.html"><i class="bi bi-newspaper"></i> Blog</a>
|
|
</li>
|
|
<li>
|
|
<a href="/admin/pages.html"
|
|
><i class="bi bi-file-text"></i> Custom Pages</a
|
|
>
|
|
</li>
|
|
<li>
|
|
<a href="/admin/media-library.html"
|
|
><i class="bi bi-images"></i> Media Library</a
|
|
>
|
|
</li>
|
|
<li>
|
|
<a href="/admin/menu.html"><i class="bi bi-list"></i> Menu</a>
|
|
</li>
|
|
<li>
|
|
<a href="/admin/settings.html"><i class="bi bi-gear"></i> Settings</a>
|
|
</li>
|
|
<li>
|
|
<a href="/admin/users.html"><i class="bi bi-people"></i> Users</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<!-- Main Content -->
|
|
<div class="main-content">
|
|
<!-- Top Bar -->
|
|
<div class="top-bar">
|
|
<div>
|
|
<h3>Products Management</h3>
|
|
<p class="mb-0 text-muted">Manage your product catalog</p>
|
|
</div>
|
|
<div>
|
|
<button class="btn-logout" id="btnLogout">
|
|
<i class="bi bi-box-arrow-right"></i> Logout
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Actions Bar -->
|
|
<div class="actions-bar">
|
|
<button class="btn btn-primary" id="btnAddProduct">
|
|
<i class="bi bi-plus-circle"></i> Add New Product
|
|
</button>
|
|
<div class="search-box">
|
|
<i class="bi bi-search"></i>
|
|
<input
|
|
type="text"
|
|
placeholder="Search products..."
|
|
id="searchInput"
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Products Table -->
|
|
<div class="card">
|
|
<div class="table-responsive">
|
|
<table class="table table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Product Name</th>
|
|
<th>Price</th>
|
|
<th>Stock</th>
|
|
<th>Status</th>
|
|
<th>Best Seller</th>
|
|
<th>Created</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="productsTableBody">
|
|
<tr>
|
|
<td colspan="8" class="text-center">
|
|
<div class="loading-spinner"></div>
|
|
Loading products...
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Create/Edit Product Modal -->
|
|
<div class="modal fade" id="productModal" tabindex="-1">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="modalTitle">Add New Product</h5>
|
|
<button
|
|
type="button"
|
|
class="btn-close"
|
|
data-bs-dismiss="modal"
|
|
></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form id="productForm">
|
|
<input type="hidden" id="productId" />
|
|
|
|
<!-- Product Name -->
|
|
<div class="mb-3">
|
|
<label for="productName" class="form-label"
|
|
>Product Name *</label
|
|
>
|
|
<input
|
|
type="text"
|
|
class="form-control"
|
|
id="productName"
|
|
required
|
|
/>
|
|
</div>
|
|
|
|
<!-- Short Description -->
|
|
<div class="mb-3">
|
|
<label for="productShortDescription" class="form-label"
|
|
>Short Description</label
|
|
>
|
|
<textarea
|
|
class="form-control"
|
|
id="productShortDescription"
|
|
rows="2"
|
|
placeholder="Brief description for product listings (max 500 characters)"
|
|
maxlength="500"
|
|
></textarea>
|
|
<small class="text-muted"
|
|
>This will be shown in product listings</small
|
|
>
|
|
</div>
|
|
|
|
<!-- Full Description with Rich Text Editor -->
|
|
<div class="mb-3">
|
|
<label for="productDescription" class="form-label"
|
|
>Full Description *</label
|
|
>
|
|
<div id="productDescriptionEditor" style="height: 200px"></div>
|
|
<textarea
|
|
id="productDescription"
|
|
style="display: none"
|
|
></textarea>
|
|
<small class="text-muted"
|
|
>Use the editor to format your product description</small
|
|
>
|
|
</div>
|
|
|
|
<!-- Pricing and Stock -->
|
|
<div class="row">
|
|
<div class="col-md-4 mb-3">
|
|
<label for="productPrice" class="form-label">Price *</label>
|
|
<div class="input-group">
|
|
<span class="input-group-text">$</span>
|
|
<input
|
|
type="number"
|
|
step="0.01"
|
|
class="form-control"
|
|
id="productPrice"
|
|
required
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4 mb-3">
|
|
<label for="productStock" class="form-label"
|
|
>Stock Quantity</label
|
|
>
|
|
<input
|
|
type="number"
|
|
class="form-control"
|
|
id="productStock"
|
|
value="0"
|
|
/>
|
|
</div>
|
|
<div class="col-md-4 mb-3">
|
|
<label for="productSKU" class="form-label">SKU</label>
|
|
<input type="text" class="form-control" id="productSKU" />
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Category and Details -->
|
|
<div class="row">
|
|
<div class="col-md-6 mb-3">
|
|
<label for="productCategory" class="form-label"
|
|
>Category</label
|
|
>
|
|
<input
|
|
type="text"
|
|
class="form-control"
|
|
id="productCategory"
|
|
placeholder="e.g., Canvas Art, Prints"
|
|
/>
|
|
</div>
|
|
<div class="col-md-6 mb-3">
|
|
<label for="productMaterial" class="form-label"
|
|
>Material</label
|
|
>
|
|
<input
|
|
type="text"
|
|
class="form-control"
|
|
id="productMaterial"
|
|
placeholder="e.g., Canvas, Acrylic"
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Dimensions and Weight -->
|
|
<div class="row">
|
|
<div class="col-md-6 mb-3">
|
|
<label for="productDimensions" class="form-label"
|
|
>Dimensions</label
|
|
>
|
|
<input
|
|
type="text"
|
|
class="form-control"
|
|
id="productDimensions"
|
|
placeholder="e.g., 24x36 inches"
|
|
/>
|
|
</div>
|
|
<div class="col-md-6 mb-3">
|
|
<label for="productWeight" class="form-label"
|
|
>Weight (lbs)</label
|
|
>
|
|
<input
|
|
type="number"
|
|
step="0.1"
|
|
class="form-control"
|
|
id="productWeight"
|
|
placeholder="e.g., 2.5"
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Product Images Gallery -->
|
|
<div class="mb-4">
|
|
<label class="form-label"
|
|
><i class="bi bi-image"></i> Product Images</label
|
|
>
|
|
<p class="text-muted small">
|
|
Upload or select images for this product. These images will be
|
|
available to assign to color variants below.
|
|
</p>
|
|
<button
|
|
type="button"
|
|
class="btn btn-sm btn-primary mb-3"
|
|
onclick="openMediaLibrary('productImage')"
|
|
>
|
|
<i class="bi bi-cloud-upload"></i> Select from Media Library
|
|
</button>
|
|
<div
|
|
id="productImagesGallery"
|
|
class="d-flex flex-wrap gap-2 border rounded p-3"
|
|
style="min-height: 100px"
|
|
>
|
|
<!-- Product images will be displayed here -->
|
|
<div class="text-muted small">
|
|
No images added yet. Click above to add images.
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Product Images with Color Variants -->
|
|
<div class="mb-3">
|
|
<label class="form-label"
|
|
><i class="bi bi-images"></i> Product Images with Color
|
|
Variants</label
|
|
>
|
|
<div id="imageVariantsContainer" class="border rounded p-3">
|
|
<!-- Image variants will be added here -->
|
|
</div>
|
|
<button
|
|
type="button"
|
|
class="btn btn-sm btn-outline-primary mt-2"
|
|
id="btnAddImageVariant"
|
|
>
|
|
<i class="bi bi-plus-circle"></i> Add Image with Color Variant
|
|
</button>
|
|
<small class="text-muted d-block mt-2"
|
|
>Add multiple images and assign color variants to each</small
|
|
>
|
|
</div>
|
|
|
|
<!-- Status Checkboxes -->
|
|
<div class="row">
|
|
<div class="col-md-4 mb-3">
|
|
<div class="form-check form-switch">
|
|
<input
|
|
class="form-check-input"
|
|
type="checkbox"
|
|
id="productActive"
|
|
checked
|
|
/>
|
|
<label class="form-check-label" for="productActive">
|
|
<i class="bi bi-eye"></i> Active (Visible on website)
|
|
</label>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4 mb-3">
|
|
<div class="form-check form-switch">
|
|
<input
|
|
class="form-check-input"
|
|
type="checkbox"
|
|
id="productFeatured"
|
|
/>
|
|
<label class="form-check-label" for="productFeatured">
|
|
<i class="bi bi-star"></i> Featured
|
|
</label>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4 mb-3">
|
|
<div class="form-check form-switch">
|
|
<input
|
|
class="form-check-input"
|
|
type="checkbox"
|
|
id="productBestSeller"
|
|
/>
|
|
<label class="form-check-label" for="productBestSeller">
|
|
<i class="bi bi-award"></i> Best Seller
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button
|
|
type="button"
|
|
class="btn btn-secondary"
|
|
data-bs-dismiss="modal"
|
|
>
|
|
Cancel
|
|
</button>
|
|
<button type="button" class="btn btn-primary" id="btnSaveProduct">
|
|
<i class="bi bi-save"></i> Save & Publish
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
<!-- Quill Editor JS -->
|
|
<script src="https://cdn.jsdelivr.net/npm/quill@1.3.7/dist/quill.js"></script>
|
|
<script src="/admin/js/auth.js"></script>
|
|
<script src="/admin/js/products.js"></script>
|
|
</body>
|
|
</html>
|