Frühstückskonten Verwaltung mit PIN-Transaktionshistorie und PDF-Export

This commit is contained in:
Alf
2026-07-14 08:51:51 +02:00
parent 9ad54ae241
commit 5af7e0f809
18 changed files with 2356 additions and 709 deletions

View File

@ -1,25 +1,60 @@
<%- include('layout', { title: 'Konto bearbeiten - ' + account.name }) %>
<% override body %>
<h2>Konto bearbeiten: <%= account.name %></h2>
<form action="/accounts/<%= account.id %>", method="POST">
<div class="form-group">
<label for="name">Name:</label>
<input type="text" id="name" name="name" value="<%= account.name %>", required autofocus>
</div>
<div class="form-group">
<label for="pin">Neue PIN (4-stellig, leer lassen zum Behalten):</label>
<input type="password" id="pin" name="pin" pattern="\d{4}"
title="Bitte genau 4 Ziffern eingeben" maxlength="4">
</div>
<button type="submit" class="btn">Speichern</button>
<a href="/accounts/<%= account.id %>", class="btn secondary">Abbrechen</a>
</form>
<div class="danger-zone">
<h4>Achtung: Kontolöschung</h4>
<p>Das Löschen eines Kontos löscht auch alle zugehörigen Transaktionen!</p>
<!-- Löschfunktion könnte hier hinzugefügt werden -->
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Konto bearbeiten - <%= typeof account !== 'undefined' ? account.name : 'Frühstückskonten' %></title>
<link rel="stylesheet" href="/styles.css">
</head>
<body>
<div class="container">
<header>
<h1>Frühstückskonten Verwaltung</h1>
<% if (typeof user !== 'undefined' && user) { %>
<nav>
<span>Angemeldet als: <strong><%= user.username %></strong> (<%= user.role %>) |
<a href="/dashboard">Dashboard</a> |
<a href="/accounts">Konten</a>
<% if (user.role === 'admin') { %>
| <a href="/items">Artikel</a>
| <a href="/users">Benutzer</a>
<% } %>
| <a href="/logout">Abmelden</a>
</span>
</nav>
<% } %>
</header>
<main>
<% if (typeof account !== 'undefined' && account) { %>
<h2>Konto bearbeiten: <%= account.name %></h2>
<form action="/accounts/<%= account.id %>", method="POST">
<div class="form-group">
<label for="name">Name:</label>
<input type="text" id="name" name="name" value="<%= account.name %>", required autofocus>
</div>
<div class="form-group">
<label for="pin">Neue PIN (4-stellig, leer lassen zum Behalten):</label>
<input type="password" id="pin" name="pin" pattern="\d{4}"
title="Bitte genau 4 Ziffern eingeben" maxlength="4">
</div>
<button type="submit" class="btn">Speichern</button>
<a href="/accounts/<%= account.id %>", class="btn secondary">Abbrechen</a>
</form>
<div class="danger-zone">
<h4>Achtung: Kontolöschung</h4>
<p>Das Löschen eines Kontos löscht auch alle zugehörigen Transaktionen!</p>
</div>
<% } else { %>
<p>Konto nicht gefunden.</p>
<% } %>
</main>
<footer>
<p>&copy; 2024 Frühstückskonten Verwaltung</p>
</footer>
</div>
<% end %>
</body>
</html>