v2.2.0: 3-Stufen-Sichtbarkeit, UX-Verbesserungen, Auto-Erkennung

- 3 Sichtbarkeitsstufen für Vorlagen: Persönlich / Abteilung / Alle
- Persönliche Vorlagen werden in _benutzer/{email}/ synchronisiert
- Sichtbarkeit direkt in der Liste per Dropdown änderbar
- Warnung beim Verringern der Sichtbarkeit (Server-Löschung)
- Auto-Erkennung von Abteilung + E-Mail via _config/abteilungen.json
- Toast-Benachrichtigungen statt unsichtbare Status-Badges
- Lade-Spinner bei Sync-Operationen
- Sync-Dots mit Symbolen (nicht nur Farbe) für Barrierefreiheit
- Custom Delete-Modal statt browser confirm()
- Collapsible-Sections visuell als klickbar erkennbar
- Token-Feld mit Show/Hide-Toggle
- Inline-Validierung für Template-Namen
- Checkbox-Klickflächen vergrößert + Label-Klick
- Offline-Erkennung mit Banner
- Font-Dropdown Viewport-Fix
- Popup: Prefix-Dropdown verständlicher
- Signaturen: erste Identität automatisch ausgewählt
- README komplett neu geschrieben
This commit is contained in:
Kendrick Bollens
2026-05-06 22:04:46 +02:00
parent 33eb87613e
commit 864be54646
8 changed files with 861 additions and 160 deletions

View File

