abdullahalioo commited on
Commit
7981fb7
·
verified ·
1 Parent(s): 9bb74cd

Update templates/admin.html

Browse files
Files changed (1) hide show
  1. templates/admin.html +94 -21
templates/admin.html CHANGED
@@ -1,5 +1,6 @@
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">
@@ -8,6 +9,7 @@
8
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
9
  <link href="{{ url_for('static', filename='css/style.css') }}" rel="stylesheet">
10
  </head>
 
11
  <body>
12
  <nav class="navbar navbar-expand-lg">
13
  <div class="container">
@@ -26,14 +28,15 @@
26
 
27
  <div class="container-fluid mt-4">
28
  {% with messages = get_flashed_messages(with_categories=true) %}
29
- {% if messages %}
30
- {% for category, message in messages %}
31
- <div class="alert alert-{{ 'danger' if category == 'error' else category }} alert-dismissible fade show" role="alert">
32
- {{ message }}
33
- <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
34
- </div>
35
- {% endfor %}
36
- {% endif %}
 
37
  {% endwith %}
38
 
39
  <div class="row mb-4">
@@ -124,7 +127,8 @@
124
  <div class="table-controls mb-3">
125
  <div class="row">
126
  <div class="col-md-6">
127
- <input type="text" id="searchInput" class="form-control" placeholder="Search tickets...">
 
128
  </div>
129
  <div class="col-md-6">
130
  <select id="countryFilter" class="form-select">
@@ -136,7 +140,7 @@
136
  </div>
137
  </div>
138
  </div>
139
-
140
  <div class="table-responsive">
141
  <table class="table" id="ticketsTable">
142
  <thead>
@@ -175,21 +179,28 @@
175
  <td>{{ ticket.phone }}</td>
176
  <td>{{ ticket.name }}</td>
177
  <td>
178
- <span style="background: #f0f9ff; color: #0369a1; padding: 0.25rem 0.5rem; border-radius: 6px; font-size: 12px; font-weight: 500;">{{ ticket.tickets }}</span>
 
 
179
  </td>
180
  <td>
181
- <span style="background: #f8fafc; color: #475569; padding: 0.25rem 0.5rem; border-radius: 4px; font-family: 'Monaco', monospace; font-size: 12px;">{{ ticket.ticket_number }}</span>
 
 
182
  </td>
183
  <td>{{ ticket.country }}</td>
184
  <td>{{ ticket.region }}</td>
185
  <td>
186
- <span style="color: var(--text-secondary); font-size: 12px;">{{ ticket.timestamp }}</span>
 
187
  </td>
188
  <td>
189
- <form method="POST" action="{{ url_for('delete_ticket', ticket_number=ticket.ticket_number) }}"
190
- style="display: inline;"
191
- onsubmit="return confirm('Are you sure you want to delete this ticket?')">
192
- <button type="submit" class="btn btn-outline-danger" style="padding: 0.375rem 0.5rem; font-size: 12px;">
 
 
193
  <i class="fas fa-trash" style="font-size: 11px;"></i>
194
  </button>
195
  </form>
@@ -203,7 +214,8 @@
203
  <div class="d-flex justify-content-between align-items-center mt-3">
204
  <div>
205
  <small class="text-muted">
206
- Showing <span id="showingCount">{{ tickets|length }}</span> of {{ total_tickets }} records
 
207
  </small>
208
  </div>
209
  <div>
@@ -217,7 +229,8 @@
217
  <div class="text-center py-5">
218
  <i class="fas fa-inbox fa-4x text-muted mb-3"></i>
219
  <h4 class="text-muted">No Ticket Data Available</h4>
220
- <p class="text-muted">No tickets have been submitted yet. Use the API endpoint to add ticket data.</p>
 
221
  <a href="{{ url_for('index') }}" class="btn btn-primary">
222
  <i class="fas fa-plus me-1"></i>
223
  View API Documentation
@@ -229,6 +242,65 @@
229
  </div>
230
  </div>
231
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
 
233
  <footer class="bg-dark text-light mt-5 py-4">
234
  <div class="container text-center">
@@ -243,9 +315,10 @@
243
  <script src="{{ url_for('static', filename='js/main.js') }}"></script>
244
  <script>
245
  // Auto-refresh every 30 seconds
246
- setInterval(function() {
247
  document.getElementById('lastUpdated').textContent = new Date().toISOString().slice(0, 19).replace('T', ' ');
248
  }, 30000);
249
  </script>
250
  </body>
251
- </html>
 
 
1
  <!DOCTYPE html>
2
  <html lang="en">
3
+
4
  <head>
5
  <meta charset="UTF-8">
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
 
9
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
10
  <link href="{{ url_for('static', filename='css/style.css') }}" rel="stylesheet">
11
  </head>
12
+
13
  <body>
14
  <nav class="navbar navbar-expand-lg">
15
  <div class="container">
 
28
 
29
  <div class="container-fluid mt-4">
30
  {% with messages = get_flashed_messages(with_categories=true) %}
31
+ {% if messages %}
32
+ {% for category, message in messages %}
33
+ <div class="alert alert-{{ 'danger' if category == 'error' else category }} alert-dismissible fade show"
34
+ role="alert">
35
+ {{ message }}
36
+ <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
37
+ </div>
38
+ {% endfor %}
39
+ {% endif %}
40
  {% endwith %}
41
 
42
  <div class="row mb-4">
 
127
  <div class="table-controls mb-3">
128
  <div class="row">
129
  <div class="col-md-6">
