-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
394 lines (366 loc) · 24.2 KB
/
Copy pathindex.html
File metadata and controls
394 lines (366 loc) · 24.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="theme-color" content="#0066cc">
<meta name="description" content="Application web de gestion du temps de travail hebdomadaire">
<title>Gestion du Temps de Travail</title>
<!-- PWA Manifest -->
<link rel="manifest" href="manifest.json">
<!-- Apple touch icon for iOS -->
<link rel="apple-touch-icon" href="assets/icon-192.png">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<a href="#main-content" class="skip-link">Aller au contenu principal</a>
<div class="container" id="main-content">
<!-- Header -->
<div class="header">
<h1>Gestion du Temps de Travail</h1>
<div class="date-info" id="dateInfo"></div>
</div>
<!-- Main Grid -->
<div class="main-grid">
<!-- Saisie des horaires -->
<div class="card">
<h2>Saisie des Horaires</h2>
<div class="horaires-container">
<!-- Navigation de date -->
<div class="date-section">
<label for="dateSelect">Date : <span id="headerDate" class="label-date"></span></label>
<div class="date-navigation">
<button type="button" class="nav-day-btn" onclick="changerJour(-1)" title="Jour précédent" aria-label="Jour précédent">◀</button>
<input type="date" id="dateSelect" aria-label="Sélectionner une date">
<button type="button" class="nav-day-btn" onclick="changerJour(1)" title="Jour suivant" aria-label="Jour suivant">▶</button>
<button type="button" class="btn-today-date" onclick="retourAujourdhui()" title="Revenir à aujourd'hui" aria-label="Revenir à aujourd'hui">
📅 Aujourd'hui
</button>
</div>
</div>
<!-- Horaires organisés en groupes -->
<div class="horaires-grid">
<!-- Groupe Matin -->
<div class="time-group morning-group">
<h4 class="group-title">🌅 Matin</h4>
<div class="input-group">
<label for="arriveeMatin">Arrivée :</label>
<input type="time" id="arriveeMatin" value="08:00" class="planning-time-input" onchange="updatePlanningHorairesPreview()" min="06:00" max="12:00" aria-label="Heure d'arrivée">
</div>
<div class="input-group">
<label for="sortieMidi">Sortie Midi :</label>
<input type="time" id="sortieMidi" value="12:00" class="planning-time-input" onchange="updatePlanningHorairesPreview()" min="11:00" max="14:00" aria-label="Heure de sortie midi">
</div>
</div>
<!-- Groupe Après-midi -->
<div class="time-group afternoon-group">
<h4 class="group-title">🌇 Après-midi</h4>
<div class="input-group">
<label for="retourMidi">Retour <span id="optionalPM" class="optional-text"></span>:</label>
<input type="time" id="retourMidi" value="13:30" class="planning-time-input" onchange="updatePlanningHorairesPreview()" min="12:00" max="16:00" aria-label="Heure de retour midi">
</div>
<div class="input-group">
<label for="sortieSoir">Sortie <span id="optionalEvening" class="optional-text"></span>:</label>
<input type="time" id="sortieSoir" value="17:15" class="planning-time-input" onchange="updatePlanningHorairesPreview()" min="15:00" max="20:00" aria-label="Heure de sortie soir">
</div>
</div>
</div>
<!-- Actions -->
<div class="buttons-group">
<button class="btn btn-primary" onclick="enregistrerJournee()" aria-label="Enregistrer la journée">Enregistrer</button>
<button class="btn btn-secondary" onclick="effacerFormulaire()" aria-label="Effacer le formulaire">Effacer</button>
<div id="saveMessage" class="save-message"></div>
</div>
</div>
<!-- Gestion du Planning -->
<div class="planning-card" id="planningCard">
<div class="planning-header">
<h3>📅 Planning Hebdomadaire par Défaut</h3>
<button class="collapse-btn" onclick="togglePlanning()" id="planningToggleBtn" aria-label="Replier/Déplier le planning">
<span class="collapse-icon">▼</span>
</button>
</div>
<div id="planningStatus" class="planning-status"></div>
<div class="planning-content" id="planningContent">
<!-- Planning en tableau horizontal -->
<div class="planning-table-container">
<table class="planning-table" id="planningTable">
<thead>
<tr>
<th>Jour</th>
<th>Arrivée</th>
<th>Sortie Midi</th>
<th>Retour Midi</th>
<th>Sortie</th>
<th>Total</th>
</tr>
</thead>
<tbody>
<tr data-day="lundi">
<td class="day-name">Lundi</td>
<td>
<input type="time" id="planning-lundi-arrivee" value="08:00" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="06:00" max="12:00" aria-label="Heure d'arrivée lundi">
</td>
<td>
<input type="time" id="planning-lundi-sortie-midi" value="12:00" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="11:00" max="14:00" aria-label="Heure sortie midi lundi">
</td>
<td>
<input type="time" id="planning-lundi-retour-midi" value="13:30" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="12:00" max="16:00" aria-label="Heure retour midi lundi">
</td>
<td>
<input type="time" id="planning-lundi-sortie" value="17:15" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="15:00" max="20:00" aria-label="Heure sortie lundi">
</td>
<td class="total-cell" id="planning-lundi-total">7h45</td>
</tr>
<tr data-day="mardi">
<td class="day-name">Mardi</td>
<td>
<input type="time" id="planning-mardi-arrivee" value="08:00" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="06:00" max="12:00" aria-label="Heure d'arrivée mardi">
</td>
<td>
<input type="time" id="planning-mardi-sortie-midi" value="12:00" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="11:00" max="14:00" aria-label="Heure sortie midi mardi">
</td>
<td>
<input type="time" id="planning-mardi-retour-midi" value="13:30" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="12:00" max="16:00" aria-label="Heure retour midi mardi">
</td>
<td>
<input type="time" id="planning-mardi-sortie" value="17:15" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="15:00" max="20:00" aria-label="Heure sortie mardi">
</td>
<td class="total-cell" id="planning-mardi-total">7h45</td>
</tr>
<tr data-day="mercredi" class="mercredi-row">
<td class="day-name">Mercredi</td>
<td>
<input type="time" id="planning-mercredi-arrivee" value="08:00" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="06:00" max="12:00" aria-label="Heure d'arrivée mercredi">
</td>
<td>
<input type="time" id="planning-mercredi-sortie-midi" value="12:00" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="11:00" max="14:00" aria-label="Heure sortie midi mercredi">
</td>
<td>
<input type="time" id="planning-mercredi-retour-midi" value="" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="12:00" max="16:00" aria-label="Heure retour midi mercredi (optionnel)" placeholder="Optionnel">
</td>
<td>
<input type="time" id="planning-mercredi-sortie" value="" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="15:00" max="20:00" aria-label="Heure sortie mercredi (optionnel)" placeholder="Optionnel">
</td>
<td class="total-cell" id="planning-mercredi-total">4h00</td>
</tr>
<tr data-day="jeudi">
<td class="day-name">Jeudi</td>
<td>
<input type="time" id="planning-jeudi-arrivee" value="08:00" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="06:00" max="12:00" aria-label="Heure d'arrivée jeudi">
</td>
<td>
<input type="time" id="planning-jeudi-sortie-midi" value="12:00" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="11:00" max="14:00" aria-label="Heure sortie midi jeudi">
</td>
<td>
<input type="time" id="planning-jeudi-retour-midi" value="13:30" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="12:00" max="16:00" aria-label="Heure retour midi jeudi">
</td>
<td>
<input type="time" id="planning-jeudi-sortie" value="17:15" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="15:00" max="20:00" aria-label="Heure sortie jeudi">
</td>
<td class="total-cell" id="planning-jeudi-total">7h45</td>
</tr>
<tr data-day="vendredi">
<td class="day-name">Vendredi</td>
<td>
<input type="time" id="planning-vendredi-arrivee" value="08:00" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="06:00" max="12:00" aria-label="Heure d'arrivée vendredi">
</td>
<td>
<input type="time" id="planning-vendredi-sortie-midi" value="12:00" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="11:00" max="14:00" aria-label="Heure sortie midi vendredi">
</td>
<td>
<input type="time" id="planning-vendredi-retour-midi" value="13:30" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="12:00" max="16:00" aria-label="Heure retour midi vendredi">
</td>
<td>
<input type="time" id="planning-vendredi-sortie" value="17:15" class="planning-time-input" onchange="updatePlanningHorairesPreview()" step="900" min="15:00" max="20:00" aria-label="Heure sortie vendredi">
</td>
<td class="total-cell" id="planning-vendredi-total">7h45</td>
</tr>
</tbody>
</table>
</div>
<!-- Actions du planning -->
<div class="planning-actions">
<button class="btn btn-primary" onclick="appliquerPlanningHorairesDefaut()">💾 Définir comme Planning par Défaut</button>
<button class="btn btn-secondary" onclick="sauvegarderPlanningDialog()">📁 Sauvegarder Planning</button>
<button class="btn btn-secondary" onclick="chargerPlanningDialog()">📂 Charger Planning</button>
<button class="btn btn-secondary" onclick="gererPlanningsSauvegardes()">⚙️ Gérer Plannings</button>
<div id="planningHorairesTotal" class="planning-total">Total: <strong>31.25h</strong></div>
</div>
</div> <!-- Fin planning-content -->
</div>
</div>
<!-- Résumé du jour -->
<div class="card">
<h2>Résumé du Jour</h2>
<div id="resumeJour" class="summary-card">
<h3>📊 Récap Jour <span id="recapJourDate" class="recap-date"></span></h3>
<div class="day-stats">
<div class="stat-item">
<span class="stat-label">Total :</span>
<span id="dayTotal" class="stat-value">0h00</span>
</div>
<div class="stat-item">
<span class="stat-label">Prévu :</span>
<span id="dayPlanned" class="stat-value">0h00</span>
</div>
<div class="stat-item">
<span class="stat-label">Différence :</span>
<span id="dayDiff" class="stat-value">0h00</span>
</div>
</div>
<div id="dayDetails" style="margin-top: 15px; padding-top: 15px; border-top: 1px solid #e0e0e0; font-size: 14px; color: #666;">
<p style="text-align: center;">Saisissez vos horaires pour voir le résumé</p>
</div>
</div>
<!-- Résumé semaine intégré -->
<div id="weekSummaryTop" class="summary-card" style="display: none; margin-top: 20px;">
<h3>📊 Récap Semaine <span id="recapSemaineNumero" class="recap-date"></span></h3>
<div class="week-stats">
<div class="stat-item">
<span class="stat-label">Total :</span>
<span id="weekTotalTop" class="stat-value">0h00</span>
</div>
<div class="stat-item">
<span class="stat-label">Différence :</span>
<span id="weekDiffTop" class="stat-value">0h00</span>
</div>
</div>
</div>
<!-- Récap par jour -->
<div id="dayRecapList" class="summary-card" style="margin-top: 20px;">
<h3>📅 Récap par Jour</h3>
<div id="daysList" class="days-recap">
<!-- Les jours seront ajoutés dynamiquement -->
</div>
</div>
</div>
</div>
<!-- Semaine en cours -->
<div class="card">
<div class="week-header">
<button class="week-nav-btn" onclick="naviguerSemaine(-1)">◀</button>
<div class="week-title-group">
<h2 id="weekTitle">📅 Semaine en Cours</h2>
<button class="btn-today" onclick="retourSemaineActuelle()" title="Retour à la semaine actuelle">
<svg width="14" height="14" fill="currentColor" viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
<path d="M7.5 3a.5.5 0 0 1 .5.5v5.21l3.248 1.856a.5.5 0 0 1-.496.868l-3.5-2A.5.5 0 0 1 7 9V3.5a.5.5 0 0 1 .5-.5z"/>
</svg>
Aujourd'hui
</button>
</div>
<button class="week-nav-btn" onclick="naviguerSemaine(1)">▶</button>
</div>
<div class="table-container">
<table>
<thead>
<tr>
<th>Jour</th>
<th>Date</th>
<th>Arrivée</th>
<th>Départ Midi</th>
<th>Retour Midi</th>
<th>Sortie</th>
<th>Total</th>
<th>Prévu</th>
<th>Diff</th>
<th></th>
</tr>
</thead>
<tbody id="tbodySemaine">
</tbody>
</table>
</div>
<div id="weekSummary" class="summary-card" style="display: none;">
<h3>Total Semaine</h3>
<p>Heures travaillées : <span id="weekTotal">0h00</span></p>
<p>Heures supplémentaires : <span id="weekDiff">0h00</span></p>
</div>
</div>
<!-- Actions Export/Import -->
<div class="card">
<h2>⚙️ Actions</h2>
<!-- Sélecteur de thème -->
<div class="input-group">
<label for="themeSelect">🎨 Thème de l'application :</label>
<select id="themeSelect" class="form-select" onchange="changerTheme()" style="margin-top: 8px;">
<option value="auto">Auto (suit le système)</option>
<option value="light">Clair</option>
<option value="dark">Sombre</option>
</select>
<small style="color: #666; display: block; margin-top: 5px;">
Choisissez l'apparence de l'application
</small>
</div>
<hr style="margin: 20px 0; border: none; border-top: 1px solid #f0f0f0;">
<!-- Sauvegarde automatique -->
<div class="input-group">
<label>
<input type="checkbox" id="sauvegardeAuto" checked onchange="toggleSauvegardeAuto()">
Sauvegarde automatique à chaque enregistrement (Electron uniquement)
</label>
<small style="color: #666; display: block; margin-top: 5px;">
Sauvegarde automatiquement un fichier dans Documents (Electron). En mode navigateur, les données sont sauvegardées dans localStorage uniquement.
</small>
</div>
<hr style="margin: 20px 0; border: none; border-top: 1px solid #f0f0f0;">
<div class="export-section">
<h3>Exports</h3>
<div class="export-controls">
<div class="input-group" style="margin-bottom: 15px;">
<label for="exportPeriod">Période :</label>
<select id="exportPeriod" class="form-select">
<option value="semaine">Semaine actuelle</option>
<option value="mois">Mois actuel</option>
<option value="annee">Année actuelle</option>
<option value="tout">Toutes les données</option>
</select>
</div>
<!-- Alert Box pour exports -->
<div id="alertBox" class="alert"></div>
<div class="export-buttons">
<button class="btn btn-secondary" onclick="exporterAvecPeriode('csv')" aria-label="Exporter en CSV">CSV</button>
<button class="btn btn-secondary" onclick="exporterAvecPeriode('json')" aria-label="Exporter en JSON">JSON</button>
</div>
</div>
</div>
<hr style="margin: 20px 0; border: none; border-top: 1px solid #f0f0f0;">
<div class="restore-section">
<h3>� Restauration</h3>
<p style="color: #d32f2f; font-size: 13px; margin-bottom: 15px;">
⚠️ La restauration écrasera TOUTES les données existantes
</p>
<div class="restore-buttons">
<button class="btn btn-warning" onclick="restaurerFichier('json')">
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M8.5 1.5A1.5 1.5 0 0 0 7 0H4a1.5 1.5 0 0 0-1.5 1.5v13A1.5 1.5 0 0 0 4 16h8a1.5 1.5 0 0 0 1.5-1.5V4.5L8.5 1.5z"/>
<path d="M8 6.5v3a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1 0-1h.5V7a.5.5 0 0 1 .5-.5z"/>
</svg>
Restaurer JSON
</button>
<button class="btn btn-warning" onclick="restaurerFichier('csv')">
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5L14 4.5zM4 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4z"/>
<path d="M3.5 6h9v1h-9V6zm0 2h9v1h-9V8zm0 2h9v1h-9v-1z"/>
</svg>
Restaurer CSV
</button>
</div>
</div>
</div>
</div>
<script src="app.js"></script>
<!-- Service Worker Registration for PWA -->
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js')
.then(reg => console.log('Service Worker registered ✓', reg))
.catch(err => console.log('Service Worker registration failed:', err));
}
</script>
</body>
</html>