From ff0d7398db3c6c3a90085a07536459d4ec32cd9f Mon Sep 17 00:00:00 2001 From: Kerim Atilgan Date: Fri, 15 May 2026 20:27:21 +0200 Subject: [PATCH] UI redesign step 7 (Benutzer-Verwaltung): Stitch style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Header gets the same title/subtitle pair + primary "Neuer Benutzer" pill on the right that the other tabs use, with the person_add glyph. - Table shell now matches Übersicht/Provisionen: bordered white card, surface-container-high header band with label-caps column titles, zebra rows, hover highlight. - "Admin" column renders a verified_user icon for admins and a long dash otherwise instead of the previous green check. The username column shows a small primary "Sie" badge for the logged-in user. - Action column collapses to two icon-only buttons (edit / delete); delete is rendered with reduced opacity and disabled when it is the logged-in user's row. Co-Authored-By: Claude Opus 4.7 (1M context) --- public/index.html | 47 ++++++++++++++++++++++++++++++++--------------- public/script.js | 40 +++++++++++++++++++++++++++++----------- 2 files changed, 61 insertions(+), 26 deletions(-) diff --git a/public/index.html b/public/index.html index 82984a8..cd8ade0 100644 --- a/public/index.html +++ b/public/index.html @@ -1815,22 +1815,39 @@
-

Benutzer-Verwaltung

-
- +
+ + +
+
+

Benutzer-Verwaltung

+

Verwalten Sie die Anmeldedaten und Berechtigungen der Anwender.

+
+ +
+ + +
+
+ + + + + + + + + + + +
UsernameAnzeigenameAdminErstelltAktionen
+
+
- - - - - - - - - - - -
UsernameAnzeigenameAdminErstelltAktionen
diff --git a/public/script.js b/public/script.js index 52fb18b..2ae145d 100644 --- a/public/script.js +++ b/public/script.js @@ -3979,29 +3979,47 @@ document.addEventListener('DOMContentLoaded', function() { async function loadUsers() { const tbody = document.getElementById('usersTableBody'); if (!tbody) return; - tbody.innerHTML = 'Lade...'; + tbody.innerHTML = 'Lade…'; try { const users = await apiRequest('/api/users'); tbody.innerHTML = ''; if (!users.length) { - tbody.innerHTML = 'Keine Benutzer'; + tbody.innerHTML = 'Keine Benutzer'; return; } users.forEach(u => { - const tr = document.createElement('tr'); const isSelf = currentUser && currentUser.username === u.username; + const tr = document.createElement('tr'); + tr.className = 'border-b border-outline-variant/30 even:bg-surface-container-low/50 hover:bg-surface-variant/30 transition-colors'; tr.innerHTML = ` - ${escapeHtml(u.username)}${isSelf ? ' (Sie)' : ''} - ${escapeHtml(u.displayName || '')} - ${u.isAdmin ? '✓' : ''} - ${escapeHtml(formatDateTime(u.createdAt))} - - - + + ${escapeHtml(u.username)} + ${isSelf ? 'Sie' : ''} + + ${escapeHtml(u.displayName || '–')} + + ${u.isAdmin + ? 'verified_user' + : '—'} + + ${escapeHtml(formatDateTime(u.createdAt))} + +
+ + +
`; tr.querySelectorAll('button[data-user-action]').forEach(btn => { btn.addEventListener('click', () => { + if (btn.disabled) return; const action = btn.dataset.userAction; const uuid = btn.dataset.uuid; if (action === 'edit') openUserModal(u); @@ -4011,7 +4029,7 @@ async function loadUsers() { tbody.appendChild(tr); }); } catch (err) { - tbody.innerHTML = 'Fehler beim Laden'; + tbody.innerHTML = 'Fehler beim Laden'; } }