205 lines
9.6 KiB
HTML
205 lines
9.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Team Calendar - 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>Calendario del Team</h2>
|
|
<div class="header-actions">
|
|
</div>
|
|
</header>
|
|
|
|
<div class="content-wrapper">
|
|
<div class="card">
|
|
<div style="display: flex; gap: 1rem; margin-bottom: 1.5rem;">
|
|
<select id="viewToggle" class="form-select" style="min-width: 150px;">
|
|
<option value="week">Settimana</option>
|
|
<option value="month">Mese</option>
|
|
</select>
|
|
<select id="officeFilter" class="form-select" style="min-width: 200px;">
|
|
<option value="">Tutti gli Uffici</option>
|
|
</select>
|
|
</div>
|
|
|
|
|
|
<div id="office-display-header"
|
|
style="margin-bottom: 1rem; font-weight: 600; font-size: 1.1rem; color: var(--text);">
|
|
Ufficio: <span id="currentOfficeNameDisplay" style="color: var(--primary);">Loading...</span>
|
|
</div>
|
|
|
|
<div class="calendar-header">
|
|
<button class="btn-icon" id="prevWeek">
|
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
stroke-width="2">
|
|
<polyline points="15 18 9 12 15 6"></polyline>
|
|
</svg>
|
|
</button>
|
|
<h3 id="currentWeek">Caricamento...</h3>
|
|
<button class="btn-icon" id="nextWeek">
|
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
stroke-width="2">
|
|
<polyline points="9 18 15 12 9 6"></polyline>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
|
|
<div class="team-calendar-container">
|
|
<table class="team-calendar team-calendar-table" id="teamCalendarTable">
|
|
<thead>
|
|
<tr id="calendarHeader"></tr>
|
|
</thead>
|
|
<tbody id="calendarBody"></tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="legend">
|
|
<div class="legend-item">
|
|
<div class="legend-color status-present"></div>
|
|
<span>In sede</span>
|
|
</div>
|
|
<div class="legend-item">
|
|
<div class="legend-color status-remote"></div>
|
|
<span>Remoto</span>
|
|
</div>
|
|
<div class="legend-item">
|
|
<div class="legend-color status-absent"></div>
|
|
<span>Ferie</span>
|
|
</div>
|
|
<div class="legend-item">
|
|
<div class="legend-color status-business_trip"></div>
|
|
<span>Trasferta</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Export Card (Admin/Manager only) -->
|
|
<div id="exportCard" class="card" style="display: none;">
|
|
<h3 style="margin-top: 0; margin-bottom: 1rem; font-size: 1.1rem;">Esporta Report</h3>
|
|
<div style="display: flex; gap: 1rem; align-items: flex-end;">
|
|
<div>
|
|
<small style="display: block; margin-bottom: 0.25rem;">Da:</small>
|
|
<input type="date" id="exportStartDate" class="form-control">
|
|
</div>
|
|
<div>
|
|
<small style="display: block; margin-bottom: 0.25rem;">A:</small>
|
|
<input type="date" id="exportEndDate" class="form-control">
|
|
</div>
|
|
<button id="exportBtn" class="btn btn-dark" style="height: 38px;">
|
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
stroke-width="2" style="margin-right: 0.5rem;">
|
|
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
|
|
<polyline points="7 10 12 15 17 10"></polyline>
|
|
<line x1="12" y1="15" x2="12" y2="3"></line>
|
|
</svg>
|
|
Esporta Excel
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<!-- Day Status Modal (Shared Structure) -->
|
|
<div class="modal" id="dayModal" style="display: none;">
|
|
<div class="modal-content modal-small">
|
|
<div class="modal-header">
|
|
<h3 id="dayModalTitle">Segna Presenza</h3>
|
|
<button class="modal-close" id="closeDayModal">×</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<p id="dayModalUser" style="display:none; margin-bottom: 1rem; font-weight: 500;"></p>
|
|
<div class="status-buttons">
|
|
<button class="status-btn" data-status="present">
|
|
<div class="status-icon status-present"></div>
|
|
<span>In sede</span>
|
|
</button>
|
|
<button class="status-btn" data-status="remote">
|
|
<div class="status-icon status-remote"></div>
|
|
<span>Remoto</span>
|
|
</button>
|
|
<button class="status-btn" data-status="absent">
|
|
<div class="status-icon status-absent"></div>
|
|
<span>Ferie</span>
|
|
</button>
|
|
<button class="status-btn" data-status="business_trip">
|
|
<div class="status-icon status-business_trip"></div>
|
|
<span>Trasferta</span>
|
|
</button>
|
|
</div>
|
|
<button class="btn btn-secondary btn-full" id="clearDayBtn" style="margin-top: 1rem;">Cancella
|
|
Presenza</button>
|
|
|
|
<div id="parkingSection"
|
|
style="display: none; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border);">
|
|
<div id="parkingInfo" style="margin-bottom: 0.75rem; font-size: 0.9rem;"></div>
|
|
|
|
<div id="parkingActions" style="display: flex; gap: 0.5rem;">
|
|
<button class="btn btn-secondary" style="flex: 1;" id="reassignParkingBtn">Cedi posto</button>
|
|
<button class="btn btn-secondary" style="flex: 1;" id="releaseParkingBtn">Lascia libero</button>
|
|
</div>
|
|
|
|
<div id="reassignForm"
|
|
style="display: none; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem;">
|
|
<div class="form-group" style="margin-bottom: 0.5rem;">
|
|
<label for="reassignUser" style="font-size: 0.9rem;">Assegna a</label>
|
|
<select id="reassignUser" class="form-control" style="width: 100%;">
|
|
<option value="">Seleziona utente...</option>
|
|
</select>
|
|
</div>
|
|
<div style="display: flex; gap: 0.5rem;">
|
|
<button type="button" class="btn btn-secondary" style="flex: 1;"
|
|
id="cancelReassign">Annulla</button>
|
|
<button type="button" class="btn btn-dark" style="flex: 1;"
|
|
id="confirmReassign">Riassegna</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="/js/api.js"></script>
|
|
<script src="/js/utils.js"></script>
|
|
<script src="/js/nav.js"></script>
|
|
<script src="/js/modal-logic.js"></script>
|
|
<script src="/js/team-calendar.js"></script>
|
|
</body>
|
|
|
|
</html> |