Add mobile responsiveness and persistent reports feature

- Enhanced mobile responsiveness across entire site and admin panel
  - Optimized layouts, font sizes, and spacing for screens ≤768px and ≤480px
  - Made forms, tables, maps, and buttons touch-friendly
  - Added responsive breakpoints for better mobile experience

- Added persistent reports functionality
  - Added 'persistent' column to database with automatic migration
  - Updated cleanup logic to preserve persistent reports (no auto-expiration)
  - Added admin panel toggle for marking reports as persistent
  - Added persistent report count to admin dashboard stats
  - Visual indicators with lock/unlock icons for persistent status

- Improved admin panel UI
  - Standardized header button styling and sizing
  - Added 'Return to Homepage' button for better navigation
  - Enhanced mobile responsiveness for admin interface
  - Fixed table layouts and button arrangements for mobile devices

- Backend API enhancements
  - New PATCH endpoint for toggling persistent status
  - Updated admin routes to include persistent field
  - Backwards compatible database migration
This commit is contained in:
Deco Vander 2025-07-03 01:17:41 -04:00
parent 5e56d59bbd
commit a3b450de1a
4 changed files with 358 additions and 16 deletions

View file

@ -122,13 +122,39 @@
margin-bottom: 20px;
}
.logout-btn {
background-color: #dc3545;
.header-buttons {
display: flex;
gap: 10px;
align-items: center;
}
.header-btn {
background-color: #6c757d;
color: white;
padding: 8px 16px;
padding: 10px 16px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
text-decoration: none;
display: inline-block;
transition: background-color 0.2s;
}
.header-btn:hover {
opacity: 0.9;
}
.header-btn.btn-refresh {
background-color: #007bff;
}
.header-btn.btn-home {
background-color: #28a745;
}
.header-btn.btn-logout {
background-color: #dc3545;
}
.stats {
@ -158,6 +184,113 @@
text-overflow: ellipsis;
white-space: nowrap;
}
/* Mobile responsiveness for admin panel */
@media (max-width: 768px) {
.admin-container {
padding: 10px;
}
.login-section {
margin: 20px auto;
padding: 20px;
}
.admin-header {
flex-direction: column;
gap: 15px;
text-align: center;
}
.admin-header h1 {
font-size: 1.5em;
margin: 0;
}
.header-buttons {
flex-wrap: wrap;
justify-content: center;
}
.header-btn {
font-size: 12px;
padding: 8px 12px;
}
.stats {
grid-template-columns: repeat(2, 1fr);
gap: 10px;
}
.stat-card {
padding: 15px;
}
.stat-number {
font-size: 1.5em;
}
.locations-table {
font-size: 12px;
}
.locations-table th,
.locations-table td {
padding: 6px 4px;
}
.address-cell {
max-width: 120px;
font-size: 11px;
}
.action-buttons {
flex-direction: column;
gap: 2px;
}
.btn {
padding: 4px 6px;
font-size: 10px;
}
.edit-input {
font-size: 12px;
padding: 2px;
}
}
@media (max-width: 480px) {
.stats {
grid-template-columns: 1fr;
}
.header-buttons {
flex-direction: column;
gap: 8px;
width: 100%;
}
.header-btn {
font-size: 11px;
padding: 6px 10px;
text-align: center;
}
.locations-table th,
.locations-table td {
padding: 4px 2px;
}
.address-cell {
max-width: 100px;
}
.btn {
padding: 3px 4px;
font-size: 9px;
}
}
</style>
</head>
<body>
@ -179,9 +312,10 @@
<div id="admin-section" class="admin-section">
<div class="admin-header">
<h1>🚨 ICE Watch Admin Panel</h1>
<div>
<button id="refresh-btn" class="btn btn-edit">Refresh Data</button>
<button id="logout-btn" class="logout-btn">Logout</button>
<div class="header-buttons">
<a href="/" class="header-btn btn-home">🏠 Homepage</a>
<button id="refresh-btn" class="header-btn btn-refresh">🔄 Refresh Data</button>
<button id="logout-btn" class="header-btn btn-logout">🚪 Logout</button>
</div>
</div>
@ -198,6 +332,10 @@
<div class="stat-number" id="expired-count">0</div>
<div>Expired</div>
</div>
<div class="stat-card">
<div class="stat-number" id="persistent-count">0</div>
<div>Persistent</div>
</div>
</div>
<div class="form-section">
@ -209,13 +347,14 @@
<th>Status</th>
<th>Address</th>
<th>Description</th>
<th>Persistent</th>
<th>Reported</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="locations-tbody">
<tr>
<td colspan="6">Loading...</td>
<td colspan="7">Loading...</td>
</tr>
</tbody>
</table>