Primo commit

This commit is contained in:
2026-01-13 11:20:12 +01:00
parent ce9e2fdf2a
commit 17453f5d13
51 changed files with 3883 additions and 2508 deletions

View File

@@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -7,31 +8,33 @@
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<link rel="stylesheet" href="/css/styles.css">
</head>
<body>
<aside class="sidebar">
<div class="sidebar-header">
<h1>Parking Manager</h1>
<h1>Gestione Parcheggi</h1>
</div>
<nav class="sidebar-nav"></nav>
<div class="sidebar-footer">
<div class="user-menu">
<button class="user-button" id="userMenuButton">
<div class="user-avatar">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
<circle cx="12" cy="7" r="4"></circle>
</svg>
</div>
<div class="user-info">
<div class="user-name" id="userName">Loading...</div>
<div class="user-name" id="userName">Caricamento...</div>
<div class="user-role" id="userRole">-</div>
</div>
</button>
<div class="user-dropdown" id="userDropdown" style="display: none;">
<a href="/profile" class="dropdown-item">Profile</a>
<a href="/settings" class="dropdown-item">Settings</a>
<a href="/profile" class="dropdown-item">Profilo</a>
<a href="/settings" class="dropdown-item">Impostazioni</a>
<hr class="dropdown-divider">
<button class="dropdown-item" id="logoutButton">Logout</button>
<button class="dropdown-item" id="logoutButton">Esci</button>
</div>
</div>
</div>
@@ -39,58 +42,41 @@
<main class="main-content">
<header class="page-header">
<h2>Settings</h2>
<h2>Impostazioni</h2>
</header>
<div class="content-wrapper">
<div class="card">
<div class="card-header">
<h3>Preferences</h3>
</div>
<div class="card-body">
<form id="settingsForm">
<div class="form-group">
<label for="weekStartDay">Week Starts On</label>
<select id="weekStartDay">
<option value="0">Sunday</option>
<option value="1">Monday</option>
</select>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-dark">Save Settings</button>
</div>
</form>
</div>
</div>
<div class="card">
<div class="card-header">
<h3>Parking Notifications</h3>
<h3>Notifiche Parcheggio</h3>
</div>
<div class="card-body">
<form id="notificationForm">
<div class="form-group">
<label class="toggle-label">
<span>Weekly Summary</span>
<span>Riepilogo Settimanale</span>
<label class="toggle-switch">
<input type="checkbox" id="notifyWeeklyParking">
<span class="toggle-slider"></span>
</label>
</label>
<small class="text-muted">Receive weekly parking assignments summary every Friday at 12:00</small>
<small class="text-muted">Ricevi il riepilogo settimanale delle assegnazioni parcheggio ogni
Venerdì alle 12:00</small>
</div>
<div class="form-group">
<label class="toggle-label">
<span>Daily Reminder</span>
<span>Promemoria Giornaliero</span>
<label class="toggle-switch">
<input type="checkbox" id="notifyDailyParking">
<span class="toggle-slider"></span>
</label>
</label>
<small class="text-muted">Receive daily parking reminder on working days</small>
<small class="text-muted">Ricevi promemoria giornaliero nei giorni lavorativi</small>
</div>
<div class="form-group" id="dailyTimeGroup" style="margin-left: 1rem;">
<label>Reminder Time</label>
<label>Orario Promemoria</label>
<div style="display: flex; gap: 0.5rem; align-items: center;">
<select id="notifyDailyHour" style="width: 80px;">
<!-- Hours populated by JS -->
@@ -106,16 +92,17 @@
</div>
<div class="form-group">
<label class="toggle-label">
<span>Assignment Changes</span>
<span>Cambiamenti Assegnazione</span>
<label class="toggle-switch">
<input type="checkbox" id="notifyParkingChanges">
<span class="toggle-slider"></span>
</label>
</label>
<small class="text-muted">Receive immediate notifications when your parking assignment changes</small>
<small class="text-muted">Ricevi notifiche immediate quando la tua assegnazione del
parcheggio cambia</small>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-dark">Save Notifications</button>
<button type="submit" class="btn btn-dark">Salva Notifiche</button>
</div>
</form>
</div>
@@ -151,7 +138,7 @@
}
function populateForm() {
document.getElementById('weekStartDay').value = currentUser.week_start_day || 0;
// Notification settings
// Notification settings
document.getElementById('notifyWeeklyParking').checked = currentUser.notify_weekly_parking !== 0;
@@ -170,22 +157,7 @@
function setupEventListeners() {
// Settings form
document.getElementById('settingsForm').addEventListener('submit', async (e) => {
e.preventDefault();
const data = {
week_start_day: parseInt(document.getElementById('weekStartDay').value)
};
const response = await api.put('/api/users/me/settings', data);
if (response && response.ok) {
utils.showMessage('Settings saved successfully', 'success');
currentUser = await api.getCurrentUser();
} else {
const error = await response.json();
utils.showMessage(error.detail || 'Failed to save settings', 'error');
}
});
// Notification form
document.getElementById('notificationForm').addEventListener('submit', async (e) => {
@@ -201,11 +173,11 @@
const response = await api.put('/api/users/me/settings', data);
if (response && response.ok) {
utils.showMessage('Notification settings saved', 'success');
utils.showMessage('Impostazioni notifiche salvate', 'success');
currentUser = await api.getCurrentUser();
} else {
const error = await response.json();
utils.showMessage(error.detail || 'Failed to save notifications', 'error');
utils.showMessage(error.detail || 'Impossibile salvare le notifiche', 'error');
}
});
@@ -214,4 +186,5 @@
}
</script>
</body>
</html>
</html>