- Update data model to include status, adminReply, and updatedAt fields - Hide user emails from public API responses for privacy - Add admin-only endpoints: list, reply, update status, delete - Create admin-feature-requests.html with full management UI - Add status badges and admin replies to public feature requests page - Add Feature Requests link to all admin page sidebars Admin capabilities: - View all feature requests with author emails (admin only) - Reply to feature requests with admin responses visible to public - Update status: pending, planned, in-progress, completed, declined - Delete feature requests - Filter and sort by status, votes, date
430 lines
13 KiB
HTML
430 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>Blog Management - Admin</title>
|
|
<link rel="stylesheet" href="/styles.css" />
|
|
|
|
<!-- Editor.js -->
|
|
<script src="https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/@editorjs/header@latest"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/@editorjs/paragraph@latest"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/@editorjs/list@latest"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/@editorjs/link@latest"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/@editorjs/image@latest"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/@editorjs/embed@latest"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/@editorjs/code@latest"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/@editorjs/quote@latest"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/@editorjs/table@latest"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/@editorjs/marker@latest"></script>
|
|
|
|
<style>
|
|
.editor-wrapper {
|
|
border: 1px solid var(--border);
|
|
border-radius: 8px;
|
|
padding: 16px;
|
|
min-height: 400px;
|
|
background: var(--bg-1);
|
|
}
|
|
.ce-block__content {
|
|
max-width: 100% !important;
|
|
}
|
|
.ce-toolbar__content {
|
|
max-width: 100% !important;
|
|
}
|
|
.blog-list {
|
|
display: grid;
|
|
gap: 12px;
|
|
}
|
|
.blog-item {
|
|
display: grid;
|
|
grid-template-columns: 1fr auto auto;
|
|
gap: 12px;
|
|
align-items: center;
|
|
padding: 12px;
|
|
border: 1px solid var(--border);
|
|
border-radius: 8px;
|
|
background: var(--bg-1);
|
|
}
|
|
.blog-item.repo {
|
|
border-left: 4px solid var(--info);
|
|
}
|
|
.blog-item.database {
|
|
border-left: 4px solid var(--success);
|
|
}
|
|
.blog-meta {
|
|
font-size: 0.85em;
|
|
color: var(--muted);
|
|
display: flex;
|
|
gap: 12px;
|
|
flex-wrap: wrap;
|
|
}
|
|
.blog-meta span {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
}
|
|
.type-badge {
|
|
display: inline-block;
|
|
padding: 2px 8px;
|
|
border-radius: 4px;
|
|
font-size: 0.75em;
|
|
font-weight: 500;
|
|
text-transform: uppercase;
|
|
}
|
|
.type-news {
|
|
background: var(--info-bg, #e0f2fe);
|
|
color: var(--info, #0284c7);
|
|
}
|
|
.type-seo {
|
|
background: var(--warning-bg, #fef3c7);
|
|
color: var(--warning, #d97706);
|
|
}
|
|
.status-badge {
|
|
display: inline-block;
|
|
padding: 2px 8px;
|
|
border-radius: 4px;
|
|
font-size: 0.75em;
|
|
font-weight: 500;
|
|
text-transform: uppercase;
|
|
}
|
|
.status-published {
|
|
background: var(--success-bg, #d1fae5);
|
|
color: var(--success, #059669);
|
|
}
|
|
.status-draft {
|
|
background: var(--muted-bg, #f3f4f6);
|
|
color: var(--muted, #6b7280);
|
|
}
|
|
.source-badge {
|
|
display: inline-block;
|
|
padding: 2px 8px;
|
|
border-radius: 4px;
|
|
font-size: 0.75em;
|
|
font-weight: 500;
|
|
}
|
|
.source-repo {
|
|
background: #dbeafe;
|
|
color: #2563eb;
|
|
}
|
|
.source-database {
|
|
background: #d1fae5;
|
|
color: #059669;
|
|
}
|
|
.category-list {
|
|
display: grid;
|
|
gap: 8px;
|
|
}
|
|
.category-item {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 8px 12px;
|
|
border: 1px solid var(--border);
|
|
border-radius: 6px;
|
|
background: var(--bg-1);
|
|
}
|
|
.modal-overlay {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background: rgba(0,0,0,0.5);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
z-index: 1000;
|
|
padding: 20px;
|
|
}
|
|
.modal {
|
|
background: var(--bg-1);
|
|
border-radius: 12px;
|
|
max-width: 900px;
|
|
width: 100%;
|
|
max-height: 90vh;
|
|
overflow-y: auto;
|
|
padding: 24px;
|
|
}
|
|
.modal-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 20px;
|
|
padding-bottom: 16px;
|
|
border-bottom: 1px solid var(--border);
|
|
}
|
|
.modal-title {
|
|
font-size: 1.5em;
|
|
font-weight: 600;
|
|
}
|
|
.modal-close {
|
|
background: none;
|
|
border: none;
|
|
font-size: 1.5em;
|
|
cursor: pointer;
|
|
color: var(--muted);
|
|
}
|
|
.form-row {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 16px;
|
|
}
|
|
@media (max-width: 768px) {
|
|
.form-row {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
.blog-item {
|
|
grid-template-columns: 1fr;
|
|
gap: 8px;
|
|
}
|
|
}
|
|
.hidden { display: none !important; }
|
|
.filters {
|
|
display: flex;
|
|
gap: 12px;
|
|
flex-wrap: wrap;
|
|
margin-bottom: 16px;
|
|
}
|
|
.filters select, .filters input {
|
|
padding: 8px 12px;
|
|
border: 1px solid var(--border);
|
|
border-radius: 6px;
|
|
background: var(--bg-1);
|
|
}
|
|
.tab-buttons {
|
|
display: flex;
|
|
gap: 8px;
|
|
margin-bottom: 20px;
|
|
border-bottom: 1px solid var(--border);
|
|
}
|
|
.tab-button {
|
|
padding: 12px 20px;
|
|
background: none;
|
|
border: none;
|
|
cursor: pointer;
|
|
color: var(--muted);
|
|
border-bottom: 2px solid transparent;
|
|
transition: all 0.2s;
|
|
}
|
|
.tab-button.active {
|
|
color: var(--text);
|
|
border-bottom-color: var(--primary);
|
|
}
|
|
.tab-content {
|
|
display: none;
|
|
}
|
|
.tab-content.active {
|
|
display: block;
|
|
}
|
|
</style>
|
|
|
|
<!-- PostHog Analytics -->
|
|
<script src="/posthog.js"></script>
|
|
</head>
|
|
<body data-page="blogs">
|
|
<div class="sidebar-overlay"></div>
|
|
<div class="app-shell">
|
|
<aside class="sidebar">
|
|
<div class="brand">
|
|
<div class="brand-mark">A</div>
|
|
<div>
|
|
<div class="brand-title">Admin</div>
|
|
<div class="brand-sub">Site management</div>
|
|
</div>
|
|
<button id="close-sidebar" class="ghost" style="margin-left: auto; display: none;">×</button>
|
|
</div>
|
|
<div class="sidebar-section">
|
|
<div class="section-heading">Navigation</div>
|
|
<a class="ghost" href="/admin/build">Build models</a>
|
|
<a class="ghost" href="/admin/plan">Plan models</a>
|
|
<a class="ghost" href="/admin/plans">Plans</a>
|
|
<a class="ghost" href="/admin/accounts">Accounts</a>
|
|
<a class="ghost" href="/admin/affiliates">Affiliates</a>
|
|
<a class="ghost" href="/admin/withdrawals">Withdrawals</a>
|
|
<a class="ghost" href="/admin/tracking">Tracking</a>
|
|
<a class="ghost" href="/admin/resources">Resources</a>
|
|
<a class="ghost" href="/admin/external-testing">External Testing</a>
|
|
<a class="ghost" href="/admin/contact-messages">Contact Messages</a>
|
|
<a class="ghost" href="/admin/feature-requests">Feature Requests</a>
|
|
<a class="ghost active" href="/admin/blogs">Blog Management</a>
|
|
<a class="ghost" href="/admin/login">Login</a>
|
|
</div>
|
|
</aside>
|
|
<main class="main">
|
|
<div class="admin-shell">
|
|
<div class="topbar" style="margin-bottom: 12px;">
|
|
<button id="menu-toggle">
|
|
<span></span><span></span><span></span>
|
|
</button>
|
|
<div>
|
|
<div class="pill">Admin</div>
|
|
<div class="title" style="margin-top: 6px;">Blog Management</div>
|
|
<div class="crumb">Manage news and SEO blog posts</div>
|
|
</div>
|
|
<div class="admin-actions">
|
|
<button id="refresh-blogs" class="ghost">Refresh</button>
|
|
<button id="new-post" class="primary">New Post</button>
|
|
<button id="admin-logout" class="ghost">Logout</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="tab-buttons">
|
|
<button class="tab-button active" data-tab="posts">Blog Posts</button>
|
|
<button class="tab-button" data-tab="categories">Categories</button>
|
|
</div>
|
|
|
|
<!-- Posts Tab -->
|
|
<div id="posts-tab" class="tab-content active">
|
|
<div class="filters">
|
|
<select id="filter-type">
|
|
<option value="">All Types</option>
|
|
<option value="news">News</option>
|
|
<option value="seo">SEO</option>
|
|
</select>
|
|
<select id="filter-status">
|
|
<option value="">All Status</option>
|
|
<option value="published">Published</option>
|
|
<option value="draft">Draft</option>
|
|
</select>
|
|
<select id="filter-source">
|
|
<option value="">All Sources</option>
|
|
<option value="database">Database</option>
|
|
<option value="repo">Repository</option>
|
|
</select>
|
|
<input type="text" id="filter-search" placeholder="Search posts..." />
|
|
</div>
|
|
|
|
<div id="blog-list" class="blog-list">
|
|
<p>Loading posts...</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Categories Tab -->
|
|
<div id="categories-tab" class="tab-content">
|
|
<div class="admin-card" style="margin-bottom: 16px;">
|
|
<header>
|
|
<h3>Add New Category</h3>
|
|
</header>
|
|
<form id="category-form" class="admin-form">
|
|
<div class="form-row">
|
|
<label>
|
|
Category Name
|
|
<input type="text" id="category-name" placeholder="e.g., Tutorials" required />
|
|
</label>
|
|
<label>
|
|
Slug
|
|
<input type="text" id="category-slug" placeholder="e.g., tutorials" required />
|
|
</label>
|
|
</div>
|
|
<label>
|
|
Description
|
|
<textarea id="category-description" rows="2" placeholder="Brief description..."></textarea>
|
|
</label>
|
|
<div class="admin-actions">
|
|
<button type="submit" class="primary">Add Category</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="admin-card">
|
|
<header>
|
|
<h3>Categories</h3>
|
|
</header>
|
|
<div id="category-list" class="category-list">
|
|
<p>Loading categories...</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
|
|
<!-- Blog Post Modal -->
|
|
<div id="post-modal" class="modal-overlay hidden">
|
|
<div class="modal">
|
|
<div class="modal-header">
|
|
<h2 class="modal-title" id="modal-title">New Post</h2>
|
|
<button class="modal-close" id="modal-close">×</button>
|
|
</div>
|
|
<form id="post-form">
|
|
<input type="hidden" id="post-id" />
|
|
<div class="form-row">
|
|
<label>
|
|
Title
|
|
<input type="text" id="post-title" placeholder="Post title" required />
|
|
</label>
|
|
<label>
|
|
Slug
|
|
<input type="text" id="post-slug" placeholder="url-friendly-slug" required />
|
|
</label>
|
|
</div>
|
|
<div class="form-row">
|
|
<label>
|
|
Type
|
|
<select id="post-type" required>
|
|
<option value="news">News</option>
|
|
<option value="seo">SEO</option>
|
|
</select>
|
|
</label>
|
|
<label>
|
|
Status
|
|
<select id="post-status">
|
|
<option value="draft">Draft</option>
|
|
<option value="published">Published</option>
|
|
</select>
|
|
</label>
|
|
</div>
|
|
<div class="form-row">
|
|
<label>
|
|
Category
|
|
<select id="post-category">
|
|
<option value="">No Category</option>
|
|
</select>
|
|
</label>
|
|
<label>
|
|
Author
|
|
<input type="text" id="post-author" placeholder="Author name" />
|
|
</label>
|
|
</div>
|
|
<label>
|
|
Excerpt
|
|
<textarea id="post-excerpt" rows="2" placeholder="Brief description of the post..."></textarea>
|
|
</label>
|
|
<div class="form-row">
|
|
<label>
|
|
Meta Title
|
|
<input type="text" id="post-meta-title" placeholder="SEO title" />
|
|
</label>
|
|
<label>
|
|
Meta Description
|
|
<input type="text" id="post-meta-description" placeholder="SEO description" />
|
|
</label>
|
|
</div>
|
|
<label>
|
|
Featured Image URL
|
|
<input type="text" id="post-featured-image" placeholder="/blogs/images/image.jpg" />
|
|
</label>
|
|
<label>
|
|
Tags (comma separated)
|
|
<input type="text" id="post-tags" placeholder="wordpress, tutorial, guide" />
|
|
</label>
|
|
<label style="margin-top: 16px;">
|
|
Content
|
|
<div id="editor" class="editor-wrapper"></div>
|
|
</label>
|
|
<div class="admin-actions" style="margin-top: 20px;">
|
|
<button type="submit" class="primary" id="save-post">Save Post</button>
|
|
<button type="button" class="ghost" id="cancel-post">Cancel</button>
|
|
<span id="post-source" class="source-badge" style="margin-left: auto;"></span>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="/admin.js"></script>
|
|
<script src="/js/blog-admin.js"></script>
|
|
</body>
|
|
</html>
|