Werk hoofdapplicatie bij

Legt de bestaande wijzigingen in de hoofdworktree vast voordat de laatste worktree wordt gemerged.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-08-07 20:45:36 +02:00
parent 26a820b41a
commit c07d503d83
41 changed files with 1837 additions and 313 deletions
+112 -34
View File
@@ -1,71 +1,149 @@
<div class="page-header mb-4">
<h1>
📦 Producten
</h1>
<h1>📦 Producten</h1>
</div>
<div class="row">
<div class="col-md-8">
<div class="card">
<div class="card">
<div class="card-body">
<div class="card-body">
<% if(products.length === 0) { %>
<% if(products.length === 0) { %>
<p class="text-secondary">Nog geen producten.</p>
<% } else { %>
<p>
<div class="list-group">
Nog geen producten.
<%
const grouped = {};
products.forEach(p => {
const cat = p.category_name || 'Overig';
if (!grouped[cat]) grouped[cat] = [];
grouped[cat].push(p);
});
%>
</p>
<% Object.keys(grouped).sort().forEach(cat => { %>
<div class="list-group-item list-group-item-info">
<% } %>
<strong><%= cat %></strong>
</div>
<% grouped[cat].forEach(product => { %>
<div class="list-group">
<div class="list-group-item">
<div class="d-flex justify-content-between">
<% products.forEach(product => { %>
<strong>
<%= product.category_icon || "" %>
<div class="list-group-item">
<%= product.name %>
</strong>
<strong>
<small class="text-secondary">
<%= product.name %>
<% if(product.barcode) { %>
</strong>
📊 <%= product.barcode %>
<% } %>
<br>
</small>
</div>
<span class="text-secondary">
</div>
<%= product.category_icon || "" %>
<% }) %>
<%= product.category_name || "Geen categorie" %>
<% }) %>
</span>
</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">
<div class="mb-3">
<label class="form-label">Productnaam</label>
<input
type="text"
class="form-control"
name="name"
placeholder="bijv. Melk"
required>
</div>
<div class="mb-3">
<label class="form-label">Categorie</label>
<select class="form-select" name="category_id">
<option value="">-- Geen categorie --</option>
<% if(categories) { %>
<% categories.forEach(cat => { %>
<option value="<%= cat.id %>">
<%= cat.icon || "" %> <%= cat.name %>
</option>
<% }) %>
<% } %>
</select>
</div>
<button class="btn btn-primary w-100">
Product toevoegen
</button>
</form>
</div>
</div>
</div>
</div>
<% }) %>
</div>
</div>
</div>