webupdate
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
@@ -18,10 +18,11 @@
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<link rel="stylesheet" href="/admin/css/admin-style.css" />
|
||||
<link rel="stylesheet" href="/admin/css/media-library.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-brand">🛍️ Sky Art Shop</div>
|
||||
<div class="sidebar-brand">Sky Art Shop</div>
|
||||
<ul class="sidebar-menu">
|
||||
<li>
|
||||
<a href="/admin/dashboard"
|
||||
@@ -37,9 +38,7 @@
|
||||
<a href="/admin/products"><i class="bi bi-box"></i> Products</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/admin/portfolio"
|
||||
><i class="bi bi-easel"></i> Portfolio</a
|
||||
>
|
||||
<a href="/admin/portfolio"><i class="bi bi-easel"></i> Portfolio</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/admin/blog" class="active"
|
||||
@@ -65,6 +64,11 @@
|
||||
<li>
|
||||
<a href="/admin/users"><i class="bi bi-people"></i> Users</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/admin/customers"
|
||||
><i class="bi bi-person-hearts"></i> Customers</a
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -156,115 +160,272 @@
|
||||
></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="modal-body" style="max-height: 75vh; overflow-y: auto">
|
||||
<form id="postForm">
|
||||
<input type="hidden" id="postId" />
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="postTitle" class="form-label">Title *</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="postTitle"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="postSlug" class="form-label">Slug *</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="postSlug"
|
||||
required
|
||||
/>
|
||||
<small class="text-muted"
|
||||
>URL-friendly version (auto-generated from title)</small
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="postExcerpt" class="form-label">Excerpt</label>
|
||||
<textarea
|
||||
class="form-control"
|
||||
id="postExcerpt"
|
||||
rows="2"
|
||||
></textarea>
|
||||
<small class="text-muted">Brief summary for listings</small>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="postContent" class="form-label">Content *</label>
|
||||
<div
|
||||
id="postContentEditor"
|
||||
style="
|
||||
height: 400px;
|
||||
background: white;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
"
|
||||
>
|
||||
<style>
|
||||
#postContentEditor .ql-container {
|
||||
height: calc(400px - 42px);
|
||||
overflow-y: auto;
|
||||
font-size: 16px;
|
||||
}
|
||||
#postContentEditor .ql-editor {
|
||||
min-height: 100%;
|
||||
}
|
||||
</style>
|
||||
<!-- Basic Info Section -->
|
||||
<div class="blog-section">
|
||||
<h6 class="blog-section-title">
|
||||
<i class="bi bi-info-circle"></i> Basic Information
|
||||
</h6>
|
||||
<div class="row">
|
||||
<div class="col-md-8 mb-3">
|
||||
<label for="postTitle" class="form-label">Title *</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="postTitle"
|
||||
required
|
||||
placeholder="Enter blog title"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="postSlug" class="form-label">Slug *</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="postSlug"
|
||||
required
|
||||
placeholder="url-friendly-slug"
|
||||
/>
|
||||
<small class="text-muted">Auto-generated from title</small>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="postContent" />
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Featured Image</label>
|
||||
<input type="hidden" id="postFeaturedImage" />
|
||||
<div
|
||||
id="featuredImagePreview"
|
||||
style="margin-bottom: 10px"
|
||||
></div>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-outline-primary btn-sm"
|
||||
onclick="openMediaLibraryForFeaturedImage()"
|
||||
>
|
||||
<i class="bi bi-image"></i> Select from Media Library
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="postMetaTitle" class="form-label"
|
||||
>Meta Title (SEO)</label
|
||||
<div class="mb-3">
|
||||
<label for="postExcerpt" class="form-label"
|
||||
>Short Description / Excerpt</label
|
||||
>
|
||||
<input type="text" class="form-control" id="postMetaTitle" />
|
||||
<textarea
|
||||
class="form-control"
|
||||
id="postExcerpt"
|
||||
rows="2"
|
||||
placeholder="Brief summary for listings and previews"
|
||||
></textarea>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="postMetaDescription" class="form-label"
|
||||
>Meta Description (SEO)</label
|
||||
</div>
|
||||
|
||||
<!-- Content Section -->
|
||||
<div class="blog-section">
|
||||
<h6 class="blog-section-title">
|
||||
<i class="bi bi-file-text"></i> Content
|
||||
</h6>
|
||||
<div class="mb-3">
|
||||
<div
|
||||
id="postContentEditor"
|
||||
style="
|
||||
height: 350px;
|
||||
background: white;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
"
|
||||
>
|
||||
<style>
|
||||
#postContentEditor .ql-container {
|
||||
height: calc(350px - 42px);
|
||||
overflow-y: auto;
|
||||
font-size: 16px;
|
||||
}
|
||||
#postContentEditor .ql-editor {
|
||||
min-height: 100%;
|
||||
}
|
||||
</style>
|
||||
</div>
|
||||
<input type="hidden" id="postContent" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Media Section -->
|
||||
<div class="blog-section">
|
||||
<h6 class="blog-section-title">
|
||||
<i class="bi bi-images"></i> Media
|
||||
</h6>
|
||||
<div class="row">
|
||||
<!-- Featured Image -->
|
||||
<div class="col-md-6 mb-3">
|
||||
<label class="form-label">Featured Image</label>
|
||||
<input type="hidden" id="postFeaturedImage" />
|
||||
<div
|
||||
id="featuredImagePreview"
|
||||
class="media-preview-box"
|
||||
></div>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-outline-primary btn-sm mt-2"
|
||||
onclick="openMediaLibraryForFeaturedImage()"
|
||||
>
|
||||
<i class="bi bi-image"></i> Select Featured Image
|
||||
</button>
|
||||
</div>
|
||||
<!-- Gallery Images -->
|
||||
<div class="col-md-6 mb-3">
|
||||
<label class="form-label">Image Gallery</label>
|
||||
<input type="hidden" id="postImages" />
|
||||
<div
|
||||
id="galleryImagesPreview"
|
||||
class="gallery-preview-box"
|
||||
></div>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-outline-primary btn-sm mt-2"
|
||||
onclick="openMediaLibraryForGallery()"
|
||||
>
|
||||
<i class="bi bi-images"></i> Add Images to Gallery
|
||||
</button>
|
||||
<small class="text-muted d-block mt-1"
|
||||
>Add multiple images for slideshow</small
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Video -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Video</label>
|
||||
<input type="hidden" id="postVideoUrl" />
|
||||
<div id="videoPreview" class="video-preview-box"></div>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-outline-primary btn-sm mt-2"
|
||||
onclick="openMediaLibraryForVideo()"
|
||||
>
|
||||
<i class="bi bi-camera-video"></i> Select Video
|
||||
</button>
|
||||
<small class="text-muted d-block mt-1"
|
||||
>Or paste a YouTube/Vimeo URL below</small
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="postMetaDescription"
|
||||
class="form-control form-control-sm mt-2"
|
||||
id="postExternalVideo"
|
||||
placeholder="https://youtube.com/watch?v=..."
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<!-- Poll Section -->
|
||||
<div class="blog-section">
|
||||
<h6 class="blog-section-title">
|
||||
<i class="bi bi-bar-chart"></i> Poll (Optional)
|
||||
</h6>
|
||||
<div class="form-check form-switch mb-3">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
id="enablePoll"
|
||||
onchange="togglePollSection()"
|
||||
/>
|
||||
<label class="form-check-label" for="enablePoll"
|
||||
>Enable Poll</label
|
||||
>
|
||||
</div>
|
||||
<div id="pollSection" style="display: none">
|
||||
<div class="mb-3">
|
||||
<label for="pollQuestion" class="form-label"
|
||||
>Poll Question</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="pollQuestion"
|
||||
placeholder="What's your favorite...?"
|
||||
/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Poll Options</label>
|
||||
<div id="pollOptionsContainer">
|
||||
<div class="input-group mb-2 poll-option-row">
|
||||
<span class="input-group-text">1</span>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control poll-option-input"
|
||||
placeholder="Option 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="input-group mb-2 poll-option-row">
|
||||
<span class="input-group-text">2</span>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control poll-option-input"
|
||||
placeholder="Option 2"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-outline-secondary btn-sm"
|
||||
onclick="addPollOption()"
|
||||
>
|
||||
<i class="bi bi-plus"></i> Add Option
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- SEO Section -->
|
||||
<div class="blog-section">
|
||||
<h6 class="blog-section-title">
|
||||
<i class="bi bi-search"></i> SEO Settings
|
||||
</h6>
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="postMetaTitle" class="form-label"
|
||||
>Meta Title</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="postMetaTitle"
|
||||
placeholder="SEO title for search engines"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="postMetaDescription" class="form-label"
|
||||
>Meta Description</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="postMetaDescription"
|
||||
placeholder="SEO description for search engines"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Publish Settings -->
|
||||
<div
|
||||
class="blog-section"
|
||||
style="
|
||||
background: #f0fdf4;
|
||||
border: 2px solid #22c55e;
|
||||
border-radius: 12px;
|
||||
padding: 16px;
|
||||
"
|
||||
>
|
||||
<h6 class="blog-section-title" style="color: #16a34a">
|
||||
<i class="bi bi-globe"></i> Publish Settings
|
||||
</h6>
|
||||
<div class="form-check form-switch">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
id="postPublished"
|
||||
checked
|
||||
style="width: 3em; height: 1.5em"
|
||||
/>
|
||||
<label class="form-check-label" for="postPublished">
|
||||
Published (visible on website)
|
||||
<label
|
||||
class="form-check-label"
|
||||
for="postPublished"
|
||||
style="font-size: 1.1rem"
|
||||
>
|
||||
<strong>Published</strong>
|
||||
<span style="color: #64748b">(visible on website)</span>
|
||||
</label>
|
||||
</div>
|
||||
<p class="text-muted small mt-2 mb-0">
|
||||
<i class="bi bi-info-circle"></i> Uncheck to save as draft
|
||||
(won't appear on website)
|
||||
</p>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -284,10 +445,101 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.blog-section {
|
||||
background: #f8fafc;
|
||||
border-radius: 10px;
|
||||
padding: 1.25rem;
|
||||
margin-bottom: 1.25rem;
|
||||
border: 1px solid #e2e8f0;
|
||||
}
|
||||
.blog-section-title {
|
||||
color: #334155;
|
||||
font-weight: 600;
|
||||
margin-bottom: 1rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.blog-section-title i {
|
||||
color: #6366f1;
|
||||
}
|
||||
.media-preview-box,
|
||||
.video-preview-box {
|
||||
min-height: 100px;
|
||||
border: 2px dashed #e2e8f0;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
.media-preview-box img {
|
||||
max-width: 100%;
|
||||
max-height: 150px;
|
||||
object-fit: contain;
|
||||
}
|
||||
.gallery-preview-box {
|
||||
min-height: 100px;
|
||||
border: 2px dashed #e2e8f0;
|
||||
border-radius: 8px;
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
background: #fff;
|
||||
}
|
||||
.gallery-preview-box .gallery-thumb {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
.gallery-preview-box .gallery-thumb img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
.gallery-preview-box .gallery-thumb .remove-btn {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
right: 2px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: rgba(239, 68, 68, 0.9);
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
color: white;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.video-preview-box video {
|
||||
max-width: 100%;
|
||||
max-height: 200px;
|
||||
}
|
||||
.video-preview-box .video-placeholder {
|
||||
text-align: center;
|
||||
color: #94a3b8;
|
||||
padding: 20px;
|
||||
}
|
||||
.video-preview-box .video-placeholder i {
|
||||
font-size: 2rem;
|
||||
margin-bottom: 8px;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
||||
<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.min.js"></script>
|
||||
<script src="/admin/js/auth.js"></script>
|
||||
<script src="/admin/js/blog.js?v=8.0"></script>
|
||||
<script src="/admin/js/admin-utils.js"></script>
|
||||
<script src="/admin/js/media-library.js?v=9.1"></script>
|
||||
<script src="/admin/js/blog.js?v=9.1"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user