130
+ <input type="text" id="searchInput" class="form-control"
131
+ placeholder="Search tickets...">
132
  </div>
133
  <div class="col-md-6">
134
  <select id="countryFilter" class="form-select">
 
140
  </div>
141
  </div>
142
  </div>
143
+
144
  <div class="table-responsive">
145
  <table class="table" id="ticketsTable">
146
  <thead>
 
179
  <td>{{ ticket.phone }}</td>
180
  <td>{{ ticket.name }}</td>
181
  <td>
182
+ <span
183
+ style="background: #f0f9ff; color: #0369a1; padding: 0.25rem 0.5rem; border-radius: 6px; font-size: 12px; font-weight: 500;">{{
184
+ ticket.tickets }}</span>
185
  </td>
186
  <td>
187
+ <span
188
+ style="background: #f8fafc; color: #475569; padding: 0.25rem 0.5rem; border-radius: 4px; font-family: 'Monaco', monospace; font-size: 12px;">{{
189
+ ticket.ticket_number }}</span>
190
  </td>
191
  <td>{{ ticket.country }}</td>
192
  <td>{{ ticket.region }}</td>
193
  <td>
194
+ <span style="color: var(--text-secondary); font-size: 12px;">{{
195
+ ticket.timestamp }}</span>
196
  </td>
197
  <td>
198
+ <form method="POST"
199
+ action="{{ url_for('delete_ticket', ticket_number=ticket.ticket_number) }}"
200
+ style="display: inline;"
201
+ onsubmit="return confirm('Are you sure you want to delete this ticket?')">
202
+ <button type="submit" class="btn btn-outline-danger"
203
+ style="padding: 0.375rem 0.5rem; font-size: 12px;">
204
  <i class="fas fa-trash" style="font-size: 11px;"></i>
205
  </button>
206
  </form>
 
214
  <div class="d-flex justify-content-between align-items-center mt-3">
215
  <div>
216
  <small class="text-muted">
217
+ Showing <span id="showingCount">{{ tickets|length }}</span> of {{ total_tickets }}
218
+ records
219
  </small>
220
  </div>
221
  <div>
 
229
  <div class="text-center py-5">
230
  <i class="fas fa-inbox fa-4x text-muted mb-3"></i>
231
  <h4 class="text-muted">No Ticket Data Available</h4>
232
+ <p class="text-muted">No tickets have been submitted yet. Use the API endpoint to add ticket
233
+ data.</p>
234
  <a href="{{ url_for('index') }}" class="btn btn-primary">
235
  <i class="fas fa-plus me-1"></i>
236
  View API Documentation
 
242
  </div>
243
  </div>
244
  </div>
245
+ <!-- Add this section after the ticket statistics cards -->
246
+ <div class="row mb-4">
247
+ <div class="col-12">
248
+ <div class="card">
249
+ <div class="card-header">
250
+ <h5 class="card-title mb-0" style="font-size: 16px; font-weight: 600;">
251
+ <i class="fas fa-clock me-2" style="color: var(--accent-color);"></i>
252
+ Waiting List for Next Event
253
+ <span class="badge bg-primary ms-2">{{ total_waiting }}</span>
254
+ </h5>
255
+ </div>
256
+ <div class="card-body">
257
+ {% if waiting_list %}
258
+ <div class="table-responsive">
259
+ <table class="table" id="waitingTable">
260
+ <thead>
261
+ <tr>
262
+ <th>Email</th>
263
+ <th>Website</th>
264
+ <th>Sign-up Date</th>
265
+ <th>Actions</th>
266
+ </tr>
267
+ </thead>
268
+ <tbody>
269
+ {% for entry in waiting_list %}
270
+ <tr>
271
+ <td>{{ entry.email }}</td>
272
+ <td>{{ entry.website or 'Not provided' }}</td>
273
+ <td>
274
+ <span style="color: var(--text-secondary); font-size: 12px;">{{ entry.timestamp
275
+ }}</span>
276
+ </td>
277
+ <td>
278
+ <form method="POST"
279
+ action="{{ url_for('delete_waiting_entry', entry_id=entry.id) }}"
280
+ style="display: inline;"
281
+ onsubmit="return confirm('Are you sure you want to remove this email from the waiting list?')">
282
+ <button type="submit" class="btn btn-outline-danger"
283
+ style="padding: 0.375rem 0.5rem; font-size: 12px;">
284
+ <i class="fas fa-trash" style="font-size: 11px;"></i>
285
+ </button>
286
+ </form>
287
+ </td>
288
+ </tr>
289
+ {% endfor %}
290
+ </tbody>
291
+ </table>
292
+ </div>
293
+ {% else %}
294
+ <div class="text-center py-4">
295
+ <i class="fas fa-clock fa-3x text-muted mb-3"></i>
296
+ <h5 class="text-muted">No one waiting yet</h5>
297
+ <p class="text-muted">People who sign up for your next event will appear here.</p>
298
+ </div>
299
+ {% endif %}
300
+ </div>
301
+ </div>
302
+ </div>
303
+ </div>
304
 
305
  <footer class="bg-dark text-light mt-5 py-4">
306
  <div class="container text-center">
 
315
  <script src="{{ url_for('static', filename='js/main.js') }}"></script>
316
  <script>
317
  // Auto-refresh every 30 seconds
318
+ setInterval(function () {
319
  document.getElementById('lastUpdated').textContent = new Date().toISOString().slice(0, 19).replace('T', ' ');
320
  }, 30000);
321
  </script>
322
  </body>
323
+
324
+ </html>