@@ -327,17 +327,25 @@
.template-item:hover { background: #fafff8; }
.template-item input[type="checkbox"] {
width: 16px;
height: 16px;
margin-right: 12px;
width: 18px;
height: 18px;
margin-right: 0;
accent-color: #4a7c59;
cursor: pointer;
flex-shrink: 0;
}
.template-label {
display: flex;
align-items: center;
flex: 1;
cursor: pointer;
gap: 10px;
}
.template-name {
font-weight: 500;
font-size: 13.5px;
flex: 1;
}
.template-actions { display: flex; gap: 6px; }
@@ -354,8 +362,9 @@
.template-actions .push-btn,
.template-actions .pull-btn {
font-weight: bold;
font-size: 14px;
font-weight: 500;
font-size: 12px;
white-space: nowrap;
}
.template-actions .push-btn { color: #4a7c59; }
.template-actions .push-btn:hover { background: #e8f0eb; border-color: #4a7c59; }
@@ -510,6 +519,208 @@
border: 1px dashed #e0e0e0;
border-radius: 6px;
}
/* Badges for shared/private */
.badge {
display: inline-flex;
align-items: center;
gap: 3px;
font-size: 11px;
font-weight: 500;
padding: 2px 8px;
border-radius: 10px;
margin-left: 8px;
white-space: nowrap;
}
.badge-shared { background: #e3f2fd; color: #1565c0; }
.badge-dept { background: #fff3e0; color: #e65100; }
.badge-private { background: #f3e5f5; color: #7b1fa2; }
/* Badge as inline select */
select.scope-select {
border: none;
font-size: 11px;
font-weight: 500;
padding: 2px 4px 2px 8px;
border-radius: 10px;
cursor: pointer;
margin-left: 8px;
outline: none;
}
select.scope-select.badge-shared { background: #e3f2fd; color: #1565c0; }
select.scope-select.badge-dept { background: #fff3e0; color: #e65100; }
select.scope-select.badge-private { background: #f3e5f5; color: #7b1fa2; }
/* Toast notifications */
#toast-container {
position: fixed;
bottom: 20px;
right: 20px;
z-index: 9999;
display: flex;
flex-direction: column;
gap: 8px;
max-width: 320px;
}
.toast {
padding: 12px 16px;
border-radius: 8px;
font-size: 13px;
color: white;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
animation: toast-in 0.3s ease;
display: flex;
align-items: center;
gap: 8px;
}
.toast-success { background: #43a047; }
.toast-error { background: #e53935; }
.toast-info { background: #1e88e5; }
.toast-out { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; transform: translateY(10px); } }
/* Spinner */
.spinner {
display: inline-block;
width: 14px;
height: 14px;
border: 2px solid rgba(255,255,255,0.3);
border-top-color: currentColor;
border-radius: 50%;
animation: spin 0.6s linear infinite;
vertical-align: middle;
}
.spinner-dark {
border-color: rgba(0,0,0,0.15);
border-top-color: #4a7c59;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* Improved sync dots */
.sync-dot.in-sync::after {
content: "✓";
font-size: 8px;
color: white;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.sync-dot.out-of-sync::after {
content: "!";
font-size: 8px;
font-weight: bold;
color: white;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.sync-dot {
position: relative;
width: 14px;
height: 14px;
}
/* Collapsible improvements */
.collapsible-header {
background: #f9f9f9;
border: 1px solid #e8e8e8;
border-radius: 6px;
padding: 8px 12px;
margin-bottom: 4px;
}
.collapsible-header:hover {
background: #f0f5f1;
border-color: #c0d4c7;
}
.collapsible-header .arrow { font-size: 13px; }
/* Token toggle */
.password-wrapper {
position: relative;
}
.password-wrapper input {
padding-right: 36px;
}
.password-toggle {
position: absolute;
right: 8px;
top: 50%;
transform: translateY(-50%);
border: none;
background: none;
cursor: pointer;
color: #999;
padding: 2px;
line-height: 1;
}
.password-toggle:hover { color: #555; }
/* Offline banner */
.offline-banner {
display: none;
background: #ff9800;
color: white;
text-align: center;
padding: 10px;
font-size: 13px;
font-weight: 500;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 9998;
}
.offline-banner.visible { display: block; }
/* Confirm modal */
.modal-backdrop {
display: none;
position: fixed;
inset: 0;
background: rgba(0,0,0,0.4);
z-index: 10000;
align-items: center;
justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal-card {
background: white;
border-radius: 10px;
padding: 24px;
max-width: 400px;
width: 90%;
box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal-card h3 {
font-size: 16px;
margin-bottom: 12px;
color: #333;
}
.modal-card p {
font-size: 13px;
color: #666;
margin-bottom: 20px;
line-height: 1.5;
}
.modal-actions {
display: flex;
gap: 8px;
justify-content: flex-end;
}
/* Validation */
.input-error { border-color: #e53935 !important; }
.input-valid { border-color: #43a047 !important; }
.validation-msg {
font-size: 11px;
margin-top: -6px;
margin-bottom: 8px;
}
.validation-msg.error { color: #e53935; }
.validation-msg.success { color: #43a047; }
</style>
</head>
<body>
@@ -584,9 +795,13 @@
<input type="file" id="tpl-image-file" accept="image/*" style="display:none;">
</div>
<div style="display:flex;align-items:center;gap:8px;margin-bottom:10px;">
<input type="checkbox" id="tpl-shared-toggle" style="width:16px;height:16px;accent-color:#4a7c59;">
<label for="tpl-shared-toggle" style="margin-bottom:0;cursor:pointer;">Für alle Abteilungen (<code>_gemeinsam</code>)</label>
<div class="form-group">
<label for="tpl-scope-select">Sichtbarkeit</label>
<select id="tpl-scope-select" style="width:100%;">
<option value="private" selected>Persönlich (nur ich, auf allen meinen Geräten)</option>
<option value="department">Meine Abteilung</option>
<option value="shared">Alle Abteilungen</option>
</select>
</div>
<button type="submit" class="btn btn-primary" id="save-button">Speichern</button>
@@ -811,7 +1026,10 @@
</div>
<div class="form-group">
<label for="sync-token">API-Token</label>
<input type="password" id="sync-token" placeholder="Token aus Gitea-Einstellungen">
<div class="password-wrapper">
<input type="password" id="sync-token" placeholder="Token aus Gitea-Einstellungen">
<button type="button" class="password-toggle" id="token-toggle" title="Token anzeigen/verbergen"><span class="mdi mdi-eye"></span></button>
</div>
</div>
</div>
@@ -825,6 +1043,24 @@
<div id="sync-log"></div>
</div>
<!-- Offline Banner -->
<div id="offline-banner" class="offline-banner">Keine Internetverbindung Synchronisation nicht möglich</div>
<!-- Toast Container -->
<div id="toast-container"></div>
<!-- Confirm Modal -->
<div id="confirm-modal" class="modal-backdrop">
<div class="modal-card">
<h3 id="modal-title"></h3>
<p id="modal-message"></p>
<div class="modal-actions">
<button type="button" class="btn btn-secondary" id="modal-cancel">Abbrechen</button>
<button type="button" class="btn btn-danger" id="modal-confirm">Löschen</button>
</div>
</div>
</div>
<script src="templates_options.js"></script>
</body>
</html>