Files
fruehstuecksapp/views/deposit.ejs

57 lines
2.3 KiB
Plaintext

<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Geld einzahlen - <%= 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>Geld einzahlen für: <%= account.name %></h2>
<p>Aktueller Kontostand: <strong><%= account.balance.toFixed(2) %> €</strong></p>
<form action="/accounts/<%= account.id %>/deposit" method="POST">
<div class="form-group">
<label for="amount">Betrag (€):</label>
<input type="number" id="amount" name="amount" step="0.01" min="0.01" required autofocus>
</div>
<div class="form-group">
<label for="description">Beschreibung (optional):</label>
<input type="text" id="description" name="description">
</div>
<button type="submit" class="btn">Einzahlen</button>
<a href="/accounts/<%= account.id %>", class="btn secondary">Abbrechen</a>
</form>
<% } else { %>
<p>Konto nicht gefunden.</p>
<% } %>
</main>
<footer>
<p>&copy; 2024 Frühstückskonten Verwaltung</p>
</footer>
</div>
</body>
</html>