Voegt boodschappenlijsten, productbeheer, realtime synchronisatie en browsercache-updates toe. Herstelt login- en sessiegedrag en maakt database-seeding herhaalbaar.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
53 lines
2.0 KiB
Plaintext
53 lines
2.0 KiB
Plaintext
<div class="page-header mb-4">
|
|
|
|
<h1>
|
|
|
|
📦 Producten
|
|
|
|
</h1>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-8">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<% if (products.length === 0) { %>
|
|
<p class="text-secondary">Nog geen producten.</p>
|
|
<% } else { %>
|
|
<div class="list-group">
|
|
<% products.forEach(product => { %>
|
|
<div class="list-group-item">
|
|
<strong><%= product.category_icon || "" %> <%= product.name %></strong>
|
|
<div class="text-secondary"><%= product.category_name || "Geen categorie" %></div>
|
|
</div>
|
|
<% }); %>
|
|
</div>
|
|
<% } %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-4">
|
|
<div class="card">
|
|
<div class="card-header"><h3 class="card-title">Nieuw product</h3></div>
|
|
<div class="card-body">
|
|
<form method="post" action="/products">
|
|
<label class="form-label" for="product-name">Productnaam</label>
|
|
<input id="product-name" class="form-control mb-3" type="text" name="name"
|
|
placeholder="bijv. Melk" maxlength="120" required>
|
|
|
|
<label class="form-label" for="category-id">Categorie</label>
|
|
<select id="category-id" class="form-select mb-3" name="category_id">
|
|
<option value="">Geen categorie</option>
|
|
<% (categories || []).forEach(category => { %>
|
|
<option value="<%= category.id %>"><%= category.icon || "" %> <%= category.name %></option>
|
|
<% }); %>
|
|
</select>
|
|
|
|
<button class="btn btn-primary w-100" type="submit">Product toevoegen</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div> |