142 lines
6.3 KiB
HTML
142 lines
6.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Manage Users - Parking Manager</title>
|
|
<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>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">
|
|
<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">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">Profilo</a>
|
|
<a href="/settings" class="dropdown-item">Impostazioni</a>
|
|
<hr class="dropdown-divider">
|
|
<button class="dropdown-item" id="logoutButton">Esci</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</aside>
|
|
|
|
<main class="main-content">
|
|
<header class="page-header">
|
|
<h2>Gestione Utenti</h2>
|
|
<div class="header-actions">
|
|
</div>
|
|
</header>
|
|
|
|
<div class="content-wrapper">
|
|
<div class="card">
|
|
<div style="padding-bottom: 1rem; display: flex; justify-content: space-between; align-items: center;">
|
|
<h3 style="margin: 0;">Lista Utenti</h3>
|
|
<input type="text" id="searchInput" class="form-input" placeholder="Cerca utenti..."
|
|
style="max-width: 300px;">
|
|
</div>
|
|
<div class="data-table-container">
|
|
<table class="data-table" id="usersTable">
|
|
<thead>
|
|
<tr>
|
|
<th class="sortable" data-sort="name" style="cursor: pointer;">Nome <span
|
|
class="sort-icon"></span></th>
|
|
<th class="sortable" data-sort="email" style="cursor: pointer;">Email <span
|
|
class="sort-icon"></span></th>
|
|
<th class="sortable" data-sort="role" style="cursor: pointer;">Ruolo <span
|
|
class="sort-icon"></span></th>
|
|
<th class="sortable" data-sort="office_name" style="cursor: pointer;">Ufficio <span
|
|
class="sort-icon"></span></th>
|
|
<th class="sortable" data-sort="parking_ratio" style="cursor: pointer;">Punteggio <span
|
|
class="sort-icon"></span></th>
|
|
<th>Azioni</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="usersBody"></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<!-- Edit User Modal -->
|
|
<div class="modal" id="userModal" style="display: none;">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h3 id="userModalTitle">Modifica Utente</h3>
|
|
<button class="modal-close" id="closeUserModal">×</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form id="userForm">
|
|
<input type="hidden" id="userId">
|
|
|
|
<!-- LDAP notice -->
|
|
<div id="ldapNotice" class="form-notice" style="display: none;">
|
|
<small>Questo utente è gestito da LDAP. Alcuni campi non possono essere modificati.</small>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="editName">Nome</label>
|
|
<input type="text" id="editName" required>
|
|
<small id="nameHelp" class="text-muted" style="display: none;">Gestito da LDAP</small>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="editEmail">Email</label>
|
|
<input type="email" id="editEmail" disabled>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="editRole">Ruolo</label>
|
|
<select id="editRole" required>
|
|
<option value="employee">Dipendente</option>
|
|
<option value="manager">Manager</option>
|
|
<option value="admin">Admin</option>
|
|
</select>
|
|
<small id="roleHelp" class="text-muted" style="display: none;">Il ruolo admin è gestito dal
|
|
gruppo LDAP</small>
|
|
</div>
|
|
<div class="form-group" id="officeGroup">
|
|
<label for="editOffice">Ufficio</label>
|
|
<select id="editOffice">
|
|
<option value="">Nessun ufficio</option>
|
|
</select>
|
|
<small class="text-muted">Ufficio di appartenenza</small>
|
|
</div>
|
|
|
|
<!-- Manager-specific fields -->
|
|
|
|
|
|
<div class="form-actions">
|
|
<button type="button" class="btn btn-secondary" id="cancelUser">Annulla</button>
|
|
<button type="submit" class="btn btn-dark">Salva</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="/js/api.js"></script>
|
|
<script src="/js/utils.js"></script>
|
|
<script src="/js/nav.js"></script>
|
|
<script src="/js/admin-users.js"></script>
|
|
</body>
|
|
|
|
</html> |