61 lines
2.5 KiB
Plaintext
61 lines
2.5 KiB
Plaintext
<!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>© 2024 Frühstückskonten Verwaltung</p>
|
|
</footer>
|
|
</div>
|
|
</body>
|
|
</html>
|