A form builder that keeps forms and responses in TSV files: git-friendly, no database, CSV export.

0 downloads

Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/dbbasic-forms.git
HTTPS
https://gitstable.com/git/askrobots/dbbasic-forms.git
SSH
ssh://git@gitstable.com:2222/askrobots/dbbasic-forms.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

danq9 Fix API handlers for dbbasic-web compatibility (v1.0.1) 143a3f2 1 year, 1 month ago History
responses.html · 17.7 KB · 477 lines
1<!DOCTYPE html>
2<html lang="en">
3<head>
4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <title>Form Responses - dbbasic-forms</title>
7 <link rel="stylesheet" href="../../static/css/admin.css">
8 <style>
9 .responses-header {
10 display: flex;
11 align-items: center;
12 justify-content: space-between;
13 margin-bottom: 2rem;
14 }
15
16 .responses-stats {
17 display: grid;
18 grid-template-columns: repeat(4, 1fr);
19 gap: 1rem;
20 margin-bottom: 2rem;
21 }
22
23 .stat-card {
24 background: var(--surface);
25 border: 1px solid var(--border);
26 border-radius: 0.5rem;
27 padding: 1.5rem;
28 }
29
30 .stat-value {
31 font-size: 2rem;
32 font-weight: 700;
33 color: var(--primary);
34 margin-bottom: 0.5rem;
35 }
36
37 .stat-label {
38 font-size: 0.875rem;
39 color: var(--text-muted);
40 font-weight: 500;
41 }
42
43 .stat-change {
44 font-size: 0.75rem;
45 color: var(--success);
46 margin-top: 0.25rem;
47 }
48
49 .responses-table-container {
50 background: var(--surface);
51 border: 1px solid var(--border);
52 border-radius: 0.5rem;
53 overflow: hidden;
54 }
55
56 .table-controls {
57 display: flex;
58 align-items: center;
59 gap: 1rem;
60 padding: 1rem 1.5rem;
61 border-bottom: 1px solid var(--border);
62 background: var(--bg);
63 }
64
65 .search-box {
66 flex: 1;
67 max-width: 400px;
68 }
69
70 .responses-table {
71 width: 100%;
72 border-collapse: collapse;
73 }
74
75 .responses-table th {
76 background: var(--bg);
77 padding: 0.875rem 1rem;
78 text-align: left;
79 font-weight: 600;
80 font-size: 0.875rem;
81 color: var(--text-muted);
82 border-bottom: 1px solid var(--border);
83 }
84
85 .responses-table td {
86 padding: 1rem;
87 border-bottom: 1px solid var(--border);
88 font-size: 0.875rem;
89 }
90
91 .responses-table tbody tr {
92 cursor: pointer;
93 transition: background 0.15s;
94 }
95
96 .responses-table tbody tr:hover {
97 background: var(--bg);
98 }
99
100 .responses-table tbody tr.selected {
101 background: #eff6ff;
102 }
103
104 .timestamp {
105 color: var(--text-muted);
106 font-size: 0.75rem;
107 }
108
109 .response-status {
110 display: inline-block;
111 padding: 0.25rem 0.625rem;
112 border-radius: 0.25rem;
113 font-size: 0.75rem;
114 font-weight: 600;
115 }
116
117 .status-new {
118 background: #dbeafe;
119 color: #1e40af;
120 }
121
122 .status-read {
123 background: #f3f4f6;
124 color: #6b7280;
125 }
126
127 .pagination {
128 display: flex;
129 align-items: center;
130 justify-content: space-between;
131 padding: 1rem 1.5rem;
132 border-top: 1px solid var(--border);
133 background: var(--bg);
134 }
135
136 .pagination-info {
137 font-size: 0.875rem;
138 color: var(--text-muted);
139 }
140
141 .pagination-controls {
142 display: flex;
143 gap: 0.5rem;
144 }
145
146 .modal {
147 display: none;
148 position: fixed;
149 inset: 0;
150 background: rgba(0, 0, 0, 0.5);
151 align-items: center;
152 justify-content: center;
153 z-index: 1000;
154 }
155
156 .modal.active {
157 display: flex;
158 }
159
160 .modal-content {
161 background: var(--surface);
162 border-radius: 0.5rem;
163 max-width: 600px;
164 width: 90%;
165 max-height: 80vh;
166 overflow-y: auto;
167 }
168
169 .modal-header {
170 display: flex;
171 align-items: center;
172 justify-content: space-between;
173 padding: 1.5rem;
174 border-bottom: 1px solid var(--border);
175 }
176
177 .modal-header h2 {
178 margin: 0;
179 font-size: 1.25rem;
180 }
181
182 .close-modal {
183 background: none;
184 border: none;
185 font-size: 1.5rem;
186 cursor: pointer;
187 color: var(--text-muted);
188 padding: 0;
189 width: 2rem;
190 height: 2rem;
191 display: flex;
192 align-items: center;
193 justify-content: center;
194 border-radius: 0.25rem;
195 }
196
197 .close-modal:hover {
198 background: var(--bg);
199 }
200
201 .modal-body {
202 padding: 1.5rem;
203 }
204
205 .response-field {
206 margin-bottom: 1.5rem;
207 }
208
209 .response-field label {
210 display: block;
211 font-weight: 600;
212 margin-bottom: 0.5rem;
213 font-size: 0.875rem;
214 }
215
216 .response-field-value {
217 padding: 0.75rem;
218 background: var(--bg);
219 border-radius: 0.375rem;
220 font-size: 0.875rem;
221 }
222
223 .modal-footer {
224 display: flex;
225 gap: 0.75rem;
226 padding: 1.5rem;
227 border-top: 1px solid var(--border);
228 }
229 </style>
230</head>
231<body>
232 <div class="studio-container">
233 <header class="studio-header">
234 <div class="logo">
235 <a href="list.html" style="display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: inherit;">
236 <span class="logo-icon">📋</span>
237 <span class="logo-text">dbbasic-forms</span>
238 </a>
239 </div>
240 <div style="flex: 1; text-align: center;">
241 <h1 style="font-size: 1.125rem; font-weight: 600; margin: 0;">Contact Form Responses</h1>
242 </div>
243 <div class="header-actions">
244 <button class="btn-secondary">Export CSV</button>
245 <a href="editor.html" class="btn-primary">Edit Form</a>
246 </div>
247 </header>
248
249 <div class="studio-layout">
250 <nav class="sidebar">
251 <a href="list.html" class="nav-item">
252 <span class="nav-icon">📋</span>
253 <span class="nav-label">All Forms</span>
254 </a>
255 <a href="responses.html" class="nav-item active">
256 <span class="nav-icon">📊</span>
257 <span class="nav-label">Responses</span>
258 </a>
259 <div class="nav-divider"></div>
260 <a href="editor.html" class="nav-item">
261 <span class="nav-icon">✏️</span>
262 <span class="nav-label">Edit Form</span>
263 </a>
264 <a href="#" class="nav-item">
265 <span class="nav-icon">⚙️</span>
266 <span class="nav-label">Settings</span>
267 </a>
268 </nav>
269
270 <main class="main-content">
271 <!-- Stats Cards -->
272 <div class="responses-stats">
273 <div class="stat-card">
274 <div class="stat-value">47</div>
275 <div class="stat-label">Total Responses</div>
276 <div class="stat-change">↑ 12 this week</div>
277 </div>
278 <div class="stat-card">
279 <div class="stat-value">89%</div>
280 <div class="stat-label">Completion Rate</div>
281 <div class="stat-change">↑ 3% vs last week</div>
282 </div>
283 <div class="stat-card">
284 <div class="stat-value">2m 34s</div>
285 <div class="stat-label">Avg. Time</div>
286 <div class="stat-change">↓ 15s faster</div>
287 </div>
288 <div class="stat-card">
289 <div class="stat-value">8</div>
290 <div class="stat-label">New Today</div>
291 <div class="stat-change">↑ 2 vs yesterday</div>
292 </div>
293 </div>
294
295 <!-- Responses Table -->
296 <div class="responses-table-container">
297 <div class="table-controls">
298 <input type="text" class="form-input search-box" placeholder="Search responses...">
299 <select class="form-select" style="width: auto;">
300 <option>All Status</option>
301 <option>New</option>
302 <option>Read</option>
303 </select>
304 <select class="form-select" style="width: auto;">
305 <option>Last 30 days</option>
306 <option>Last 7 days</option>
307 <option>Today</option>
308 <option>All time</option>
309 </select>
310 </div>
311
312 <table class="responses-table">
313 <thead>
314 <tr>
315 <th>Status</th>
316 <th>Name</th>
317 <th>Email</th>
318 <th>Message Preview</th>
319 <th>Submitted</th>
320 <th></th>
321 </tr>
322 </thead>
323 <tbody>
324 <tr onclick="openResponseModal(1)">
325 <td><span class="response-status status-new">New</span></td>
326 <td>Alice Johnson</td>
327 <td>alice@example.com</td>
328 <td style="color: var(--text-muted);">I'm interested in learning more about...</td>
329 <td>
330 <div>2 hours ago</div>
331 <div class="timestamp">Jan 15, 2024 2:30 PM</div>
332 </td>
333 <td>
334 <button class="btn-secondary-small" onclick="event.stopPropagation()">View</button>
335 </td>
336 </tr>
337 <tr onclick="openResponseModal(2)">
338 <td><span class="response-status status-new">New</span></td>
339 <td>Bob Smith</td>
340 <td>bob@example.com</td>
341 <td style="color: var(--text-muted);">Can you help me with pricing information...</td>
342 <td>
343 <div>5 hours ago</div>
344 <div class="timestamp">Jan 15, 2024 11:15 AM</div>
345 </td>
346 <td>
347 <button class="btn-secondary-small" onclick="event.stopPropagation()">View</button>
348 </td>
349 </tr>
350 <tr onclick="openResponseModal(3)" class="selected">
351 <td><span class="response-status status-read">Read</span></td>
352 <td>Charlie Davis</td>
353 <td>charlie@example.com</td>
354 <td style="color: var(--text-muted);">Thanks for the quick response! I'd like to...</td>
355 <td>
356 <div>Yesterday</div>
357 <div class="timestamp">Jan 14, 2024 4:22 PM</div>
358 </td>
359 <td>
360 <button class="btn-secondary-small" onclick="event.stopPropagation()">View</button>
361 </td>
362 </tr>
363 <tr onclick="openResponseModal(4)">
364 <td><span class="response-status status-read">Read</span></td>
365 <td>Diana Wilson</td>
366 <td>diana@example.com</td>
367 <td style="color: var(--text-muted);">I have a question about your services...</td>
368 <td>
369 <div>Yesterday</div>
370 <div class="timestamp">Jan 14, 2024 1:45 PM</div>
371 </td>
372 <td>
373 <button class="btn-secondary-small" onclick="event.stopPropagation()">View</button>
374 </td>
375 </tr>
376 <tr onclick="openResponseModal(5)">
377 <td><span class="response-status status-read">Read</span></td>
378 <td>Ethan Brown</td>
379 <td>ethan@example.com</td>
380 <td style="color: var(--text-muted);">Looking forward to working together...</td>
381 <td>
382 <div>2 days ago</div>
383 <div class="timestamp">Jan 13, 2024 3:10 PM</div>
384 </td>
385 <td>
386 <button class="btn-secondary-small" onclick="event.stopPropagation()">View</button>
387 </td>
388 </tr>
389 <tr onclick="openResponseModal(6)">
390 <td><span class="response-status status-read">Read</span></td>
391 <td>Fiona Martinez</td>
392 <td>fiona@example.com</td>
393 <td style="color: var(--text-muted);">This is exactly what I've been searching for...</td>
394 <td>
395 <div>3 days ago</div>
396 <div class="timestamp">Jan 12, 2024 10:30 AM</div>
397 </td>
398 <td>
399 <button class="btn-secondary-small" onclick="event.stopPropagation()">View</button>
400 </td>
401 </tr>
402 </tbody>
403 </table>
404
405 <div class="pagination">
406 <div class="pagination-info">Showing 1-10 of 47 responses</div>
407 <div class="pagination-controls">
408 <button class="btn-secondary-small" disabled>Previous</button>
409 <button class="btn-secondary-small">1</button>
410 <button class="btn-secondary-small">2</button>
411 <button class="btn-secondary-small">3</button>
412 <button class="btn-secondary-small">Next</button>
413 </div>
414 </div>
415 </div>
416 </main>
417 </div>
418 </div>
419
420 <!-- Response Detail Modal -->
421 <div class="modal" id="responseModal">
422 <div class="modal-content">
423 <div class="modal-header">
424 <h2>Response Details</h2>
425 <button class="close-modal" onclick="closeResponseModal()">×</button>
426 </div>
427 <div class="modal-body">
428 <div class="response-field">
429 <label>Name</label>
430 <div class="response-field-value">Alice Johnson</div>
431 </div>
432 <div class="response-field">
433 <label>Email</label>
434 <div class="response-field-value">alice@example.com</div>
435 </div>
436 <div class="response-field">
437 <label>Message</label>
438 <div class="response-field-value">
439 I'm interested in learning more about your services. I've been looking for a solution like this for a while, and your product seems to be exactly what I need. Could we schedule a call to discuss pricing and implementation details?
440 </div>
441 </div>
442 <div class="response-field">
443 <label>Submitted</label>
444 <div class="response-field-value">January 15, 2024 at 2:30 PM</div>
445 </div>
446 <div class="response-field">
447 <label>Response ID</label>
448 <div class="response-field-value">resp_8f3a9b2c1d</div>
449 </div>
450 </div>
451 <div class="modal-footer">
452 <button class="btn-secondary">Mark as Read</button>
453 <button class="btn-secondary">Export</button>
454 <button class="btn-danger-outline">Delete</button>
455 <button class="btn-primary" style="margin-left: auto;">Reply via Email</button>
456 </div>
457 </div>
458 </div>
459
460 <script>
461 function openResponseModal(id) {
462 document.getElementById('responseModal').classList.add('active');
463 }
464
465 function closeResponseModal() {
466 document.getElementById('responseModal').classList.remove('active');
467 }
468
469 // Close modal when clicking outside
470 document.getElementById('responseModal').addEventListener('click', (e) => {
471 if (e.target.id === 'responseModal') {
472 closeResponseModal();
473 }
474 });
475 </script>
476</body>
477</html>