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,39 +1,77 @@
<%- include('layout', { title: 'Artikel' }) %>
<% override body %>
<h2>Artikelverwaltung</h2>
<div class="actions">
<a href="/items/new" class="btn">Neuen Artikel anlegen</a>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Artikel - Frühstückskonten Verwaltung</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>
<h2>Artikelverwaltung</h2>
<div class="actions">
<a href="/items/new" class="btn">Neuen Artikel anlegen</a>
</div>
<table class="data-table">
<thead>
<tr>
<th>Name</th>
<th>Preis</th>
<th>Beschreibung</th>
<th>Aktionen</th>
</tr>
</thead>
<tbody>
<% if (typeof items !== 'undefined' && items.length > 0) { %>
<% items.forEach(function(item) { %>
<tr>
<td><%= item.name %></td>
<td><%= item.price.toFixed(2) %> €</td>
<td><%= item.description || '-' %></td>
<td>
<a href="/items/<%= item.id %>/edit">Bearbeiten</a>
|
<form action="/items/<%= item.id %>/delete" method="POST" style="display: inline;">
<button type="submit" class="btn-danger"
onclick="return confirm('Artikel wirklich löschen?')">Löschen</button>
</form>
</td>
</tr>
<% }); %>
<% } else { %>
<tr>
<td colspan="4">Keine Artikel vorhanden</td>
</tr>
<% } %>
</tbody>
</table>
<p>Gesamt: <%= typeof items !== 'undefined' ? items.length : 0 %> Artikel</p>
</main>
<footer>
<p>&copy; 2024 Frühstückskonten Verwaltung</p>
</footer>
</div>
<table class="data-table">
<thead>
<tr>
<th>Name</th>
<th>Preis</th>
<th>Beschreibung</th>
<th>Aktionen</th>
</tr>
</thead>
<tbody>
<% items.forEach(item => { %>
<tr>
<td><%= item.name %></td>
<td><%= item.price.toFixed(2) %> €</td>
<td><%= item.description || '-' %></td>
<td>
<a href="/items/<%= item.id %>/edit">Bearbeiten</a>
|
<form action="/items/<%= item.id %>/delete" method="POST" style="display: inline;">
<button type="submit" class="btn-danger"
onclick="return confirm('Artikel wirklich löschen?')">Löschen</button>
</form>
</td>
</tr>
<% }); %>
</tbody>
</table>
<p>Gesamt: <%= items.length %> Artikel</p>
<% end %>
</body>
</html>