-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathadmin.html
More file actions
176 lines (166 loc) · 6.33 KB
/
Copy pathadmin.html
File metadata and controls
176 lines (166 loc) · 6.33 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin — ShareITAIT</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/admin.css">
</head>
<body data-theme="dark">
<!-- Navbar -->
<nav class="navbar" id="navbar">
<div class="container">
<a href="index.html" class="navbar-logo">
<span>ShareIT<span class="gradient-text">AIT</span></span>
</a>
<ul class="navbar-links" id="navLinks">
<li><a href="index.html">Home</a></li>
<li><a href="notes.html">Notes</a></li>
<li><a href="admin.html" class="active">Admin</a></li>
</ul>
<button class="theme-toggle" id="themeToggle" aria-label="Toggle theme">🌙</button>
<button class="mobile-toggle" id="mobileToggle" aria-label="Toggle navigation">
<span></span>
<span></span>
<span></span>
</button>
</div>
</nav>
<div class="mobile-overlay" id="mobileOverlay"></div>
<!-- Login Section (shown when NOT logged in) -->
<section class="admin-login-section" id="loginSection">
<div class="container">
<div class="admin-login-card">
<h2>Admin Login</h2>
<p>Sign in to manage notes.</p>
<form id="loginForm">
<div class="form-group">
<label for="loginEmail">Email</label>
<input type="email" id="loginEmail" placeholder="admin@email.com" required>
</div>
<div class="form-group">
<label for="loginPassword">Password</label>
<input type="password" id="loginPassword" placeholder="Enter password" required>
</div>
<div class="form-error" id="loginError"></div>
<button type="submit" class="btn btn-primary btn-full" id="loginBtn">
Login
</button>
</form>
</div>
</div>
</section>
<!-- Dashboard Section (shown when logged in) -->
<section class="admin-dashboard" id="dashboardSection" style="display:none;">
<div class="container">
<!-- Dashboard Header -->
<div class="dashboard-header">
<div>
<h1>Admin Dashboard</h1>
<p id="adminEmail"></p>
</div>
<div class="dashboard-actions">
<button class="btn btn-primary" id="addNoteBtn">+ Add Note</button>
<button class="btn btn-secondary" id="logoutBtn">Logout</button>
</div>
</div>
<!-- Stats -->
<div class="admin-stats">
<div class="admin-stat-card">
<div class="admin-stat-number" id="totalNotes">0</div>
<div class="admin-stat-label">Total Notes</div>
</div>
<div class="admin-stat-card">
<div class="admin-stat-number" id="totalSubjects">0</div>
<div class="admin-stat-label">Subjects</div>
</div>
</div>
<!-- Notes Table -->
<div class="admin-table-wrapper">
<table class="admin-table" id="notesTable">
<thead>
<tr>
<th>Title</th>
<th>Subject</th>
<th>File Size</th>
<th>Date</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="notesTableBody">
<!-- Rows rendered by JS -->
</tbody>
</table>
<div class="admin-empty" id="adminEmpty" style="display:none;">
<p>No notes yet. Click "Add Note" to get started.</p>
</div>
<div class="admin-loading" id="adminLoading">
<div class="loader-spinner"></div>
<p>Loading notes...</p>
</div>
</div>
</div>
</section>
<!-- Add/Edit Note Modal -->
<div class="modal-overlay" id="noteModal">
<div class="modal-card">
<div class="modal-header">
<h3 id="modalTitle">Add New Note</h3>
<button class="modal-close" id="modalClose">×</button>
</div>
<form id="noteForm">
<div class="form-group">
<label for="noteTitle">Title</label>
<input type="text" id="noteTitle" placeholder="e.g. Unit 1 — Matrices & Determinants" required>
</div>
<div class="form-group">
<label for="noteSubject">Subject</label>
<select id="noteSubject" required>
<option value="">Select subject</option>
<option value="eng-math">Maths</option>
<option value="applied-sci-1">AS I</option>
<option value="applied-sci-2">AS II</option>
<option value="eng-graphics">EGR</option>
<option value="beee">BEEE</option>
<option value="bme">BME</option>
<option value="ppst">PPST</option>
<option value="misc">Misc</option>
</select>
</div>
<div class="form-group">
<label for="noteDriveLink">Google Drive Link</label>
<input type="url" id="noteDriveLink" placeholder="https://drive.google.com/file/d/.../view?usp=sharing" required>
</div>
<div class="form-group">
<label for="noteFileSize">File Size</label>
<input type="text" id="noteFileSize" placeholder="e.g. 2.4 MB" required>
</div>
<input type="hidden" id="noteEditId" value="">
<div class="form-error" id="noteError"></div>
<div class="modal-actions">
<button type="button" class="btn btn-secondary" id="modalCancel">Cancel</button>
<button type="submit" class="btn btn-primary" id="noteSaveBtn">Save Note</button>
</div>
</form>
</div>
</div>
<!-- Delete Confirm Modal -->
<div class="modal-overlay" id="deleteModal">
<div class="modal-card modal-card-sm">
<h3>Delete Note</h3>
<p>Are you sure you want to delete <strong id="deleteNoteName"></strong>? This cannot be undone.</p>
<input type="hidden" id="deleteNoteId" value="">
<div class="modal-actions">
<button class="btn btn-secondary" id="deleteCancelBtn">Cancel</button>
<button class="btn btn-danger" id="deleteConfirmBtn">Delete</button>
</div>
</div>
</div>
<!-- Toast -->
<div class="toast" id="toast"></div>
<script type="module" src="js/admin.js"></script>
</body>
</html>