-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.html
More file actions
99 lines (87 loc) · 4.62 KB
/
admin.html
File metadata and controls
99 lines (87 loc) · 4.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Panel - Book Sphere</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div id="login-section" class="container auth-container">
<h2>Admin Login</h2>
<form id="login-form" class="contact-form">
<input type="email" id="admin-email" placeholder="Email" required>
<input type="password" id="admin-password" placeholder="Password" required>
<button type="submit" class="admin-btn">Login</button>
</form>
<p id="login-error" style="color: red; margin-top: 10px;"></p>
</div>
<div id="dashboard-section" class="container admin-container" style="display: none;">
<div class="admin-header">
<h2>Manage Books</h2>
<button id="logout-btn" class="admin-btn logout">Logout</button>
</div>
<h3 class="section-title" id="form-title">Add New Book</h3>
<form id="add-book-form">
<div class="admin-form-group">
<label>Book Title</label>
<input type="text" id="book-title" required>
</div>
<div class="admin-form-group">
<label>Author</label>
<input type="text" id="book-author" required>
</div>
<div class="admin-form-group">
<label>Cover Image URL</label>
<input type="url" id="book-cover" required>
</div>
<div class="admin-form-group">
<label>Download Link</label>
<input type="url" id="book-download" required>
</div>
<div class="admin-form-group">
<label>Embed Link (Read Online)</label>
<input type="url" id="book-embed">
</div>
<div class="admin-form-group">
<label>Categories (Select Multiple)</label>
<div id="category-checkboxes-container" style="border: 1px solid #ccc; border-radius: 4px; padding: 10px; max-height: 150px; overflow-y: auto; background: #fff;">
</div>
<small style="color: gray;">Scroll to see more</small>
</div>
<div class="admin-form-group">
<label class="checkbox-item" style="width: fit-content; background: none; padding: 0;">
<input type="checkbox" id="book-featured"> Mark as Featured Book
</label>
</div>
<div style="display: flex; gap: 10px;">
<button type="submit" class="admin-btn" id="submit-btn" style="flex: 1;">Add Book</button>
<button type="button" class="admin-btn" id="cancel-edit-btn" style="background-color: #6c757d; display: none;">Cancel</button>
</div>
</form>
<hr style="margin: 2rem 0;">
<details style="background: #f8fafc; padding: 1rem; border-radius: 8px; border: 1px solid #ddd;">
<summary style="font-weight: bold; cursor: pointer; color: var(--primary);">🚀 Bulk Upload (JSON)</summary>
<textarea id="bulk-json" rows="5" placeholder='[{"title":"Book1" ...}]' style="width: 100%; margin-top:10px;"></textarea>
<button id="bulk-upload-btn" class="admin-btn" style="background-color: #28a745; margin-top: 10px;">Upload All</button>
</details>
<hr style="margin: 2rem 0;">
<div style="display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 1rem;">
<div style="display: flex; align-items: center; gap: 10px;">
<h3 class="section-title" style="margin: 0;">Existing Books</h3>
<button id="toggle-books-btn" style="font-size: 0.8rem; padding: 5px 10px; cursor: pointer; border: 1px solid #ccc; background: #f1f1f1; border-radius: 4px;">Hide List</button>
</div>
<div style="display: flex; gap: 10px; flex-wrap: wrap;">
<input type="text" id="admin-search-input" placeholder="Search title or author..." style="padding: 8px; border-radius: 4px; border: 1px solid #ccc; width: 200px;">
<select id="filter-category" style="padding: 8px; border-radius: 4px; border: 1px solid var(--primary);">
<option value="All">All Categories</option>
</select>
</div>
</div>
<div id="admin-book-list-container">
<div id="admin-book-list"></div>
</div>
</div>
<script type="module" src="js/admin.js"></script>
</body>
</html>